Comparatifs

Secretctl vs AgentSecrets: Keeping API Keys Out of Your AI Agent

Your AI coding agent does not need to read your API keys. Secretctl vaults them behind MCP with a tamper-evident audit log; AgentSecrets injects them at the transport layer. Both free, both young.

AI coding assistants are extremely useful and fundamentally nosy: give one access to your project and it can read whatever sits in the folder — including the .env file with your API keys in plain text. One leaked key can mean a drained cloud budget or worse, and the agent does not even need the key itself, only the ability to use it. That gap spawned a new micro-category of free tools, and Secretctl and AgentSecrets are two of its most interesting entries — each lists the other as an alternative, and they solve the problem at different layers.

The short version: Secretctl is a local-first secrets vault built for the AI-assistant era — tools like Claude Code ask for secrets through MCP and get to use them without the plaintext ever entering the conversation, with a tamper-evident audit log recording every access. AgentSecrets is a local proxy — your agent makes authenticated API calls while the real key stays in the OS keychain the whole time, injected only at the transport layer. Both are free and open source.

Secretctl: a vault the agent can use but not read

Secretctl stores secrets locally, encrypted with AES-256-GCM and a key derived via Argon2id — no cloud account, nothing leaves your machine. The clever part is the MCP integration: an AI assistant can request that a secret be used, but the value itself never enters the agent context, so it cannot end up in a transcript, a log or a model provider request. Every access lands in an audit journal chained with HMAC, meaning tampering with history is detectable. It ships as both a CLI and a desktop app, in a single cross-platform binary, under the Apache 2.0 license.

The honest caveats: this is a very young project with essentially one maintainer and a small GitHub following, so you are trusting continuity to one person. It is deliberately not a general-purpose password manager — it covers the developer-secrets use case, not your team logins. And it has not yet been battle-tested at scale.

AgentSecrets: the key never leaves the keychain

AgentSecrets takes the proxy route. Keys live in your operating system keychain; when the agent needs to call an API, the call goes through a local proxy that injects the credential in transit — bearer token, header, query parameter, basic auth, JSON or form body, six styles in all. The agent process never holds the key in memory, which closes off a whole class of leaks. Crypto is X25519 plus AES-256-GCM with a SHA-256-chained audit log, and ready-made MCP servers exist for Claude and Cursor, so setup for the common cases is quick. MIT-licensed, fully free.

The trade-offs mirror its design: a proxy is one more moving part between your agent and the internet — when a call fails, you now debug the proxy too. The project is community-scale (around 167 GitHub stars at the time of research) with no company behind it, and its marketing site was unstable when we checked, which is forgivable for a free tool but worth knowing.

At a glance

SecretctlAgentSecrets
ApproachLocal encrypted vault + MCP accessTransport-layer proxy, key stays in OS keychain
LicenseApache 2.0, freeMIT, free
CryptoAES-256-GCM + Argon2id, HMAC-chained auditX25519 + AES-256-GCM, SHA-256 audit
Form factorCLI + desktop app, single binaryLocal proxy + prebuilt MCP servers
Main limitationSingle-maintainer project, unproven at scaleExtra component to debug, ~167 stars

Verdict: which one should you pick?

Pick Secretctl if you want a vault-centric workflow: secrets organized in one audited place, a desktop app for managing them, and MCP as the controlled doorway your assistant knocks on. The HMAC-chained audit trail is the standout if you care about proving nothing was exfiltrated.

Pick AgentSecrets if your agents actually make API calls as part of their work and you want the strongest guarantee that the key never touches agent memory at all. The six injection styles cover almost any API authentication scheme you will meet.

Both are young enough that you should assume some rough edges and read the source — which, happily, you can. A third option in the same niche is Enject, which injects secrets into agent workflows with its own twist; in a category this new, trying two of the three against your real setup costs an afternoon and tells you more than any comparison table.