Skip to content

Swipe right for a newer agent, Webhook Contract Writer. Swipe left for an older agent, Tone Lock Replies.

Issue 25 · 29 Sep 2026 · Medium · Free

Env Var Auditor

AI .env checker for missing and leaked environment variables

The example file and the code drifted apart, and you cannot tell which key the app will demand at boot.

Category
Coding & Vibe Coding

Sample you can paste

.env.example
PORT=3000
DATABASE_URL=postgres://localhost/ledger
STRIPE_SECRET_KEY=sk_live_replace_me

Code:
const port = process.env.PORT ?? "3000";
const db = process.env.DATABASE_URL;
if (!db) throw new Error("DATABASE_URL is required");
const stripe = process.env.STRIPE_SECRET_KEY;
const region = process.env.FLY_REGION;

Nobody reads FLY_REGION in the paste. The example contains a value that starts with sk_live_. I have not committed a real key. Tell me if the example is unsafe anyway.

Steps

  1. Step 1

    Paste the example and the reads

    Copy .env.example and the lines that read process.env or the equivalent. Redact any real secret first; leave the name. A placeholder is fine.

  2. Step 2

    Paste the prompt

    You get three lists: required by code and missing from the example, present in the example and unread, and names whose values look like live credentials.

  3. Step 3

    Fix the example, not the secret store

    Add the missing key with an obvious fake value. Remove or comment the unused key. Replace any live-looking value with a placeholder like sk_test_replace_me.

  4. Step 4

    Do not paste a rotated secret back into chat

    If a real key was in the file, rotate it in the provider. The auditor's job is the drift. It does not need the secret to finish.

What you get

What you put in and what you get out

When to use it

Use it when .env.example and the code drifted apart and you cannot tell which key the app will demand at boot.

When to skip it

Never paste your real .env with live values. Paste the example file and the code that reads it.

Sample run

0:00

The drift

PORT and DATABASE_URL are read. DATABASE_URL is required. FLY_REGION is read and missing from the example.

Full prompt

env-var-auditor.prompt.txt

You compare an env example file to the code that reads env vars. You flag drift and live-looking placeholders. You do not ask for real secrets and you do not explain how to abuse a key.

INPUTS
- The example file.
- The lines that read env vars, with enough context to see a required check.

RULES
- Missing: read by code, absent from the example. Mark required if the code throws or refuses to boot without it.
- Unused: in the example, not read in the paste. Say the paste may be incomplete rather than claiming the key is dead in the whole repo.
- Live-looking: values that use a live prefix (sk_live_, rk_live_, AKIA, a private key header, a real-looking connection string with a password). Tell them to replace with an obvious fake. Do not repeat the secret; repeat the name and the prefix only.
- Do not invent keys.
- Do not provide exploit steps for a leaked key. The remediation is: rotate in the provider, then replace the example.
- If they pasted a real-looking full key, tell them to rotate and do not echo the value.

OUTPUT
## Missing
## Unused
## Live-looking
## Example lines to change
Name and a safe placeholder.

## Rotate
Yes or no, and which name. No values.

Copied it? Get the Friday roundup. Seven agents and one tip, once a week.

Config

env-var-auditor.defaults.json

{
  "version": 1,
  "livePrefixes": [
    "sk_live_",
    "rk_live_",
    "AKIA",
    "-----BEGIN"
  ],
  "echoSecretValues": false,
  "exploitSteps": false
}
How it works

The auditor compares two pastes: the example file and the lines that read environment variables. A key the code requires and the example hides will break the next boot. A key in the example that nothing reads is how secrets linger. A value that looks like a live credential does not belong in an example, even when you believe it is fake.

It does not need the real secret and should not be given one. It will not tell you how to use a leaked key. It tells you to rotate if a live-looking value was committed, and it shows the placeholder shape.

Update the example in the same commit as the code that reads the new name. Drift is how this list comes back.

Questions about Env Var Auditor

Is it safe to paste env files into a chatbot?

Paste .env.example with placeholders, never real secrets. If the auditor sees something that looks like a live key in the example, it tells you to rotate it.

What does it compare?

The keys the code reads, like process.env.X or os.environ, against the keys the example file lists. You get missing, unused, and suspicious names.

Is Env Var Auditor free?

Yes. The prompt is free to copy, download, and reuse under CC-BY-4.0. There is no sign-up on One Agent a Day. You only need access to a chat model such as Cursor, Claude and ChatGPT.

Which AI tools does Env Var Auditor work in?

It was written for Cursor, Claude and ChatGPT. It is a plain-text prompt, so any capable chat model can run it. Paste the prompt first, then your input.

What do I paste into Env Var Auditor?

Paste the example and the reads. Copy .env.example and the lines that read process.env or the equivalent. Redact any real secret first; leave the name. A placeholder is fine.

Compare and find more

Share this agent

Env Var Auditor — You put in .env.example. You get out The fix. Free from One Agent a Day.

Share on XShare on LinkedIn
Was this useful?

A yes or no is enough. The note stays on this server's log.

Friday email

The week’s 7 agents, in one email

Every Friday. Seven free prompts, one tip, one “paste this first.” Unsubscribe anytime.

One email, every Friday. Confirm on the next page. Unsubscribe anytime.

The daily agent stays free. Pro waitlist is a separate list, and it is not open yet.

Friday email

The week’s 7 agents, in one email

Every Friday. Seven free prompts, one tip, one “paste this first.” Unsubscribe anytime.

One email, every Friday. Confirm on the next page. Unsubscribe anytime.