Let coding agents use your credentials without reading them.
When your coding agent reads an environment file to deploy your app, the token can end up in its conversation.
Secret is a local CLI that runs your program with selected credentials and redacts their literal values from its output, with an optional names-only MCP server and guard hook.
Accident prevention, not a sandbox. Transformed output and arbitrary child behavior remain outside that protection.
Before and after
$ cat .env
API_TOKEN=synthetic-token
Illustrative transcripts. Whatever the command prints becomes part of the conversation.
$ secret stash ~/.secrets.env API_TOKEN
API_TOKEN:
stored API_TOKEN in /home/you/.secrets.env
$ secret run -f ~/.secrets.env \
--key API_TOKEN -- ./deploy.sh
API_TOKEN=<redacted>
API_TOKEN reaches deploy.sh through its environment; if the script echoes the loaded literal value, run prints <redacted> instead. The optional Claude Code or Codex plugin's guard also denies reading the store file itself, as accident prevention.
Install
Linux/macOS
curl -fsSL https://raw.githubusercontent.com/avhn/secret/v0.6.0/install.sh | sh
Windows PowerShell
irm https://raw.githubusercontent.com/avhn/secret/v0.6.0/install.ps1 | iex
Both scripts install the latest release by default and print the executable's absolute path. No GitHub account or gh is needed; rerunning updates the installation. Neither reads stores, registers MCP, installs hooks or edits clients. See setup for pins, rollback, paths and the trust boundary.
Three commands
Example paths. You enter values in your own terminal; agents use show and run.
secret stash ~/.secrets.env API_TOKEN
Reads the value from a hidden prompt and writes the store with a private atomic replacement.
secret show ~/.secrets.env
Prints key names with masked byte lengths, such as API_TOKEN=<40 bytes>, never values.
secret run -f ~/.secrets.env --key API_TOKEN -- ./deploy.sh
Exports only the selected keys to the child's environment and replaces every loaded literal value with <redacted> on its stdout and stderr.
Clients
Setup guides for Claude Code, Claude Desktop via MCPB, Codex, and other local MCP stdio clients. The names-only MCP tools list, show, diff and health never return values, value hashes or lengths; the optional Claude Code and Codex plugins install the Bash guard that denies known store-reading operations.