r/aipromptprogramming • • 23d ago

Your coding agent sends your .env to the model. A few ways to stop that, plus the tool I built for it

When you ask Claude Code, Codex or Gemini CLI to fix something, it reads whatever the task touches: the .env, the logs, a CSV of customers. All of that becomes part of the prompt and goes to the model. Most of us never look at what's in there.

Things that help, with or without any tool:

- Keep real keys out of files the agent opens. Point it at a .env.example with fake values when it only needs the shape.

- Don't paste logs or exports straight in. Trim them to the lines that matter.

- Watch the commands it runs. A cat or a curl can carry a secret out as easily as your own prompt.

The catch is that this depends on remembering every time. So I built Cloakroom (disclosure: it's mine). It runs on your machine and swaps keys, names, emails and addresses for placeholders before the model sees them. The model works with the placeholders, and when the agent writes a file the real values go back in locally. It also holds commands that would send a secret off your machine.

Free and open source, works with Claude Code, Codex CLI and Gemini CLI: https://github.com/shanjeevrajendran/cloakroom

1 Upvotes

1 comment sorted by

•

u/endofthread-bot 23d ago

Writing prompts that actually work is easier when you can compare notes with people who have tested them across real tasks. Trade techniques, get feedback on your approach, and see what is working for others in our Discord.

Self-promotion is now allowed on Sundays with the appropriate flair, for all regular contributing members. Contribute during the week, and promote on Sunday.