AI coding assistants like Claude Code, Copilot, and Cursor read your project files to do their job — and that includes the .env file where your real passwords and API keys live. Most developers only think about this after pasting a session log somewhere public. Enject and AgentSecrets are two free, open-source answers to the same uncomfortable realization, and they attack it at different layers.
The short version: Enject rewrites your .env files so only harmless placeholders (symbolic en:// references) ever sit on disk — an agent reading your project sees nothing real. AgentSecrets goes further down the stack: a local proxy injects credentials at the transport level, so the agent can make authenticated API calls while the real key never enters its memory, staying in your OS keychain. Enject protects what agents read; AgentSecrets protects what agents do.
Enject: placeholders on disk, real values at runtime
The idea behind Enject fits in one sentence: your .env files should contain symbolic references like en://database-password instead of actual secrets, with the real values encrypted (AES-256-GCM with Argon2id key derivation) and resolved only when your app actually runs. Any AI assistant — or any human — reading the repository sees placeholders, not credentials.
It is MIT-licensed, entirely free, and its 501 GitHub stars show real adoption for such a narrowly aimed tool. Credit to the author, too, for being openly honest about what it does not do — a rare quality in security tooling.
The honest limits: it is alpha software (v0.2.0), so breaking changes are possible. It only protects the .env vector — it is not a full secrets manager. And it cannot stop an agent that deliberately writes exfiltration code; it stops casual reads, not malice.
AgentSecrets: the key never enters the agent's memory
AgentSecrets addresses the next question: fine, the agent cannot read my keys — but what if I want it to call an authenticated API on my behalf? Its answer is a free local proxy that injects the credential into the request at transport level, supporting six auth styles (bearer, header, query, basic, JSON, form). The key stays in your OS keychain the whole time, encrypted with X25519 and AES-256-GCM, and every use lands in a SHA-256 audit log.
It ships ready-made MCP servers for Claude and Cursor, which makes wiring it into an agent workflow genuinely quick.
The honest limits: it is a modest community project (167 GitHub stars) with no company behind it, the local proxy is one more moving part to debug when a request fails, and its marketing site was unstable when we researched it — the GitHub repository is the reliable source.
Head-to-head
| Enject | AgentSecrets | |
|---|---|---|
| Layer | Files on disk (.env) | Network transport (API calls) |
| Mechanism | Symbolic en:// placeholders, values encrypted | Local proxy injects auth; key stays in OS keychain |
| Crypto | AES-256-GCM + Argon2id | X25519 + AES-256-GCM, SHA-256 audit log |
| Price | Free, MIT | Free, MIT |
| Traction | 501 GitHub stars | 167 GitHub stars |
| Main limit | Alpha (v0.2.0), .env vector only | Small community, extra proxy to debug |
Verdict: which one should you pick?
Pick Enject if:
- Your worry is agents (or screen shares, or commits) reading secrets out of project files
- You want a minimal change to your workflow — your .env stays, only its contents become safe
- You accept alpha-stage software for a narrow, well-executed fix
Pick AgentSecrets if:
- Your agents need to call authenticated APIs and you refuse to hand them the keys
- You use Claude or Cursor and want the ready-made MCP integration
- An audit trail of every credential use matters to you
Honestly: many setups want both. They are complementary layers, both free — placeholders on disk and injection at transport are not competing bets.
Worth a look too
Secretctl is a free secrets manager designed specifically for the AI-coding-assistant era, and sits closest to these two in spirit. On the heavyweight end, 1Password remains the mature commercial option teams already pay for, with developer tooling that can cover part of the same ground.
Whichever you choose, the real takeaway is the threat model: your coding agent is a well-meaning intern with root access to your repo. Both of these tools exist because that intern should never have known your production password in the first place.