agentic-secrets MCP server
Commit Oct 14, 2026Provides a secure local broker for agents to request secrets that are pasted into the user's OS keystore without the agent ever seeing the actual value.
Also known as arik-web/agentic-secrets
- Stars
- 0
- Tools
- —
- Downloads, 30 days
- —
- Latest version
- —
- Last commit
- Oct 14, 2026
- License
- Unlicense
What is agentic-secrets MCP?
agentic-secrets provides a secure local broker for agents to request secrets that are pasted into the user's OS keystore without the agent ever seeing the actual value.
Summary generated from the project's README
About agentic-secrets MCP server
Developers using AI agents like Claude Code or Codex can protect sensitive credentials by using this local broker to prevent secrets from ever appearing in chat transcripts. Instead of pasting keys directly into a prompt, the agent requests a named secret, which triggers a secure window on your screen. You paste the value into this window, and the broker saves it directly into your operating system's native keystore, such as macOS Keychain, Linux Secret Service, or Windows Credential Manager.
The agent receives confirmation that the secret is available but never sees the actual value. It can then use the secret to run commands via secret_run, which scrubs the output to prevent accidental leaks, or render it into a protected 0600 configuration file using secret_write_file. This setup works locally via MCP over stdio or through loopback HTTP requests, ensuring that sensitive data stays within your system's secure storage and out of the agent's memory or logs.
What you can do with it
- 1Securely providing API keys to agentsRequest a specific secret name so the agent can use it in a command without seeing the plain text.
Written from the project's README. Every use case is checked against a quote from it.
README
View on GitHubSecret Input Layer
Agents need secrets. You do not want to paste secrets into a chat.
This is a local broker. An agent asks for a named secret; a small window opens
on your screen; you paste the value; it lands in your operating system's
keystore — Keychain on macOS, Secret Service on Linux, Credential Manager on
Windows. The agent is told that it worked — never what it is. Then the agent uses it
without reading it: injected into a command's environment, or rendered into a
0600 config file.
Works for Claude Code, Codex, Hermes, or anything that can speak MCP, run a CLI, or make an HTTP request to loopback.
Install
./install.sh # launchers in ~/.local/bin, wiring for every agent found
./run-tests.sh # 136 tests
The flow
agent broker (127.0.0.1) you
| secret_request("stripe.secret_key") |
|------------------------------------------>| window opens
| | paste ────────► Keychain
|<-- {state: fulfilled, fingerprint: 7a1e} |
| secret_run(["stripe","balance"], {SK: "stripe.secret_key"})
|<-- stdout, with the value scrubbed out |
What the window tells you (0.5.0)
Every window says, before you paste anything:
- which secret - its name in large type and the service it belongs to;
- why - the agent's
purpose, which is required (a one-word purpose is refused); - building - the agent's
task; - where to get it -
where_to_find, when the agent knows; - asked by - the asking session, detected by walking the process tree to the Claude Code session record plus its billboard label/purpose, not taken from the agent's word.
Anything the agent did not say is printed as "the agent did not say", never left out.
Being told when it lands
secret_request blocks and returns the instant you hit Save — for most work
that is the whole story. When the agent cannot stay blocked:
secret_events— long-poll the settle feed from any process, any agent, any later turn. Events carry name, state and fingerprint; never a value.notifyon the request — an argvcommandor a loopbackwebhookfired on settle, so something can wake an agent whose turn already ended:
sil request stripe.secret_key --wait 0 \
--notify-webhook http://127.0.0.1:9100/secret-ready
sil events --since 0 --wait 300 # or just block here
Declines and timeouts signal too — you are never left waiting on a window the human already closed.
Using it as an agent
| Tool | What it does |
|---|---|
secret_request |
Opens the paste window. Blocks until you answer. Returns state + fingerprint. |
secret_status |
Polls a request created with wait: 0. |
secret_wait |
Blocks on one request until it is answered, declined or expires. |
secret_events |
The feed of everything that settled, with a cursor. Pass wait to long-poll — this is how an agent that did not stay blocked, or a different agent, finds out. |
secret_list / secret_describe |
Names and metadata. Never values. |
secret_run |
Runs a command with secrets in its environment; output is scrubbed. |
secret_write_file |
Renders {{secret:name}} into a 0600 file. |
secret_delete |
Forgets a secret. |
secret_health |
Is the broker up, and which store is it using. |
Using it as a human
sil status # is the broker up
sil request stripe.secret_key --purpose "charge the test account"
sil paste github.pat # type it here instead of the browser
sil list # names, lengths, fingerprints
sil run --env SK=stripe.secret_key -- stripe balance retrieve
sil write ~/app/.env --template 'STRIPE_KEY={{secret:stripe.secret_key}}'
sil rm stripe.secret_key
More than one box
Most credentials are a pair. Ask once:
sil request kraken --preset api_key_secret --purpose "place a test order"
sil request pg.prod --field host --field user --field password
Presets: token, api_key, api_key_secret, username_password,
oauth_client, connection_string, private_key, aws_keys,
basic_auth_totp. Each box is stored as its own secret — kraken.api_key,
kraken.api_secret — so secret_run and {{secret:...}} reference them
independently. A username renders as a plain text box; a private key gets a
textarea; optional boxes may be left blank.
Naming
<system>.<what>, lowercase: openai.api_key, postgres.prod_url,
github.pat. Stable names mean you paste once and every agent reuses it.
What protects what
- Values never cross the API.
getexists in one module; no route returns it. - The OS keystore, through its C API directly on all three platforms —
the value is never a process argument, so it cannot be read out of
ps. - Loopback only, plus a bearer token in
~/.secret-input-layer/api-token(0600) and a pinnedHostheader, so no web page can reach the broker. - One-shot paste links. A used or expired link is gone; requests expire in 15 minutes.
- Output scrubbing on
secret_run, covering raw, base64 and URL-encoded forms of the value — applied before truncation, so nothing survives at the size boundary. - Write destinations are constrained.
secret_write_filerefuses modes that grant group or other access, refuses to follow a symlink, and refuses shell startup files,authorized_keys,sudoersandLaunchAgents— the paths that would turn a file write into code execution. - Fingerprints use scrypt, not a bare hash. The salt is readable by anything running as you, so a single-pass digest of a short secret would be a free offline oracle.
What it does not protect against
An agent that already runs shell commands as you can read your Keychain by
other means. The broker and the agent run as the same OS user: an agent can
point secret_write_file at a path it is then allowed to cat, or run a
command that transforms the value before printing it. This layer removes the
secret from the transcript and from casual command output — that is the
threat it is built for. It is a guardrail, not a sandbox. secret_run
deliberately reports which secrets it had to scrub.
Minimum secret length is 4 characters, because anything shorter cannot be scrubbed from output without also mangling ordinary text.
Where things live
~/.secret-input-layer/
api-token bearer token for the local API (0600)
index.json metadata: names, purposes, lengths, fingerprints (no values)
fingerprint-salt so fingerprints cannot be brute-forced back to a value
daemon.log method + path only, never a body
Secret values live in the OS keystore under service sil.<name>:
| Platform | Backend | Where it shows up |
|---|---|---|
| macOS | Security.framework |
Keychain Access, login keychain |
| Linux | libsecret / org.freedesktop.secrets |
Seahorse, KWallet, any Secret Service agent |
| Windows | advapi32 Credential Manager |
Control Panel → Credential Manager → Windows Credentials |
On a host with no keystore — a headless server, a session with no D-Bus — they
fall back to 0600 files in ~/.secret-input-layer/store/. The daemon reports
which backend is live in sil status, and SIL_BACKEND pins one explicitly
(keychain, secretservice, wincred, file); naming one that is not
available on this host is an error rather than a silent fallback.
Windows size limit. Credential Manager caps a credential blob at 2560 bytes — roughly 1280 characters — which is well under the 64 KiB this package otherwise allows, and under the size of a typical RSA private key. An oversized value is refused with an explanation rather than truncated. macOS and Linux have no such limit.
Layout
| Path | What |
|---|---|
sil/keychain.py |
macOS Security.framework bindings |
sil/secretservice.py |
Linux libsecret bindings |
sil/wincred.py |
Windows Credential Manager bindings |
sil/store.py |
persistence + metadata index |
sil/pending.py |
outstanding asks, one-shot tokens |
sil/consume.py |
the two ways a value is spent |
sil/api.py |
behaviour, transport-free |
sil/server.py |
loopback HTTP + the paste form |
sil/mcp_server.py |
MCP over stdio, zero dependencies |
sil/cli.py |
the sil command |
docs/wiring.md |
per-agent configuration |
Python 3.11+, standard library only. install.sh picks the newest one on the host.
agentic-secrets MCP questions
Does the AI agent see my passwords?
No, the agent is told that the secret request worked but never sees the actual value. It only receives a fingerprint and uses the secret via environment injection or file rendering.
Where are my secrets actually stored?
Secrets are stored in your operating system's native keystore: Keychain on macOS, Secret Service on Linux, or Credential Manager on Windows.
What happens if I use a headless server without a keystore?
The system falls back to storing secrets in 0600 permission files located in ~/.secret-input-layer/store/.
Can I use this with Claude Code?
Yes, it is designed to work with Claude Code, Codex, Hermes, or any tool that supports MCP, a CLI, or loopback HTTP requests.