Install
Antigravity CLI (agy)
From local clone or checkout:
agy plugin install ./plugins/keyfob
Or install from marketplace/remote. The plugin registers the usage skill and the run_command guard hook automatically.
Codex
git clone https://github.com/shiran-yu/keyfob.git
cd keyfob
codex plugin marketplace add "$PWD"
codex plugin add keyfob@keyfob-local
Start a new Codex thread, then review and trust the plugin hooks when prompted. The hooks run locally and
therefore are not available in Codex Cloud or the public universal plugin directory. The launcher downloads
the matching release binary once and verifies its SHA-256.
Claude Code
Tell Claude Code:
Install https://github.com/shiran-yu/keyfob
It adds the plugin and asks you to restart. The keyfob binary comes with it: fetched once for your machine
and checked against the release's SHA-256.
What Claude runs
claude plugin marketplace add shiran-yu/keyfob
claude plugin install keyfob@keyfob
- Ask the user to restart Claude Code. On first use the plugin's launcher downloads
keyfob-<target>.tar.gz from the matching release and checks it against its .sha256.
On its own, for a server or a script: download keyfob-<target>.tar.gz from
Releases and check it against its .sha256, or
cargo install --git https://github.com/shiran-yu/keyfob.
Why
A token pasted into an agent chat can reach the model and local transcript. A key exported in ~/.bashrc
sits in the environment of every process you start, and one env or cat .env can print it into the
conversation. keyfob keeps the value
in the OS keystore (or a 0600 file where there is none) and hands it to one command at a time, so the
model never needs to see it. What this covers, and what it does not, is below.
In Claude Code
- Paste a token and it is gone before the model sees it. Send
keyfob: s2-key <token> on a line of its
own (optionally followed by the variable name, e.g. S2_API_KEY) and the plugin stores the value before
the message is kept; the model and the transcript get keyfob: s2-key [stored in keyfob]. A bare token in
a format it recognises (OpenAI, Anthropic, GitHub, Hugging Face, Slack, Google, JWT, AWS access key IDs,
Stripe live keys) is stored as pasted-1, pasted-2, … and replaced by [keyfob:pasted-1]. Anything
else, such as a password or a value with a space, is sent as typed: use /keyfob for those.
- Claude asks for a key by name. It calls
keyfob_request; /keyfob opens on that secret with a field
that redraws what you paste as bullets, you press store, and a prompt tells Claude to go on. The value
never becomes a message. You can open /keyfob yourself at any time.
- A guard on Claude's Bash. Commands that would print a secret (
keyfob get, env, echo $TOKEN,
reading the store), carry a literal token, or need a group's secrets without keyfob run are refused
with the fix. It splits the command as a shell does, so a word inside a quoted grep pattern is not taken
for keyfob get, env and the like.
- Plugins say what they need. A plugin lists its keys in a
keyfob.json; keyfob finds it in every
plugin enabled in your user settings, /keyfob shows what is missing and where to get it, and
keyfob check --live asks each service a group declares a check for whether its keys still work.
In Codex