env-credentials

env-credentials is a cursor rule for Cursor from CiscoDevNet/essentials. It costs 232 tokens per session, scanned A, original, Apache-2.0.

A set of rules for handling missing environment variables and login credentials by checking for a project’s .env file. It requires approval before using the file and forbids displaying its secret contents.

In plain words
What is it for?
It is for checking whether a .env file can supply required values, verifying that the file is ignored by Git, and running approved commands with those values loaded.
Why use it?
It provides a safer, consistent response when commands fail because configuration or credentials are missing.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit It is for checking whether a .env file can supply required values, verifying that the file is ignored by Git, and running approved commands with those values loaded.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/ciscodevnet/essentials/env-credentials
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/CiscoDevNet/essentials

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for env-credentials

README.md
[![agentmods](https://agentmods.dev/badge/rules/ciscodevnet/essentials/env-credentials.svg)](https://agentmods.dev/rules/ciscodevnet/essentials/env-credentials)
Your own site
<a href="https://agentmods.dev/rules/ciscodevnet/essentials/env-credentials"><img src="https://agentmods.dev/badge/rules/ciscodevnet/essentials/env-credentials.svg" alt="Measured on agentmods" height="20"></a>
Per session 232 This file is loaded in full into every session.
When invoked 232 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00232 $0.00232
Opus 5 $0.00116 $0.00116
Sonnet 5 $0.00046 $0.00046
Haiku 4.5 $0.00023 $0.00023

Measured 2d ago against content hash 81d4dfca548c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

env-credentials scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/env-credentials.mdc · 34 lines

What it actually says

Environment Variables and Credentials

When a command fails due to missing environment variables or credentials, such as:

  • passphrase must be set with PULUMI_CONFIG_PASSPHRASE
  • Missing required environment variable
  • API key not found
  • Authentication failed
  • Credentials not configured

Do NOT tell the user to run commands in their own terminal.

Resolution Steps

  1. Check if a .env file exists in the current project directory
  2. Ask the user: "I encountered a credentials/environment variable error. Can I source the .env file to get the required values?"
  3. If approved, run commands by sourcing the .env first:
set -a && source .env && set +a && <command>

Security Notes

  • Never read or display the contents of .env files (they contain secrets)
  • Always verify .env is gitignored before proceeding
  • The .env file should contain the required environment variables
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 34 lines · 232 tokens per session scan A 81d4dfca548c

Subscribe to this mod's changes

env-credentials is a cursor rule published in the GitHub repository CiscoDevNet/essentials (7 stars, last pushed 18d ago), licensed Apache-2.0. It adds 232 tokens to every session, about $0.0012 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-04.