# fastsecrets: the whole site as Markdown > Encrypted secrets for people and AI agents. An [age](https://github.com/FiloSottile/age)-encrypted git store (age is a small, widely used open-source file encryption tool) with per-machine keys (Secure Enclave on a Mac), and a native read path: fastsecrets run NAME -- COMMAND hands secrets to a program without printing them, with no daemon and no plaintext cache on the read path. No plaintext copy is kept anywhere by default (a macOS login-keychain cache is opt-in with SECRETS_BACKEND=keychain). --- Page: https://fastsecrets.abediaz.ai/ Encrypted secrets for people and AI agents # The fastest local secrets tool *for agents.* fastsecrets hands a secret to your program in 3 to 9 milliseconds (a blink takes about 100), and nothing lands in the chat, the logs or the command line. Fast enough for a voice agent with a real person waiting on the line. On Linux, it beat every tool we tested. On a Mac, it goes a step further: your key lives inside the Secure Enclave, the same chip that guards your Touch ID and Apple Pay. On Macs fastsecrets asks that chip on every read, keeps nothing unlocked in memory, and still beats every tool that works the same way. ``` curl -fsSL https://raw.githubusercontent.com/abe238/fastsecrets/main/install.sh | sh ``` Prebuilt for macOS and Linux, arm64 and x86_64. Checks the sha256. Never uses sudo. ``` brew install abe238/tap/fastsecrets ``` macOS and Linux. ``` cargo install fastsecrets && fastsecrets setup-libexec ``` From source. Run setup-libexec again after every upgrade. Install See the numbers [Read the story](https://fastsecrets.abediaz.ai/story/) **Read one secret** with a key file. Apple M5 Pro. A shorter bar is faster. - fastsecrets: 3.24 ms - fnox: 6.74 ms - fnox daemon: 7.93 ms - sops: 12.82 ms **Read five secrets** with the key in the Secure Enclave chip. Apple M5 Pro. A shorter bar is faster. - fnox daemon, plaintext cache: 8.00 ms - fastsecrets: 9.06 ms - fnox, same chip, no cache: 61.26 ms Medians from our public benchmark. The details are in "The result." ## Agents remember everything. Including your API keys, secrets and personal information. An agent saves everything it reads in a transcript. If it reads a key once, the key stays there. It stays in the log, in the context window and in later messages. The usual leaks are boring. A value typed into chat. A key passed as an argument, where `ps` and shell history can see it. A debug line that echoes the environment. A commit that carries a `.env`. Then there is speed. Our first tool, a bash script, took about 32 ms to read one secret. That is a third of a blink, and for one read nobody notices. It adds up when an agent reads secrets on every step of a long task, or when a voice agent has a person waiting on every turn. fastsecrets does the same read in about 3 ms. ### Transcripts Whatever an agent reads, it keeps. So the agent should never read a value. ### Command lines Arguments show up in `ps`, shell history and logs. So a value never goes in one. ### Latency Tens of milliseconds per read, on every step, adds up. So a read has to cost a few. ## Fastest with a key file. Fastest with the Secure Enclave chip and no plaintext cache. We built a public benchmark called secrets-index. We ran it on an Apple M5 Pro, a MacBook Air (M4) and a Linux server. Each tool is compared in its own key mode, operation by operation. We publish every timed run, so you can reproduce our math. ### With a key file, it wins every paired comparison on all three machines. No ties. No losses. **Software mode, one secret, median** | machine | fastsecrets | fnox | fnox daemon | sops | paired comparisons won | | --- | --- | --- | --- | --- | --- | | Apple M5 Pro | 3.24 ms | 6.74 ms | 7.93 ms | 12.82 ms | 39 of 39 | | MacBook Air, M4 | 2.92 ms | 5.88 ms | 7.18 ms | 11.62 ms | 41 of 41 | | Linux VPS, 8 cores | 1.59 ms | 11.59 ms | 12.77 ms | 36.64 ms | 41 of 41 | Each row is its own machine. The benchmark does not compare machines with each other. ### With the Secure Enclave chip, it is the fastest of the tools that use the chip on every read and keep no plaintext in memory. A Secure Enclave key, no prompt. It wins 25 of 25 comparisons against that field: fnox and sops. **Chip mode, median** | machine and read | fastsecrets | fnox, chip, no cache | fnox daemon (plaintext cache) | | --- | --- | --- | --- | | M5, one secret | 9.05 ms | 17.90 ms | 8.00 ms | | M5, five secrets | 9.06 ms | 61.26 ms | 8.00 ms | | Air, one secret | 8.54 ms | 16.27 ms | 7.15 ms | | Air, five secrets | 8.55 ms | 55.99 ms | 7.17 ms | **The architecture decision we made.** fnox's daemon beats our chip reads by about 1 ms, by holding every decrypted secret in memory as plain text until it stops, and answering without touching the chip. We chose not to do that. fastsecrets goes to the chip on every read and keeps nothing decrypted between calls. That costs about 1 to 2 ms per call, and one call can read many secrets: five names cost the same 9 ms as one. The gap grows to about 73 ms only when 20 separate programs each ask the chip at the same moment, because their requests wait in line. We think that is the right price for no plaintext sitting in a long-lived process. **Research footnote:** fnox's daemon beats our chip reads by about 1 ms on the M5 (+1.04 ms) and 1.5 ms on the Air (+1.48 ms). It beats our chip mode on 7 of 9 ops. With no cache time limit configured (fnox v1.50.0), the daemon holds every decrypted secret in memory as plain text until it stops, and answers without touching the chip. Per measured op; there is no dump row; counts are for the default build. "Software" means an unencrypted key file at rest plus a names-only index. Chip numbers are compared with the cache-free field (fnox, sops), with fnox's plaintext-cache daemon row shown beside them. Medians of session medians. [Every table, every non-win, every raw attempt](https://fastsecrets.abediaz.ai/benchmark/), or straight to [secrets-index](https://github.com/abe238/secrets-index). ## From 32 ms to 3 ms. Mostly by removing things. This started as a bash script that took 32 ms to read one secret. We rewrote the reader in Rust, a language built for fast, safe programs, and now it takes 3 ms on an M5 Mac. AI agents did a lot of the building, and we kept notes like anthropologists, mistakes included. 1. **Stop spawning [`age`](https://github.com/FiloSottile/age)**, the small, widely used open-source file encryption tool the bash script started for every read. The reader now decrypts the store itself, Secure Enclave keys included. No [`age`](https://github.com/FiloSottile/age) process, no plugin process, no shell. 2. **One decrypt per scope.** Five names cost what one name costs. On the M5 chip path, five secrets take 9.06 ms and one takes 9.05 ms. 3. **A names-only index.** It records which scope holds which name, so a warm read decrypts one scope instead of all of them. No values, no keys. 4. **No PATH search.** The reader never runs a binary it finds on PATH. That closed a security hole (see [the story](https://fastsecrets.abediaz.ai/story/#lessons)). 5. **Native `run`.** The reader puts values in the program's environment and, without `--mask`, becomes the program itself, so no parent holding the values stays alive. With `--mask` it stays as a filter on the program's output. **Same machine, same protocol (M5, software key)** | | bash tool | fastsecrets | | --- | --- | --- | | read one secret | 32.07 ms | 3.24 ms | | start a program with one secret | 45.44 ms | 4.70 ms | | start a program with five secrets | 174.53 ms | 4.75 ms | We did not measure each step's saving in isolation. The table shows where it started and where it ended. **Research footnote:** Round 1 timed the bash read at 46 to 48 ms; under the final protocol, its software-key read measured 32.07 ms. [![Two read paths side by side. fastsecrets get is one native process (run takes the same path): process start, read key and scopes, the names-only index, decrypt in-process with no age binary, value out plus an access log line; 3.24 ms get1 median on the M5 with a software key, 9.05 ms with the Secure Enclave. The old bash reader starts bash, lists scopes, spawns age -d per scope, lets age decrypt the whole scope and finds the line with awk; 32.07 ms. Bars below compare get1 medians: software key fastsecrets 3.24, fnox 6.74, fnox daemon 7.93, sops 12.82, the old bash reader 32.07, pass 41.86; Secure Enclave fnox daemon with its cache 8.00, fastsecrets 9.05, fnox 17.90, sops 25.68.](https://fastsecrets.abediaz.ai/assets/diagrams/read-path-light-1200.webp)](https://fastsecrets.abediaz.ai/assets/diagrams/read-path-light@2x.webp) Where the milliseconds go. **Research footnote:** The 0.34 ms in the diagram's top note is one sandbox trace on the M5, not a benchmark figure. [Read the whole story: the timeline, the lessons and the agents' mistakes](https://fastsecrets.abediaz.ai/story/) ## Built for the hot path. A voice agent has a person on the line, and every pause is one they hear. Three rules keep secrets out of that pause and out of the transcript. - **Batch every name a step needs into one call.** One `run` with five names costs about what one costs. Five separate calls cost five process starts and, with a chip key, five chip operations that queue behind each other. - **Use `run`, not `get`.** `run` hands values to the program and prints nothing. `get` prints, and printed values land in transcripts. - **Read at start, not per turn.** Read the key once when the engine starts. Then a turn costs nothing. ``` fastsecrets run --mask ANTHROPIC_API_KEY OPENAI_API_KEY -- python voice_agent.py ``` ### The Sparephone test We wrapped a voice agent's start command in `run` and replayed 60 turns per condition. - **About +3 ms at process start.** - **0 ms per turn.** The key is read once, when the engine builds. - **No value in argv, in files or in the replay output.** - **One honest catch:** the key was visible in the child's environment to `ps` run by the same user. See the security model. - **Then a real call.** We stored a real API token, wrapped the live agent in `run` and phoned it. The key was ready in 9.0 ms with a Secure Enclave key. The call ran 10 turns, and a scan of every log and transcript found 0 traces of the token. **Research footnote:** Process start cost +3.2 ms median, about +4 ms with masking on. We sampled the process list about 140 times during two of the replay pairs and scanned every output file. The replay was simulated, on one Mac (echo brain, fake speech output, real Whisper speech-to-text), with a software key and reader version 0.3.1. It shows startup cost and transcript hygiene. It does not show a live model turn. One call, three dummy keys. `agent-step.sh` is a three-line stand-in for an agent step: it counts the keys it received and prints none. **Slow reads, if you read on the chip every step:** on the M4 Air, some chip reads take much longer than the typical one. Reading once at start keeps that out of every turn. **Research footnote:** On the M4 Air, 90% of chip reads finished within 14.25 ms against a median of 8.54 ms. fnox's chip read without its daemon shows the same jump, so it looks like the Air's Secure Enclave path; the cause was not investigated. On the M5 the jump is rare. ## What it stops. What it does not. Your secrets live in [age](https://github.com/FiloSottile/age)-encrypted files in a git repository you own, one file per scope. Think of a safe with drawers: each of your machines has its own key, and it opens only the drawers you gave it. On a Mac, that key never leaves the Secure Enclave chip. ### Protects against - **A copied key file, in chip mode.** The key file is a handle only this Mac's chip can use. A backup, a synced folder or a stolen disk image of it decrypts nothing anywhere else. - **A machine reading a scope it was not encrypted to,** even with the file in hand. The boundary is cryptography. - **Accidental leaks into transcripts, shell history, `ps` output, logs and commits.** No value on a command line. `run` never prints. `--mask` replaces an accidental echo with `[secret:NAME]`. The access log records names only. - **A planted [`age`](https://github.com/FiloSottile/age) or plugin on PATH, for `get` and `run`.** The native reader never searches PATH. - **Silent corruption.** Every write proves its ciphertext decrypts back before replacing the old one. ### Does not protect against - **The Mac keychain cache, if you opt in.** It is off by default. With `SECRETS_BACKEND=keychain` on a Mac, writes and every `load` or hourly sync copy values into the login keychain, for other programs that read it. Those copies are as safe as your login keychain, and the chip does not guard them. The native `get` and `run` never read it. - **Same-user `ps` reading a child's environment.** `run` puts values in the program's environment. While that program runs, another process running as you can read that environment. We confirmed this on macOS. - **Anything running as you.** A process in your account can run fastsecrets and use this machine's key. The Secure Enclave stops the key being copied. It does not stop it being used. - **The program you hand a secret to.** It holds the value and can print or send it in any form. `--mask` matches exact values only; a base64 or URL-encoded copy gets through. - **A planted [`age`](https://github.com/FiloSottile/age) on PATH, on the bash side.** Writes, `load`, `get --copy` and a `run` with a website login run the [`age`](https://github.com/FiloSottile/age) they find on PATH. - **Software mode at rest.** The key file is the whole key. Disk encryption is your protection. - **Revocation and metadata.** Deleting does not un-read a value; rotate at the source. Names are not encrypted; values are. - **Whoever can push to your store's remote.** Keep it private. `--mask` catches an accidental echo of an exact value. An encoded copy, such as base64, gets through. [![Architecture of fastsecrets. A coding agent and a voice agent call fastsecrets run --mask, the native Rust reader, which has no daemon and no plaintext cache. It reads ciphertext from the scope files in a git repo, decrypts in-process with this machine's key (a software key file, mode 600, or a Secure Enclave key that stays in the chip) and hands values to your command in its environment, nothing printed. The bash tools for set, edit and init encrypt with age and commit. Dashed lines: git push and pull to a private git remote, and load with an hourly sync to other machines, each with its own key. Each scope is encrypted only to the keys in recipients/.txt.](https://fastsecrets.abediaz.ai/assets/diagrams/architecture-light-1200.webp)](https://fastsecrets.abediaz.ai/assets/diagrams/architecture-light@2x.webp) One store, many machines, one key per machine. Dashed lines are the write side and sync (bash tools, git). Not drawn: the Mac keychain cache, which is opt-in and off by default. ## Why not the Keychain? Every Mac has a Keychain. For an agent, it has two problems. It is about 2 times slower than fastsecrets with a key file. And it can stop and wait for a person to click "Allow". ### Speed Reading one secret from a keychain file with Apple's `security` tool took 6.64 ms on the M5. fastsecrets with a key file took 3.24 ms. With the Secure Enclave chip, fastsecrets is slower than the Keychain: 9.05 ms for one read. When 20 separate programs read at the same moment, chip mode takes 93.25 ms against the Keychain's 24.97 ms, while one call that reads several names still takes about 9 ms. securityd, the keychain daemon, keeps the keychain unlocked in memory, and we go to the chip on every read. **Research footnote:** Each keychain read starts `security` and makes a call to securityd. The benchmark read a throwaway keychain file, not the login keychain, to keep dialogs out of the timings. ### Prompts The login keychain can raise an "allow access" or password dialog, and an agent has no one to click it. With no screen (an agent, SSH, a sandbox) the call can fail or hang (one of our own keychain tests hung for 8 minutes in a sandbox). fastsecrets makes its chip key with no per-use prompt, so a read never stops to ask. **The trade-off** | | macOS Keychain | fastsecrets software | fastsecrets chip | | --- | --- | --- | --- | | One read (M5) | 6.64 ms | 3.24 ms | 9.05 ms | | Where the unlocking key lives | your login password; the keychain stays unlocked while you are logged in | a key file on disk | inside the Secure Enclave; it cannot be copied off | | Other processes running as you | can read values while it is unlocked, once allowed (items saved with `-A` need no allow step) | can read the key file | can use the key, cannot take it away | | Prompts or hangs | yes, with no screen | never | never (no per-use prompt on the key) | | Linux | no | yes | no (Mac only) | | Copies of each secret | a second copy to keep in sync | one encrypted store | one encrypted store | [The keychain rows for the M5 and the Air](https://fastsecrets.abediaz.ai/benchmark/#keychain). Want a keychain copy anyway, for other programs? It is an opt-in: [see the docs](https://fastsecrets.abediaz.ai/docs/#keychain). ## 60 seconds, four commands. Install with one of the three lines at the top, then: ``` fastsecrets init # a new store and this machine's key fastsecrets set OPENAI_API_KEY # prompts twice, hidden; or pipe it in fastsecrets run OPENAI_API_KEY -- python app.py # the program gets the key; fastsecrets prints nothing # (add --mask in case the program does) fastsecrets list # names and scopes, never values ``` - `init` makes the store at `~/.config/fastsecrets` (a git repository) and a key. On a Mac with [age-plugin-se](https://github.com/remko/age-plugin-se), the key lives in the Secure Enclave. - `set` never takes the value as an argument. Run it in your own terminal, never in an agent's chat. - The write side needs [age](https://github.com/FiloSottile/age) 1.3 or newer and git (`brew install age age-plugin-se` on a Mac). `get` and `run` need neither. - More machines: add a private git remote and enroll each machine with its own key. A private key is never copied between machines. [The full guide: scopes, machines, sync, recovery, troubleshooting](https://fastsecrets.abediaz.ai/docs/) Recorded in a throwaway home folder with a dummy value. `run` hands the value to the program; nothing prints it. ## Rules your agent can follow today. Paste these into your agent's instructions, or link the ready-made skill. `--mask` turns on by itself when the shell looks like an agent's (`CLAUDECODE`, `CODEX_THREAD_ID`, `GEMINI_CLI`, `CURSOR_AGENT` and others). Pass it anyway. ``` - Read secrets only with: fastsecrets run --mask NAME... -- COMMAND - Never run a bare fastsecrets get. Its output is the value, and it lands in your transcript. - One run per step, with every name the step needs. - Never put a value on a command line, in a file, a commit, a log, a memory or a message. - To store a value, tell the user to run: fastsecrets set NAME (in their own terminal). - If a value shows up in a transcript or log, say so. The user rotates it at the provider. ``` ### [SKILL.md](https://fastsecrets.abediaz.ai/agents/#skill) A ready-made agent skill with these rules, error meanings and the exact steps for storing a new key. Install: `ln -sfn "$PWD/skill" ~/.claude/skills/fastsecrets` ### [AGENTS.md](https://fastsecrets.abediaz.ai/agents/#agentsmd) Rules for coding agents that use fastsecrets or work on its code. ### [llms.txt](https://fastsecrets.abediaz.ai/llms.txt) A short index for agents: install lines, the three commands, the rules, links. ## Don't trust us. Check it. secrets-index is a public, peer-checkable benchmark of local secrets tools. It ships every timed attempt, so anyone can recompute every table and verdict with Python 3 and one command. ``` python3 verify.py # 4 to 7 minutes on an Apple M5 Pro python3 verify.py --quick # about 10 s ``` `verify.py` recomputes every table and verdict from the published data and compares the result with the published output. It exits non-zero on any mismatch. **Research footnote:** `verify.py` checks the sha256 of every data file, recomputes every table, runs two independent recomputes, reruns every verdict and diffs the result byte for byte against the published output. The quick mode only: it skips the slowest checks. The full run takes minutes. ### How it is fair - Each tool runs in its documented default mode, compared mode to mode. - Each session runs hundreds of timed rounds, in a random order. - A win has to be clear. A small or uncertain gap counts as a tie. - No blended score. One table per operation per machine. - **Conflict of interest, stated up front:** the benchmark's author wrote one entrant. It is tagged `[author]` everywhere. Some protocol changes came after data was seen, and each one is dated in PROTOCOL.md. **Research footnote:** Each session is 20 warmup rounds and 300 timed rounds, in a seeded random order. A win needs a 95% interval that excludes zero and a gap above 0.5 ms and 5%. The protocol was frozen as v0.2 before the product changes were measured; v0.3 and v0.3.1 were amended after data was seen. ### What we report against ourselves The fnox daemon row and its 7 wins over our chip mode. **Rerun it on your machine:** RERUN.md has the exact commands, timing estimates and hardware notes for macOS and Linux. Known gaps are listed in GAPS.md. **Add your tool:** open a ["Request a tool" issue](https://github.com/abe238/secrets-index/issues/new?template=request-a-tool.yml) on GitHub, or add it yourself (RERUN.md, "Adding a tool") and open a pull request. **Research footnote:** Adding a tool takes a pinned install, a generator entry with its documented default mode and exact argv, 5 of 5 on validate, and a new session set. [All results, per machine and mode](https://fastsecrets.abediaz.ai/benchmark/) ## Questions **Is it really the fastest?** With a key file (software mode), yes: it wins every paired comparison on an M5 Mac, an M4 Air and a Linux VPS. With the Secure Enclave chip it is the fastest of the tools that use the chip on every read and keep no plaintext in memory. fnox's daemon is faster there only because it caches decrypted secrets in memory with no expiry. **Why not cache decrypted secrets like fnox's daemon?** On the chip, a cache wins by about 1 to 2 ms per call, and one call can read many secrets at once: five names cost the same 9 ms as one. The gap grows to about 73 ms only when 20 separate programs each ask for a secret at the same moment, because their chip requests wait in line. It also keeps every secret in plain text in a long-lived process. We decrypt on every call and keep nothing between calls. **What does "software mode" mean?** An unencrypted key file at rest, plus a names-only index. Anyone who can read the key file can read every secret it is a recipient of. It is the same key-at-rest class as the rivals it was compared with. On Linux, it is the only mode. **Does it need a daemon or a background process?** No. `get` and `run` keep nothing resident and write no decrypted value to disk. `sync install` runs an hourly `load` to keep machines current. That job runs on a schedule and serves no reads. **Will it slow down my voice agent?** In our simulated test, wrapping the agent's start command cost about 3 ms at startup and 0 ms per turn, because the key was read once. **Can another program see the secret?** The program you hand it to can. While it runs, another process running as you can read its environment with `ps`. No other plaintext copy is kept by default; a Mac login-keychain cache is opt-in with `SECRETS_BACKEND=keychain`. **Where do my secrets live?** In [age](https://github.com/FiloSottile/age)-encrypted files in a git repository you own, one file per scope. You can open them with plain [`age`](https://github.com/FiloSottile/age) and a recovery key, without fastsecrets. **What happens if I lose my Mac?** A chip key does not survive a new logic board or a new Mac. That is what the recovery key is for: `fastsecrets recovery init` makes one extra key, locked with a passphrase, that you keep off your machines. **Can I add my tool to the benchmark?** Yes. Open a ["Request a tool" issue](https://github.com/abe238/secrets-index/issues/new?template=request-a-tool.yml) on GitHub, or add it yourself (RERUN.md, "Adding a tool") and open a pull request. --- Page: https://fastsecrets.abediaz.ai/docs/ On this page 1. Install 2. Create a store 3. Add a secret 4. Use a secret: run 5. Read a secret: get 6. List, change, delete 7. Scopes 8. More machines 9. Secure Enclave or software key 10. Sync 11. Keychain 12. Verify 13. Recovery key 14. Environment variables 15. All commands 16. Troubleshooting 17. Uninstall 18. Limits # The fastsecrets guide One store, many machines. Each secret lives in an [age](https://github.com/FiloSottile/age)-encrypted file (age is a small, widely used open-source file encryption tool) in a git repository you own. Each machine holds its own key (inside the Secure Enclave on a Mac) and decrypts only the scopes it was encrypted to. `get` and `run` are a single native call with no daemon and no plaintext cache of their own. ## Install Pick one. All three install `fastsecrets` with its helper scripts next to it (`install.sh` tells you when its `bin` folder is not on your PATH yet). ``` curl -fsSL https://raw.githubusercontent.com/abe238/fastsecrets/main/install.sh | sh ``` Prebuilt for macOS and Linux, arm64 and x86_64. Checks the sha256. Never uses sudo. ``` brew install abe238/tap/fastsecrets ``` macOS and Linux. ``` cargo install fastsecrets && fastsecrets setup-libexec ``` From source. Run setup-libexec again after every upgrade. - `install.sh` installs into `~/.local`. Use `--prefix DIR` to change it and `--version vX.Y.Z` to pin one. - The prebuilt macOS binaries need macOS 14 or newer. On an older Mac, build from source. - After `cargo install`, `fastsecrets setup-libexec` writes the helper scripts (built into the binary) to `~/.cargo/libexec/fastsecrets`. Run it again after every `cargo install` upgrade. - **The write side needs [age](https://github.com/FiloSottile/age) 1.3 or newer and git.** On a Mac: `brew install age age-plugin-se` ([age-plugin-se](https://github.com/remko/age-plugin-se) gives you a Secure Enclave key). On Linux: git and [age](https://github.com/FiloSottile/age) 1.3 or newer. Many distributions still package an older [age](https://github.com/FiloSottile/age); the [age releases](https://github.com/FiloSottile/age/releases) have static binaries. `get` and `run` need neither. ## Create a store ``` fastsecrets init ``` `init` creates `~/.config/fastsecrets` (a git repository), a key at `~/.config/age/key.txt` (a Secure Enclave key on a Mac with [age-plugin-se](https://github.com/remko/age-plugin-se), else a plain [age](https://github.com/FiloSottile/age) key file, mode 600), the recipients list for the `all` scope, and a first commit. It never touches an existing store: run again, it reports there is nothing to do. `init --file` makes a software key file instead of a Secure Enclave key. Nothing is copied into the Mac login keychain unless you opt in with `SECRETS_BACKEND=keychain`; then writes also copy values into it, as a cache for other programs. See Sync and the [security model](https://fastsecrets.abediaz.ai/#security). ## Add a secret ``` fastsecrets set OPENAI_API_KEY ``` `set` prompts for the value twice (hidden) and never takes it as an argument, because arguments are visible in `ps` and end up in shell history and transcripts. Run it in your own terminal, never in an agent's chat. Piping works: ``` printf '%s' "$TOKEN" | fastsecrets set NAME ``` - `--ttl 2h` (s m h d w, for example `1h30m`) stops it being served after the limit on every machine. - `--scope S` picks the scope (default `all`). - Each write is checked and committed, and pushed when there is a remote. A write that cannot be committed or pushed is undone on this machine. **Research footnote:** Each write validates first, re-encrypts, proves the result decrypts back, commits, pushes when there is a remote, and refreshes this machine. Only one write runs at a time (a kernel file lock). A machine whose remote is read-only refuses writes up front. ## Use a secret: run `run` puts values into a program's environment and prints nothing. This is the way an agent should use a secret. ``` fastsecrets run OPENAI_API_KEY -- python app.py fastsecrets run --mask OPENAI_API_KEY -- python app.py fastsecrets run --mask GH_TOKEN=GITHUB_TOKEN -- gh api user # another variable name fastsecrets run --mask P=login:example.com U=login:example.com:username -- ./post.sh # a website login ``` - **SPEC** is `NAME`, `VAR=NAME`, or `VAR=login:SITE[:FIELD]` (FIELD: password, username, url, note). - **All or nothing.** A missing, empty, expired or ambiguous secret exits 1 and prints nothing; the program is not started with half of what it asked for. - **One `run` per step, every name in it.** A read that asks for five names costs one decrypt per scope file, the same as one name. Separate calls cost separate process starts and, with a Secure Enclave key, separate chip operations that queue behind each other. - **Without `--mask`**, `run` becomes the program itself, so no process holding the values stays behind. - **`--mask`** replaces any secret value the program prints with `[secret:NAME]`, and fastsecrets stays alive as a filter on the program's output. It turns on by itself in a shell that sets a known agent variable (`CLAUDECODE`, `CODEX_THREAD_ID`, `GEMINI_CLI`, `CURSOR_AGENT`, `OPENCODE`, `AI_AGENT`, ...) or `SECRETS_AGENT=1`; pass it anyway. It guards against an accidental echo of an exact value only: an encoded form (base64, URL-encoded) gets through. - **`--fd N NAME`** hands a value on file descriptor N instead of the environment. - **A website login spec** moves the whole call to the bash side, which is slower and reads each value separately. Keep login specs out of a hot path. - **Exit codes:** `run` exits with the program's status (126 when it cannot be executed, 127 when it is not found). ## Read a secret: get `get` prints values, so it is for scripts. Never run a bare `get` where an agent reads the output. ``` v="$(fastsecrets get NAME)" # one name: the bare value fastsecrets get A B C # NAME=value lines, all or nothing fastsecrets get NAME --copy # to the clipboard, cleared after 30 s ``` Exit codes: 0 success, 1 failure (missing, expired, refused), 2 usage error. **Research footnote:** `get` and `run` are answered by the binary; `get --copy` and a `run` with a website login go to the bash scripts in `/libexec/fastsecrets/`, found next to the binary itself and never on PATH. ## List, change, delete ``` fastsecrets list [--scope S] # names and scopes, never values fastsecrets rm NAME [--scope S] # delete fastsecrets edit [--reencrypt] [--logins] [S] # edit a whole scope in $EDITOR (people only) fastsecrets purge # drop secrets past their time limit fastsecrets log [NAME] # access log, names only fastsecrets login set|get|list|rm # website logins ``` Deleting is not revoking: rotate the secret at its source too. Old versions stay in git history. Website logins: `fastsecrets login set example.com --user NAME` prompts for the password. ## Scopes A scope is a recipients list. `store/.env.age` is encrypted only to the public keys in `recipients/.txt`, so a machine outside that list cannot read it even while holding the file. The boundary is cryptography. - `init` makes `all`. Make more by writing `recipients/.txt` and `fastsecrets set NAME --scope `. - A name lives in one scope only. - Website logins default to a scope named `mac` when the store has one (a scope kept to your desktops), else to `all` while `all` reaches only this machine (a recovery key aside). When `all` is shared with other machines, `login set` asks for `--scope`, so a website password never lands on a server by default. ## More machines Give the store a private git remote: ``` git -C ~/.config/fastsecrets remote add origin URL && git -C ~/.config/fastsecrets push -u origin HEAD ``` ### Enroll a new machine A private key is never copied between machines. ``` # on the new machine: install fastsecrets and age, then git clone ~/.config/fastsecrets fastsecrets key new # prints this machine's public key # on a machine that can push: add a "# name" line and the key to recipients/.txt fastsecrets edit --reencrypt # required: the list does nothing until re-encrypted # back on the new machine fastsecrets load && fastsecrets sync install && fastsecrets verify ``` A server can pull with a read-only deploy key; it can then read but never rewrite the store. ### Remove a machine Delete its lines from `recipients/*.txt` and run `fastsecrets edit --reencrypt ` for each scope. It already read the current values, and git history keeps every old ciphertext, so rotate the secrets at their source too. ## Secure Enclave or software key | | Secure Enclave (Mac with [age-plugin-se](https://github.com/remko/age-plugin-se)) | Software key (Linux, or `--file`) | | --- | --- | --- | | Key file at `~/.config/age/key.txt` | a handle only this Mac's chip can use | the whole private key, mode 600 | | A copy of the key file (backup, synced folder, stolen disk image) | decrypts nothing anywhere else | decrypts every scope it is a recipient of | | Per-use prompt | none (`--access-control none`, so jobs and agents work unattended) | none | | Survives a new logic board or a new Mac | no: that is what the recovery key is for | yes, if you copy the file | | Public key | `age1tag1...`, which [age](https://github.com/FiloSottile/age) 1.3+ encrypts to with no plugin | `age1...` | `fastsecrets key` shows this machine's key and its kind; `fastsecrets key new [--file]` makes one (`init` does this for you). The Secure Enclave protects against the key being copied, not against a process on this Mac using it. Only with the opt-in `keychain` backend does the login keychain hold copies of the values. Speed: in the benchmark on the M5, a software key reads one secret in 3.24 ms and a Secure Enclave key in 9.05 ms. [All results](https://fastsecrets.abediaz.ai/benchmark/). **Research footnote:** About 4.5 ms of every chip read is the Secure Enclave itself. Both numbers are medians of session medians for the get1 row, Apple M5 Pro. ## Sync ``` fastsecrets sync install # run load every hour fastsecrets sync status fastsecrets sync remove fastsecrets load # pull and verify ``` `sync install` runs `fastsecrets load` every hour: a LaunchAgent labeled `com.fastsecrets.sync` on macOS, a cron line tagged `# fastsecrets-sync` on Linux. With the opt-in `keychain` backend on a Mac, `load` also fills the login keychain as a cache for other programs, and prunes what the store no longer defines. `fastsecrets verify` reports a sync that stopped. **The Mac keychain cache is off by default.** To opt in, set `SECRETS_BACKEND=keychain` on your fastsecrets calls. To keep it on for the sync job, add the variable to the LaunchAgent's `EnvironmentVariables` yourself: `sync install` does not carry it into the job. ## Keychain fastsecrets keeps no keychain copy unless you opt in. `get` and `run` read the encrypted store. The opt-in, on a Mac: with `SECRETS_BACKEND=keychain`, every write (`set`, `rm`, `edit`) and every `load` or hourly sync copies each value of the scopes this Mac reads into the login keychain, for programs that read secrets from the keychain. `load` also prunes what the store no longer defines. - **The native `get` and `run` never read the copy.** Only the bash side does: `get --copy` and a `run` with a website login. When the login keychain is locked in the session (over SSH, for example), they read the store with this machine's key instead. - **The copies are guarded by the login keychain, not by the Secure Enclave key.** They are written as items any app can read (`-A`). - **It is a second copy of every secret**, refreshed by writes and `load`. Why we leave it off, with the numbers: [Why not the Keychain?](https://fastsecrets.abediaz.ai/#keychain) ## Verify ``` fastsecrets verify [--offline] ``` Checks that this machine's copy is sound and current: recipients against ciphertext, and a sync that stopped. Run it when a secret looks stale or missing, and read its `problem:` lines. ## Recovery key ``` fastsecrets recovery init ``` In your own terminal, `recovery init` makes one extra key, locked with a passphrase, adds it to every scope, and re-encrypts. Move the file off your machines. `fastsecrets recovery test FILE` proves it still opens every scope. With only the file, the passphrase and a copy of the store, plain [age](https://github.com/FiloSottile/age) reads it, without fastsecrets: ``` age -d -i fastsecrets-recovery-key.age store/all.env.age ``` A Secure Enclave key does not survive a new logic board or a new Mac. That is what the recovery key is for. ## Environment variables | Variable | Default | What | | --- | --- | --- | | `SECRETS_DIR` | `~/.config/fastsecrets` | the store (a git repository) | | `AGE_KEY` | `~/.config/age/key.txt` | this machine's key | | `SECRETS_STATE_DIR` | `${XDG_STATE_HOME:-~/.local/state}/fastsecrets` | access log, sync log, index | | `SECRETS_BACKEND` | `age` | bash side: [`age`](https://github.com/FiloSottile/age) reads the store; `keychain` (macOS opt-in) also keeps a login-keychain copy | | `SECRETS_AGENT` | unset | `1`: treat this shell as an agent's (masking on, editors refused) | | `SECRETS_ALLOW_KEYCHAIN` | unset | `1`: let `load` fill the login keychain from a store outside the default path | | `SECRETS_KEYCHAIN` | login keychain | a keychain file for the cache (tests) | | `SECRETS_LOCK_WAIT` | `120` | seconds a write waits for another write to finish | | `SECRETS_COPY_SECONDS` | `30` | how long `--copy` leaves a value on the clipboard | | `SECRETS_FAST_AGE` | unset | absolute path of an [`age`](https://github.com/FiloSottile/age) binary for key types the reader cannot use natively | | `SECRETS_FAST_TRACE` | unset | `1`: phase timings on stderr (names and times only) | | `EDITOR` | `vi` | for `edit` | An empty value counts as unset. ## All commands ``` fastsecrets init [--scope S] [--file] create a store and this machine's key fastsecrets run [--mask] [--fd N NAME] SPEC... -- COMMAND COMMAND with secrets in its environment fastsecrets get NAME [NAME...] print values (one name: the bare value) fastsecrets get NAME --copy to the clipboard, cleared after 30 s fastsecrets list [--scope S] names and scopes, never values fastsecrets set NAME [--scope S] [--ttl 2h] create or replace (prompts, or stdin) fastsecrets rm NAME [--scope S] delete fastsecrets edit [--reencrypt] [--logins] [S] edit a whole scope in $EDITOR (people only) fastsecrets purge drop secrets past their time limit fastsecrets login set|get|list|rm website logins fastsecrets load [--no-pull] [--render PATH] pull and verify; with SECRETS_BACKEND=keychain fill the login keychain fastsecrets sync install|remove|status|run run load every hour (LaunchAgent or cron) fastsecrets verify [--offline] is this machine's copy sound and current? fastsecrets key [new [--file]] this machine's key fastsecrets recovery init|test an offline, passphrase-locked recovery key fastsecrets export FILE.xlsx|.csv [--logins] everything in plain text (people only) fastsecrets log [NAME] access log, names only fastsecrets help [COMMAND] | version | setup-libexec ``` ## Troubleshooting | Message | Meaning | Do | | --- | --- | --- | | `not found` | no secret of that name on this machine | check `fastsecrets list`; store it with `fastsecrets set NAME` | | `expired at ...` | it was stored with a time limit | set it again if still needed | | `more than one readable scope` | the name exists twice | remove one with `fastsecrets rm NAME --scope S` | | `cannot push to the store's remote` | this machine has read-only access | make the change on a machine that can push | | `decrypts none of the scope(s)` | this machine's key is not a recipient | see Enroll a new machine | | `helper scripts, which are not installed` | a `cargo install` without the bash side | run `fastsecrets setup-libexec` | | `no age identity` | no key on this machine yet | first machine: `fastsecrets init`; a machine joining an existing store: Enroll a new machine, not `init` | - **A secret looks stale or missing:** run `fastsecrets verify` and read its `problem:` lines. - **The output shows `[secret:NAME]`:** the program echoed a secret value and `--mask` hid it. - **A key type the reader cannot use natively** (for example a post-quantum Secure Enclave key, an ssh key or a passphrase file): nothing is read, the call exits 1, and the message names `SECRETS_FAST_AGE`, which takes the absolute path of an [`age`](https://github.com/FiloSottile/age) binary to hand those reads to. - **Where a read spent its time:** `SECRETS_FAST_TRACE=1` prints phase timings on stderr (names and times only). ## Uninstall fastsecrets has no uninstall command. These steps remove what this guide says it creates. 1. **Stop the hourly sync:** `fastsecrets sync remove`. 2. **Keep a way back in, or decide you do not need one.** Your secrets are in the store, encrypted to this machine's key. A Secure Enclave key cannot be copied: once it is gone, only a recovery key or another enrolled machine opens the store. If other machines use the store, remove this machine first (see Remove a machine). 3. **Remove the program.** Homebrew: `brew uninstall fastsecrets`. Cargo: `cargo uninstall fastsecrets`, then delete `~/.cargo/libexec/fastsecrets`. `install.sh`: delete `~/.local/bin/fastsecrets` and `~/.local/libexec/fastsecrets` (or the same two under the `--prefix` you chose). 4. **Remove the data you no longer want:** the store at `~/.config/fastsecrets` (and its git remote), the key at `~/.config/age/key.txt`, and the state folder at `~/.local/state/fastsecrets` (access log, sync log, index). These are the defaults; `SECRETS_DIR`, `AGE_KEY` and `SECRETS_STATE_DIR` move them. 5. **On a Mac, check the login keychain, if you opted in.** Only with `SECRETS_BACKEND=keychain` did writes and `load` copy values into it. Deleting the store folder does not remove those copies. Look for your secret names in Keychain Access. ## Limits - Single-line values only (base64 a PEM key first). Names: `A-Z a-z 0-9 _`, not starting with a digit. - A scope cannot be emptied by an edit: a scope with nothing in it is far more often a truncated edit than an intention. - Not post-quantum by default. [age](https://github.com/FiloSottile/age) and the Secure Enclave plugin offer post-quantum keys, but [age](https://github.com/FiloSottile/age) will not mix them with classic ones, so every machine and the recovery key would have to move together. The reader reads post-quantum software keys. - The bash side is bash 3.2 compatible (macOS `/bin/bash`). More: the [README](https://github.com/abe238/fastsecrets/blob/main/README.md), and [DESIGN.md](https://github.com/abe238/fastsecrets/blob/main/DESIGN.md) for the reader's contract. --- Page: https://fastsecrets.abediaz.ai/agents/ For AI agents and the people who run them # You use credentials. You never see them. An agent keeps everything it reads in a transcript, so the rule is that an agent never has a value printed at it. fastsecrets hands secrets to the program that needs them and prints nothing. ## The rules Paste these into your agent's instructions: a system prompt, `CLAUDE.md`, `AGENTS.md` or a rules file. ``` - Read secrets only with: fastsecrets run --mask NAME... -- COMMAND - Never run a bare fastsecrets get. Its output is the value, and it lands in your transcript. - One run per step, with every name the step needs. - Never put a value on a command line, in a file, a commit, a log, a memory or a message. - To store a value, tell the user to run: fastsecrets set NAME (in their own terminal). - If a value shows up in a transcript or log, say so. The user rotates it at the provider. ``` ## How an agent uses a secret 1. **Find the name:** `fastsecrets list` shows names and scopes, never values. Website logins: `fastsecrets login list`. 2. **Use it:** `fastsecrets run --mask NAME -- COMMAND`. The value goes into the command's environment as `$NAME`. It is never printed and never on a command line. 3. **Several at once:** `fastsecrets run --mask A B C -- COMMAND`. One call with five names costs about what one name costs. 4. **Another variable name:** `fastsecrets run --mask GH_TOKEN=GITHUB_TOKEN -- gh api user`. ### Always pass `--mask` It replaces any secret the command prints with `[secret:NAME]` before the output reaches the agent. It turns on by itself when the shell sets a known agent variable (`CLAUDECODE`, `CODEX_THREAD_ID`, `GEMINI_CLI`, `CURSOR_AGENT`, `OPENCODE`, `AI_AGENT`, ...) or `SECRETS_AGENT=1`, but do not rely on being recognized. The filter matches exact values only. Do not run a command whose purpose is to print, encode or transform the secret (`env`, `printenv`, `base64`, `curl -v`). If the marker shows up, the command echoed a secret: do not try to get around it. A tool wrapper that starts fastsecrets with a clean environment must pass `--mask` or `SECRETS_AGENT=1`. ## Storing a new secret The common way a key leaks is a command shape that puts the value on the command line, where it lands in the transcript and in shell history. So the user stores it, in their own terminal window, not through the agent's shell. Never suggest `NAME=value`, `fastsecrets set NAME value` or `echo key | ...` typed into a chat. `fastsecrets set` shows its hidden prompt only when stdin is a terminal. ### Give the user this, word for word 1. Open a terminal. 2. Type: `fastsecrets set EXAMPLE_API_KEY` and press Return. 3. Paste the key at "Value for EXAMPLE_API_KEY:" (nothing shows), Return, paste again at "Again:", Return. 4. Check: `fastsecrets list` shows the NAME (never the value). A short-lived credential: `fastsecrets set NAME --ttl 2h`. A website login: `fastsecrets login set example.com --user NAME`, which prompts for the password. If a value ever appears in chat or a log, say so plainly; the user revokes or rotates it at the provider, then stores the new one. ## No MCP server needed fastsecrets is a command-line program. Any agent that can run a shell command can use it as it is, with no server to install and no tool schema to load. The agent never calls a "get secret" tool that returns a value into its context. It runs the program that needs the key under `fastsecrets run`, and the program gets the value in its environment. ``` # the agent's shell tool runs: fastsecrets run --mask OPENAI_API_KEY -- python scripts/summarize.py fastsecrets run --mask GH_TOKEN=GITHUB_TOKEN -- gh pr list fastsecrets run --mask DATABASE_URL -- npm run migrate ``` Inside a script, `v="$(fastsecrets get NAME)"` assigned to a variable is fine, and `fastsecrets get A B` prints `NAME=value` lines, all or nothing. The agent never runs a bare `get` itself. ## The voice-agent pattern A voice agent has a person on the line, and every pause is one they hear. Read every key the engine needs in one call, when the engine starts, and hand them over with `run`. ``` fastsecrets run --mask ANTHROPIC_API_KEY OPENAI_API_KEY -- python voice_agent.py ``` ### Batch every name One `run` with five names costs about what one costs. Five separate calls cost five process starts and, with a chip key, five chip operations that queue behind each other. ### Read at start In our simulated test, wrapping the start command cost about 3 ms at startup and 0 ms per turn, because the key was read once. ### Keep logins off the hot path A website login spec (`VAR=login:SITE`) moves the whole call to the slower helper scripts, which read each value separately. No value appeared in argv, in files or in the replay output. The key was visible in the child's environment to `ps` run by the same user, which `run` does not prevent. [More on the home page](https://fastsecrets.abediaz.ai/#voice). **Research footnote:** Startup cost +3.2 ms median, about +4 ms with masking. The test was a simulated replay of 60 turns per condition on one Mac (echo brain, fake speech output, real Whisper speech-to-text), with a software key and reader version 0.3.1. It does not show a live model turn. ## Copy-paste SKILL.md A ready-made agent skill with the rules, what each error means and the exact steps for storing a new key. Save it as `SKILL.md` in a folder named `fastsecrets` in your agent's skills folder. From a clone of the fastsecrets repository, link it instead: ``` ln -sfn "$PWD/skill" ~/.claude/skills/fastsecrets ``` Source: [skill/SKILL.md](https://github.com/abe238/fastsecrets/blob/main/skill/SKILL.md). ``` --- name: fastsecrets description: Use whenever a task needs an API key, token, password or website login, whenever a credential must be stored or read, or whenever you are about to tell the user how to save a key. Exact commands for the age-encrypted fastsecrets store and the rules that keep values out of chat, transcripts, command lines and logs. --- # Using secrets with fastsecrets `fastsecrets` keeps secrets in a git store (default `~/.config/fastsecrets`) encrypted with [age](https://github.com/FiloSottile/age), a small, widely used open-source file encryption tool. `fastsecrets help` lists every command; `fastsecrets help run` explains one. You use credentials. You never see them. ## Using a secret - Find the name: `fastsecrets list` (names and scopes, never values). Website logins: `fastsecrets login list`. - Use it: `fastsecrets run --mask NAME -- COMMAND`. The value goes into the command's environment as `$NAME`. It is never printed and never on a command line. - Different variable name: `fastsecrets run --mask GH_TOKEN=GITHUB_TOKEN -- gh api user` - Website login: `fastsecrets run --mask P=login:example.com U=login:example.com:username -- ./script` - Several at once: `fastsecrets run --mask A B C -- COMMAND` - **Prefer `run` over `get`.** `run` hands values to the command; `get` prints them, and whatever is printed can land in your transcript. - **Batch the names a step needs into one call.** One `run` with five names costs about what one name costs (one decrypt per scope file). Five separate calls cost five process starts and, with a Secure Enclave key, five chip operations that queue behind each other. For a voice agent or any hot path: one `fastsecrets run` per step, every name in it. A website login spec (`VAR=login:SITE`) moves the whole call off the fast native path to the slower helper scripts, so keep login specs out of a hot path. - Always pass `--mask`. It replaces any secret the command prints with `[secret:NAME]` before the output reaches you. (It turns on by itself when the shell sets a known agent variable such as `CLAUDECODE` or `CODEX_THREAD_ID`, or `SECRETS_AGENT=1`, but do not rely on being recognized.) If you see that marker, the command echoed a secret: do not try to get around it. Use `--no-mask` only when the command is meant to write the value somewhere (rendering a config file to disk), and never when its output comes back to you. - The filter matches exact values only. Do not run a command whose purpose is to print, encode or transform the secret (`env`, `printenv`, `base64`, `curl -v`). - Inside a script, `"$(fastsecrets get NAME)"` assigned to a variable is fine, and `fastsecrets get A B` prints `NAME=value` lines, all or nothing. Never run a bare `fastsecrets get NAME` or `fastsecrets login get NAME` yourself: its output is the value, and it lands in your transcript. ## Never - Never print, echo, log or write a value. Never pass one as an argument. Never put one in a commit, a memory file, a chat message, an issue, or any external service. - Never read `store/*.age` with `age` directly, the machine key (`~/.config/age/key.txt`), or the macOS keychain with `security`. Go through `fastsecrets run`. - Never run `fastsecrets export`, `fastsecrets recovery` or `fastsecrets edit` (it opens every value in an editor). They are for the user at their own terminal, and two of them refuse an agent's shell anyway. - Never use `set -x` or `bash -x` around a command that holds a secret. ## Storing a new secret The common way a key leaks is a command shape that puts the value on the command line, where it lands in the transcript and in shell history. 1. **Never give a command shape where the value goes on the command line.** No `NAME=value`, no `fastsecrets set NAME value`, no `echo key | ...` typed into a chat. 2. **Use `fastsecrets set NAME`.** It prompts twice with hidden input and never takes the value as an argument. `--scope S` picks the scope (default `all`). 3. **The user does it in their own terminal window**, not through an agent's shell passthrough: `fastsecrets set` shows its hidden prompt only when stdin is a terminal. Give this instruction verbatim: - Open a terminal. - Type: `fastsecrets set EXAMPLE_API_KEY` and press Return. - Paste the key at "Value for EXAMPLE_API_KEY:" (nothing shows), Return, paste again at "Again:", Return. - Check: `fastsecrets list` shows the NAME (never the value). 4. **A short-lived credential:** `fastsecrets set NAME --ttl 2h` stops being served after the limit on every machine. 5. **A website login:** `fastsecrets login set example.com --user NAME` in the user's terminal. It prompts for the password. 6. **If a value ever appears in chat or a log:** tell the user plainly, have them revoke or rotate it at the provider first, then store the NEW one with rule 3. Do not repeat the value back. Do not write it to any file or memory. ## When something fails | Message | Meaning | Do | |---|---|---| | `not found` | no secret of that name on this machine | check `fastsecrets list`; ask the user to store it | | `expired at ...` | it was stored with a time limit | ask the user to set it again if still needed | | `more than one readable scope` | the name exists twice | tell the user; they remove one with `fastsecrets rm NAME --scope S` | | `cannot push to the store's remote` | this machine has read-only access | make the change on a machine that can push | | `decrypts none of the scope(s)` | this machine's key is not a recipient | tell the user; see "Enrolling a new machine" in the README | | `helper scripts, which are not installed` | a `cargo install` without the bash side | the user runs `fastsecrets setup-libexec` | | `no age identity` | no key on this machine yet | first machine: the user runs `fastsecrets init`; a machine joining an existing store: "Enrolling a new machine" in the README, not `init` | `fastsecrets verify` checks that this machine's copy is sound and current. Run it when a secret looks stale or missing, and report its `problem:` lines to the user rather than fixing them by editing the store yourself. Other commands: `fastsecrets rm NAME`, `fastsecrets load` (pull and refresh this machine), `fastsecrets sync status`, `fastsecrets log [NAME]` (who read what, names only). ``` The whole file is in the box above; scroll inside it to read on, or copy it with the button. ## AGENTS.md snippet For a coding agent working in any project that uses fastsecrets. Paste it into the project's `AGENTS.md`. Source: the first section of [AGENTS.md](https://github.com/abe238/fastsecrets/blob/main/AGENTS.md), which also has the rules for working on fastsecrets itself. ``` ## Using fastsecrets (any project) - Read a secret only through `fastsecrets run --mask NAME... -- COMMAND`. The value goes to COMMAND's environment; it is never printed and never on a command line. - Never run a bare `fastsecrets get` or `fastsecrets login get`: the value is the output, and the output lands in your transcript. In a script, assign it: `v="$(fastsecrets get NAME)"`. - Ask for every name a step needs in one `run` call (one decrypt per scope file, however many names). For voice and other hot paths, one call per step. - Never put a value in a command line, a file, a commit, a log, a memory or a message. Never read `store/*.age`, the key file or the keychain directly. Never run `edit`, `export` or `recovery`: they are for the user at their own terminal. - To store a value, tell the user to run `fastsecrets set NAME` in their own terminal. Never ask them to paste a value into the chat. - If a value appears in a transcript or log, say so plainly; the user rotates it at the provider, then stores the new one. - Full rules for an agent: `skill/SKILL.md`. ``` ## What the rules do not cover - **The program you hand a secret to** holds the value and can print or send it in any form. `--mask` catches exact values only. - **Another process running as the same user** can read the program's environment while it runs, and can run fastsecrets itself with this machine's key. - **The agent's own shell tool** decides what it sees. If it runs `env` inside a `run`, the value is in its output (masked only when it matches exactly). The whole site for agents: [llms.txt](https://fastsecrets.abediaz.ai/llms.txt) (a short index) and [llms-full.txt](https://fastsecrets.abediaz.ai/llms-full.txt) (every page as Markdown). --- Page: https://fastsecrets.abediaz.ai/benchmark/ secrets-index, our public benchmark # Don't trust us. Check it. With a key file, fastsecrets beat every tool we tested on two Macs and a Linux server. With the key locked in the Secure Enclave chip, it beat every tool that asks the chip on each read. One honest catch: fnox's background helper is faster on the chip, because it keeps your secrets decrypted in memory the whole time it runs. Its row sits beside ours in every chip table below. **Research footnote:** Protocol v0.3.1. Per measured op; there is no dump row; counts are for the default build. "Software" means an unencrypted key file at rest plus a names-only index. Chip numbers are compared with the cache-free field (fnox, sops), with fnox's plaintext-cache daemon row shown beside them. Medians of session medians, in milliseconds. Apple M5 Pro · MacBook Air, M4 · Linux VPS · macOS Keychain (reference) · Method · Verify · Rerun ## How to read the tables - **One table per mode per machine.** Each row is one operation: `get1` reads one secret, `get5` five, `get1big` a 4 KB value, `run1` and `run5` start a child program with secrets in its environment, `run1-masked` also filters its output, `miss` and `wrongkey` must fail cleanly, `cold` is the first read after caches are cleared, `par20` is 20 reads at once, and the `get1.s500`, `s5000` and `scope5` rows use larger stores. - **"Fastest rival in this field"** is the rival row with the lowest median for that op. The last column is the worst verdict against every rival in the field. - **A win has to be clear.** A small or uncertain gap counts as a tie. - **No paired comparison** means the rival ran in the separate slow pass (median over 250 ms), so the protocol gives no verdict. Those rows are not counted as wins. - **No cross-machine comparisons.** Each machine stands alone. **Research footnote:** A win needs the 95% bootstrap interval of the paired median difference to exclude zero and the difference to exceed both 0.5 ms and 5% of the faster row. Otherwise it is a tie. ## macOS, Apple M5 Pro (18 cores) **Research footnote:** Generated from `expected/headline.md` and `expected/claims_tables.md` (M5, sessions kept: 15 of 15). fastsecrets rows are the default build. - **Software mode** (unencrypted key file at rest plus a names-only index), default build `fastsecrets` vs every rival row with a plaintext key file, per measured op (13 ops; fastsecrets has no dump row): 39 win, 4 no paired comparison out of 43 comparisons. get1 median: fastsecrets 3.24 ms, fnox 6.74 ms, fnox daemon 7.93 ms, sops 12.82 ms. 4 not paired because the two rows ran in different passes (rows with a median over 250 ms run in a separate slow pass; pass.gpg.get5 fell in different passes in different sessions): dotenvx.file.get1 (455.92 ms), dotenvx.npm-node.get1 (531.84 ms), pass.gpg.cold (453.67 ms), pass.gpg.get5 (207.57 ms). - **Chip mode** (Secure Enclave key, no prompt), default build vs the cache-free field (fnox and sops chip rows): 25 win out of 25 comparisons. Beside it, vs fnox's plaintext-cache daemon row `fnox.se-tag-daemon`: 2 win, 7 LOSS out of 9. get1 median: fastsecrets 9.02 ms, fnox 17.90 ms, sops 25.68 ms, fnox daemon (cache) 8.00 ms. - Sessions used: 15 of 15. Chip tables show the `se-p256tag` rows (the cold row exists only as `se-tag`). The chip bullet above quotes the `se-tag` get1 row; the two tie within the rule. Every recipient type has its own rows in `expected/claims_tables.md`. Software mode: default build vs every rival with a plaintext key file | op | fastsecrets, ms | fastest rival in this field | rival, ms | difference, ms [95% CI] | vs that rival | vs every rival in the field | | --- | --- | --- | --- | --- | --- | --- | | `cold` | 3.69 | `fnox.soft.cold` | 7.22 | -3.59 [-4.04, -3.26] | win | no paired comparison with `pass.gpg.cold` (slow pass) | | `get1` | 3.24 | `secretspec.dotenv-plaintext.get1` | 5.14 | -1.93 [-2.01, -1.86] | win | no paired comparison with `dotenvx.file.get1` (slow pass) | | `get1.s500` | 3.34 | `fnox.soft.get1.s500` | 8.07 | -4.80 [-4.95, -4.70] | win | wins vs all 1 | | `get1.s5000` | 4.56 | `fnox.soft.get1.s5000` | 23.11 | -18.56 [-18.98, -18.20] | win | wins vs all 1 | | `get1.scope5` | 3.27 | `fnox.soft.get1.scope5` | 6.76 | -3.51 [-3.61, -3.43] | win | wins vs all 1 | | `get1big` | 3.22 | `fnox.soft.get1big` | 6.66 | -3.43 [-3.54, -3.33] | win | wins vs all 3 | | `get5` | 3.21 | `fnox.soft.get5` | 6.92 | -3.70 [-3.85, -3.61] | win | no paired comparison with `pass.gpg.get5` (slow pass) | | `miss` | 3.02 | `fnox.soft.miss` | 6.48 | -3.42 [-3.57, -3.33] | win | wins vs all 4 | | `par20` | 8.31 | `fnox.soft.par20` | 16.04 | -7.09 [-7.46, -6.51] | win | wins vs all 2 | | `run1` | 4.70 | `fnox.soft.run1` | 8.28 | -3.65 [-3.79, -3.53] | win | wins vs all 6 | | `run1-masked` | 5.82 | `fnox.soft.run1-masked` | 8.43 | -2.62 [-2.73, -2.53] | win | wins vs all 4 | | `run5` | 4.75 | `fnox.soft.run5` | 8.63 | -3.91 [-4.02, -3.83] | win | wins vs all 2 | | `wrongkey` | 3.04 | `age.soft.wrongkey` | 3.69 | -0.67 [-0.70, -0.65] | win | wins vs all 1 | Chip mode (Secure Enclave, no prompt): the cache-free field, fnox and sops | op | fastsecrets, ms | fastest rival in this field | rival, ms | difference, ms [95% CI] | vs that rival | vs every rival in the field | | --- | --- | --- | --- | --- | --- | --- | | `cold` se-tag | 9.49 | `fnox.se-tag.cold` [cross-type piv-p256 vs p256tag] | 18.99 | -9.40 [-10.43, -8.56] | win | wins vs all 1 | | `get1` se-p256tag | 9.05 | `fnox.se-tag.get1` | 17.90 | -8.74 [-8.95, -8.56] | win | wins vs all 2 | | `get1big` se-p256tag | 9.01 | `fnox.se-tag.get1big` | 17.86 | -8.77 [-8.95, -8.56] | win | wins vs all 2 | | `get5` se-p256tag | 9.06 | `fnox.se-tag.get5` | 61.26 | -52.00 [-52.63, -51.43] | win | wins vs all 1 | | `miss` se-p256tag | 3.07 | `fnox.se-tag.miss` | 6.53 | -3.42 [-3.52, -3.32] | win | wins vs all 2 | | `par20` se-p256tag | 93.25 | `fnox.se-tag.par20` | 119.56 | -25.72 [-27.02, -24.81] | win | wins vs all 1 | | `run1` se-p256tag | 10.53 | `fnox.se-tag.run1` | 19.36 | -8.91 [-9.09, -8.75] | win | wins vs all 2 | | `run1-masked` se-p256tag | 11.77 | `fnox.se-tag.run1-masked` | 19.66 | -7.80 [-7.98, -7.63] | win | wins vs all 1 | | `run5` se-p256tag | 10.61 | `fnox.se-tag.run5` | 62.86 | -51.99 [-52.63, -51.38] | win | wins vs all 1 | Chip mode beside fnox's plaintext-cache daemon row, fnox.se-tag-daemon | op | fastsecrets, ms | fastest rival in this field | rival, ms | difference, ms [95% CI] | vs that rival | vs every rival in the field | | --- | --- | --- | --- | --- | --- | --- | | `cold` se-tag | 9.49 | `fnox.se-tag-daemon.cold` (daemon) | 75.25 | -65.64 [-67.10, -64.61] | win | wins vs all 1 | | `get1` se-p256tag | 9.05 | `fnox.se-tag-daemon.get1` (daemon) | 8.00 | +1.04 [+0.92, +1.12] | loss | loss | | `get1big` se-p256tag | 9.01 | `fnox.se-tag-daemon.get1big` (daemon) | 8.07 | +0.98 [+0.86, +1.07] | loss | loss | | `get5` se-p256tag | 9.06 | `fnox.se-tag-daemon.get5` (daemon) | 8.00 | +1.03 [+0.89, +1.15] | loss | loss | | `miss` se-p256tag | 3.07 | `fnox.se-tag-daemon.miss` (daemon) | 6.47 | -3.39 [-3.51, -3.30] | win | wins vs all 1 | | `par20` se-p256tag | 93.25 | `fnox.se-tag-daemon.par20` (daemon) | 19.83 | +73.91 [+73.45, +74.20] | loss | loss | | `run1` se-p256tag | 10.53 | `fnox.se-tag-daemon.run1` (daemon) | 9.57 | +0.97 [+0.82, +1.09] | loss | loss | | `run1-masked` se-p256tag | 11.77 | `fnox.se-tag-daemon.run1-masked` (daemon) | 9.70 | +2.10 [+2.00, +2.17] | loss | loss | | `run5` se-p256tag | 10.61 | `fnox.se-tag-daemon.run5` (daemon) | 9.64 | +0.93 [+0.84, +1.04] | loss | loss | ## macOS, MacBook Air, Apple M4 (10 cores) **Research footnote:** Generated from `expected/headline.md` and `expected/claims_tables.md` (AIR, sessions kept: 15 of 15). fastsecrets rows are the default build. - **Software mode** (unencrypted key file at rest plus a names-only index), default build `fastsecrets` vs every rival row with a plaintext key file, per measured op (13 ops; fastsecrets has no dump row): 41 win, 2 no paired comparison out of 43 comparisons. get1 median: fastsecrets 2.92 ms, fnox 5.88 ms, fnox daemon 7.18 ms, sops 11.62 ms. 2 not paired because the two rows ran in different passes (rows with a median over 250 ms run in a separate slow pass; pass.gpg.get5 fell in different passes in different sessions): dotenvx.file.get1 (476.08 ms), dotenvx.npm-node.get1 (564.70 ms). - **Chip mode** (Secure Enclave key, no prompt), default build vs the cache-free field (fnox and sops chip rows): 25 win out of 25 comparisons. Beside it, vs fnox's plaintext-cache daemon row `fnox.se-tag-daemon`: 2 win, 7 LOSS out of 9. get1 median: fastsecrets 8.52 ms, fnox 16.27 ms, sops 23.61 ms, fnox daemon (cache) 7.15 ms. - Sessions used: 15 of 15. Chip tables show the `se-p256tag` rows (the cold row exists only as `se-tag`). The chip bullet above quotes the `se-tag` get1 row; the two tie within the rule. Every recipient type has its own rows in `expected/claims_tables.md`. Software mode: default build vs every rival with a plaintext key file | op | fastsecrets, ms | fastest rival in this field | rival, ms | difference, ms [95% CI] | vs that rival | vs every rival in the field | | --- | --- | --- | --- | --- | --- | --- | | `cold` | 2.94 | `fnox.soft.cold` | 5.67 | -2.71 [-2.74, -2.68] | win | wins vs all 3 | | `get1` | 2.92 | `secretspec.dotenv-plaintext.get1` | 4.51 | -1.56 [-1.63, -1.45] | win | no paired comparison with `dotenvx.file.get1` (slow pass) | | `get1.s500` | 3.07 | `fnox.soft.get1.s500` | 7.38 | -4.30 [-4.33, -4.28] | win | wins vs all 1 | | `get1.s5000` | 4.31 | `fnox.soft.get1.s5000` | 22.64 | -18.34 [-18.38, -18.30] | win | wins vs all 1 | | `get1.scope5` | 3.01 | `fnox.soft.get1.scope5` | 6.00 | -2.97 [-3.00, -2.94] | win | wins vs all 1 | | `get1big` | 2.93 | `fnox.soft.get1big` | 5.85 | -2.94 [-2.97, -2.90] | win | wins vs all 3 | | `get5` | 2.95 | `fnox.soft.get5` | 6.24 | -3.28 [-3.31, -3.25] | win | wins vs all 4 | | `miss` | 2.74 | `fnox.soft.miss` | 5.70 | -2.94 [-2.97, -2.91] | win | wins vs all 4 | | `par20` | 10.18 | `fnox.soft.par20` | 20.62 | -10.45 [-10.52, -10.28] | win | wins vs all 2 | | `run1` | 4.28 | `fnox.soft.run1` | 7.38 | -3.09 [-3.13, -3.06] | win | wins vs all 6 | | `run1-masked` | 5.03 | `fnox.soft.run1-masked` | 7.44 | -2.42 [-2.44, -2.39] | win | wins vs all 4 | | `run5` | 4.33 | `fnox.soft.run5` | 7.72 | -3.40 [-3.43, -3.37] | win | wins vs all 2 | | `wrongkey` | 2.76 | `age.soft.wrongkey` | 3.36 | -0.60 [-0.62, -0.58] | win | wins vs all 1 | Chip mode (Secure Enclave, no prompt): the cache-free field, fnox and sops | op | fastsecrets, ms | fastest rival in this field | rival, ms | difference, ms [95% CI] | vs that rival | vs every rival in the field | | --- | --- | --- | --- | --- | --- | --- | | `cold` se-tag | 8.56 | `fnox.se-tag.cold` [cross-type piv-p256 vs p256tag] | 16.03 | -7.39 [-7.50, -7.30] | win | wins vs all 1 | | `get1` se-p256tag | 8.54 | `fnox.se-tag.get1` | 16.27 | -7.74 [-7.79, -7.69] | win | wins vs all 2 | | `get1big` se-p256tag | 8.51 | `fnox.se-tag.get1big` | 16.31 | -7.78 [-7.84, -7.73] | win | wins vs all 2 | | `get5` se-p256tag | 8.55 | `fnox.se-tag.get5` | 55.99 | -47.18 [-47.32, -46.99] | win | wins vs all 1 | | `miss` se-p256tag | 2.77 | `fnox.se-tag.miss` | 5.71 | -2.90 [-2.93, -2.88] | win | wins vs all 2 | | `par20` se-p256tag | 95.98 | `fnox.se-tag.par20` | 127.38 | -31.67 [-31.88, -31.47] | win | wins vs all 1 | | `run1` se-p256tag | 9.94 | `fnox.se-tag.run1` | 17.87 | -7.92 [-7.99, -7.85] | win | wins vs all 2 | | `run1-masked` se-p256tag | 10.71 | `fnox.se-tag.run1-masked` | 17.93 | -7.22 [-7.28, -7.15] | win | wins vs all 1 | | `run5` se-p256tag | 9.93 | `fnox.se-tag.run5` | 57.57 | -47.32 [-47.47, -47.11] | win | wins vs all 1 | Chip mode beside fnox's plaintext-cache daemon row, fnox.se-tag-daemon | op | fastsecrets, ms | fastest rival in this field | rival, ms | difference, ms [95% CI] | vs that rival | vs every rival in the field | | --- | --- | --- | --- | --- | --- | --- | | `cold` se-tag | 8.56 | `fnox.se-tag-daemon.cold` (daemon) | 73.53 | -64.21 [-64.71, -64.05] | win | wins vs all 1 | | `get1` se-p256tag | 8.54 | `fnox.se-tag-daemon.get1` (daemon) | 7.15 | +1.48 [+1.41, +1.52] | loss | loss | | `get1big` se-p256tag | 8.51 | `fnox.se-tag-daemon.get1big` (daemon) | 7.17 | +1.45 [+1.39, +1.49] | loss | loss | | `get5` se-p256tag | 8.55 | `fnox.se-tag-daemon.get5` (daemon) | 7.17 | +1.49 [+1.43, +1.53] | loss | loss | | `miss` se-p256tag | 2.77 | `fnox.se-tag-daemon.miss` (daemon) | 5.69 | -2.89 [-2.91, -2.87] | win | wins vs all 1 | | `par20` se-p256tag | 95.98 | `fnox.se-tag-daemon.par20` (daemon) | 23.31 | +72.46 [+72.26, +72.62] | loss | loss | | `run1` se-p256tag | 9.94 | `fnox.se-tag-daemon.run1` (daemon) | 8.63 | +1.38 [+1.32, +1.44] | loss | loss | | `run1-masked` se-p256tag | 10.71 | `fnox.se-tag-daemon.run1-masked` (daemon) | 8.69 | +2.10 [+2.04, +2.16] | loss | loss | | `run5` se-p256tag | 9.93 | `fnox.se-tag-daemon.run5` (daemon) | 8.68 | +1.38 [+1.31, +1.44] | loss | loss | ## Linux VPS, AMD EPYC 9354P (8 cores) **Research footnote:** Generated from `expected/headline.md` and `expected/claims_tables_vps.md` (VPS, sessions kept: 21 of 21). fastsecrets rows are the default build. - **Software mode** (unencrypted key file at rest plus a names-only index), default build `fastsecrets` vs every rival row with a plaintext key file, per measured op (13 ops; fastsecrets has no dump row): 41 win, 3 no paired comparison out of 44 comparisons. get1 median: fastsecrets 1.59 ms, fnox 11.59 ms, fnox daemon 12.77 ms, sops 36.64 ms. 3 not paired because the two rows ran in different passes (rows with a median over 250 ms run in a separate slow pass; pass.gpg.get5 fell in different passes in different sessions): dotenvx.file.get1 (1501.39 ms), dotenvx.file.run1 (353.40 ms), dotenvx.file.run1-masked (350.44 ms). - **Chip mode**: not measured (no Secure Enclave on Linux). - Sessions used: 21 of 21. Software mode: default build vs every rival with a plaintext key file | op | fastsecrets, ms | fastest rival in this field | rival, ms | difference, ms [95% CI] | vs that rival | vs every rival in the field | | --- | --- | --- | --- | --- | --- | --- | | `cold` | 1.49 | `fnox.soft.cold` | 10.74 | -9.09 [-10.18, -8.52] | win | wins vs all 3 | | `get1` | 1.59 | `age.soft-sed.get1` (unranked: composition) | 7.65 | -6.01 [-6.42, -5.68] | win | no paired comparison with `dotenvx.file.get1` (slow pass) | | `get1.s500` | 2.07 | `fnox.soft.get1.s500` | 18.04 | -15.64 [-16.46, -14.90] | win | wins vs all 1 | | `get1.s5000` | 6.61 | `fnox.soft.get1.s5000` | 83.47 | -76.78 [-79.30, -74.24] | win | wins vs all 1 | | `get1.scope5` | 2.27 | `fnox.soft.get1.scope5` | 12.22 | -9.75 [-10.24, -9.26] | win | wins vs all 1 | | `get1big` | 1.64 | `fnox.soft.get1big` | 11.66 | -10.02 [-10.57, -9.44] | win | wins vs all 3 | | `get5` | 1.63 | `fnox.soft-daemon.get5` (daemon) | 12.48 | -10.91 [-11.68, -10.34] | win | wins vs all 4 | | `miss` | 1.45 | `fnox.soft.miss` | 10.79 | -9.23 [-9.81, -8.71] | win | wins vs all 4 | | `par20` | 7.85 | `fnox.soft.par20` | 35.45 | -27.00 [-28.82, -25.69] | win | wins vs all 2 | | `run1` | 1.95 | `fnox-lite.soft.run1` | 11.34 | -9.20 [-9.79, -8.74] | win | no paired comparison with `dotenvx.file.run1` (slow pass) | | `run1-masked` | 2.95 | `fnox.soft.run1-masked` | 13.08 | -9.96 [-10.46, -9.53] | win | no paired comparison with `dotenvx.file.run1-masked` (slow pass) | | `run5` | 2.02 | `fnox.soft.run5` | 13.56 | -11.58 [-12.26, -10.96] | win | wins vs all 2 | | `wrongkey` | 1.34 | `age.soft.wrongkey` | 5.35 | -3.90 [-4.15, -3.71] | win | wins vs all 1 | ## macOS Keychain (reference) Reference rows, kept outside the claim. Software mode wins every row in the tables below, on both Macs. The keychain has a lower median than our chip mode: 6.64 vs 9.05 ms for one read on the M5 (6.31 vs 8.54 ms on the Air), and 24.97 vs 93.25 ms when 20 separate programs each read one secret at the same moment on the M5 (par20). securityd is a resident daemon that keeps the keychain unlocked in memory; chip mode goes to the Secure Enclave on every read. **Research footnote:** The benchmark read a throwaway keychain file with Apple's `security` tool, served by the securityd daemon. It did not read your login keychain, because the login keychain can raise a dialog and the protocol skips any row that can. A real login keychain was not measured; we expect it to be no faster, and it can prompt. The chip and keychain medians above come from different tables, so they carry no paired verdict. Our old bash tool's opt-in keychain path, `secrets-bash.keychain-cache.get1` (also on a throwaway keychain file), took 40.53 ms on the M5 and 33.38 ms on the Air: bash start and its scripts, then the same `security` call. Its stats row lists its resident process as "none". securityd serves it, as it does the `security` rows. ### Apple M5 Pro **Research footnote:** Generated from `expected/claims_tables.md` (M5, sessions kept: 15 of 15), section "Software mode vs OS keychain rows (shown separately)". Software mode beside a keychain file read with security (macOS Keychain, reference) | op | fastsecrets, ms | fastest rival in this field | rival, ms | difference, ms [95% CI] | vs that rival | vs every rival in the field | | --- | --- | --- | --- | --- | --- | --- | | `get1` | 3.24 | `security.keychain-file.get1` (daemon) | 6.64 | -3.44 [-3.51, -3.38] | win | wins vs all 1 | | `miss` | 3.02 | `security.keychain-file.miss` (daemon) | 8.18 | -5.14 [-5.26, -5.03] | win | wins vs all 1 | | `par20` | 8.31 | `security.keychain-file.par20` (daemon) | 24.97 | -15.86 [-17.11, -14.52] | win | wins vs all 1 | ### MacBook Air, M4 **Research footnote:** Generated from `expected/claims_tables.md` (AIR, sessions kept: 15 of 15), section "Software mode vs OS keychain rows (shown separately)". Software mode beside a keychain file read with security (macOS Keychain, reference) | op | fastsecrets, ms | fastest rival in this field | rival, ms | difference, ms [95% CI] | vs that rival | vs every rival in the field | | --- | --- | --- | --- | --- | --- | --- | | `get1` | 2.92 | `security.keychain-file.get1` (daemon) | 6.31 | -3.36 [-3.41, -3.32] | win | wins vs all 1 | | `miss` | 2.74 | `security.keychain-file.miss` (daemon) | 7.61 | -4.83 [-4.88, -4.77] | win | wins vs all 1 | | `par20` | 10.18 | `security.keychain-file.par20` (daemon) | 23.36 | -13.14 [-13.19, -13.08] | win | wins vs all 1 | ## Method - **Fixture:** 51 dummy values. Each entrant gets its own store built from it, in its own directory. - **Default mode:** every entrant runs in its documented default mode for the platform, compared mode to mode. Secure Enclave comparisons use the same recipient type for every tool (except `cold`, where our only chip row is a different type; it is tagged cross-type). - **Repeated and shuffled:** every case runs hundreds of times per session, in a random order, over many sessions per machine. Every attempt is recorded, failures included. - **No blended score.** One table per operation per machine. - **Conflict of interest, stated up front:** the benchmark's author wrote one entrant. It is tagged `[author]` everywhere. Some protocol changes came after data was seen, and each one is dated in [PROTOCOL.md](https://github.com/abe238/secrets-index/blob/main/PROTOCOL.md). **Research footnote:** **Measurement:** a fresh process per sample, wall time from spawn to exit, a 10 s deadline per case. Every attempt is recorded with its outcome; a case is ranked only if at least 99% of attempts meet its contract. **Sessions:** 20 warmup rounds and 300 timed rounds, cases in a seeded random order per round, load recorded every round. A session is discarded if load exceeds cores/2 for more than 5% of rounds. 15 sessions per Mac (main, par20 and cold), 21 on the VPS. **Statistics:** median of session medians; per-round paired differences inside each session, block bootstrap over sessions and 10-round blocks, 95% interval on the median difference. **Protocol versions:** the protocol was frozen as v0.2 before the product changes were measured; v0.3 and v0.3.1 were amended after data was seen. [![How secrets-index measures. Fixtures of 51 dummy values go by stdin to coord.py, the coordinator and judge, which runs seeded rounds through sb-spawner, one sandboxed helper per entrant, against the pinned entrant tool and the sb-child program that prints names and a digest. On macOS each helper has its own sandbox-exec profile; on Linux each entrant has its own uid in a container with no network. Every attempt goes into the session data of 300 timed rounds; the load rule discards sessions over cores/2. stats.py computes paired, bootstrapped comparisons per op, verdicts are win or tie, and expected/ holds the published tables. verify.py checks the sha256 manifest, recomputes and diffs byte for byte.](https://fastsecrets.abediaz.ai/assets/diagrams/benchmark-setup-light-1200.webp)](https://fastsecrets.abediaz.ai/assets/diagrams/benchmark-setup-light@2x.webp) A coordinator outside every sandbox runs the rounds, records every attempt and ships the data. ## Verify the published numbers ``` git clone https://github.com/abe238/secrets-index && cd secrets-index python3 verify.py # 4 to 7 minutes on an Apple M5 Pro python3 verify.py --quick # about 10 s ``` Python 3, standard library only. `--quick` skips the slowest checks. `verify.py` recomputes every table and every verdict from the raw data and compares the result with the published output. It writes nothing inside the repo and exits non-zero on any mismatch. **Research footnote:** Tested with Python 3.9.6 and 3.14.4. `verify.py` checks the data manifest (sha256 of every file) and the harness pins recorded in every session, recomputes every stats table with the same `harness/stats.py` that produced them, runs two independent recomputes that do not import it, reruns every claim verdict and diffs everything byte for byte against `expected/`. `--quick` skips the claim bootstraps and the headline check. The quick mode only, in a fresh clone. The full run also reruns every claim bootstrap. ## Rerun it on your machine [RERUN.md](https://github.com/abe238/secrets-index/blob/main/RERUN.md) has the exact commands, timing estimates and hardware notes for macOS and Linux. Known gaps are listed in [GAPS.md](https://github.com/abe238/secrets-index/blob/main/GAPS.md). - **macOS:** each helper runs under its own sandbox profile, denied the home folder and the other entrants. - **Linux:** each entrant gets its own user in a container with no network. - A rerun is a new session set of your own. The protocol forbids comparing it across machines. ## Add your tool Open a ["Request a tool" issue](https://github.com/abe238/secrets-index/issues/new?template=request-a-tool.yml) on GitHub, or add it yourself (RERUN.md, "Adding a tool") and open a pull request. **Research footnote:** Adding a tool takes a pinned install, a generator entry with its documented default mode and exact argv, 5 of 5 on validate, and a new session set. New harness hashes are never pooled with the published sessions. The code, the data and the published outputs are Apache-2.0. Every table on this page is generated from [expected/](https://github.com/abe238/secrets-index/tree/main/expected). --- Page: https://fastsecrets.abediaz.ai/story/ The story, with the bad news left in # From 32 ms to 3 ms. Mostly by removing things. This started as a bash script that took 32 ms to read one secret. We rewrote the reader in Rust, a language built for fast, safe programs, and now it takes 3 ms on an M5 Mac. AI agents did a lot of the building, and we kept notes like anthropologists, mistakes included. ## Timeline 1. October 20, 2026First commit: [age](https://github.com/FiloSottile/age)-encrypted env files in git, one file per scope (age is a small, widely used open-source file encryption tool). 2. November 10A bash tool, version 2.0: `run`, `verify`, logins, time limits, Secure Enclave keys. 3. December 1Round 1. The bash tool spawned [`age`](https://github.com/FiloSottile/age) for every read: 46 to 48 ms. A first Rust reader, the start of fastsecrets, read the same store in 5.78 ms with a software key and 11.38 ms through the chip. 4. December 1[age](https://github.com/FiloSottile/age) 1.4.0 shipped that same day with a new chip-key format older readers could not read. We caught it on dummy data before any machine upgraded, pinned [age](https://github.com/FiloSottile/age) and added native support for both formats. 5. December 1Round 2. A native Rust `run`: 6.3 ms software, 11.8 ms chip, against 46 to 61 ms for the bash `run`. 6. December 2The public benchmark: 3.24 ms software, 9.05 ms chip on the M5 ([all results](https://fastsecrets.abediaz.ai/benchmark/)). **Research footnote:** The December 2 numbers come from benchmark protocol v0.3.1, 5 sessions per kind per machine. ## What changed, step by step 1. **Stop spawning [`age`](https://github.com/FiloSottile/age).** The reader decrypts the store itself, Secure Enclave keys included. No [`age`](https://github.com/FiloSottile/age) process, no plugin process, no shell. With this reader, round 1 went from 46 to 48 ms to 5.78 ms. 2. **One decrypt per scope.** Five names cost what one name costs. On the M5 chip path, five secrets take 9.06 ms and one takes 9.05 ms. 3. **A names-only index.** It records which scope holds which name, so a warm read decrypts one scope instead of all of them. No values, no keys. 4. **No PATH search.** The reader never runs a binary it finds on PATH. That closed a security hole (see the lessons). 5. **Native `run`.** The reader puts values in the program's environment and, without `--mask`, becomes the program itself, so no parent holding the values stays alive. With `--mask` it stays as a filter on the program's output. ## Where it started, where it ended Same machine, same protocol, bash tool versus Rust reader (M5, software key). | | bash tool | fastsecrets | | --- | --- | --- | | read one secret | 32.07 ms | 3.24 ms | | start a program with one secret | 45.44 ms | 4.70 ms | | start a program with five secrets | 174.53 ms | 4.75 ms | We did not measure each step's saving in isolation. The table shows where it started and where it ended. **Research footnote:** Round 1 timed the bash read at 46 to 48 ms; under the final protocol, its software-key read measured 32.07 ms. The 0.34 ms in the diagram's top note below is one sandbox trace on the M5, not a benchmark figure. [![Two read paths side by side. fastsecrets get is one native process (run takes the same path): process start, read key and scopes, the names-only index, decrypt in-process with no age binary, value out plus an access log line; 3.24 ms get1 median on the M5 with a software key, 9.05 ms with the Secure Enclave. The old bash reader starts bash, lists scopes, spawns age -d per scope, lets age decrypt the whole scope and finds the line with awk; 32.07 ms. Bars below compare get1 medians: software key fastsecrets 3.24, fnox 6.74, fnox daemon 7.93, sops 12.82, the old bash reader 32.07, pass 41.86; Secure Enclave fnox daemon with its cache 8.00, fastsecrets 9.05, fnox 17.90, sops 25.68.](https://fastsecrets.abediaz.ai/assets/diagrams/read-path-light-1200.webp)](https://fastsecrets.abediaz.ai/assets/diagrams/read-path-light@2x.webp) Where the milliseconds go. ## What we learned 1. **Compare mode to mode.** Our first comparison set our chip mode against a rival's software mode, and it looked like a loss. Mode for mode we were ahead: 6.3 vs 9.8 ms in software, 11.8 vs 20.8 ms on the chip. 2. **The chip has a fixed price.** About 4.5 ms of every chip read is the Secure Enclave itself. No code removes it. We budget for it. 3. **The language is not the speedup.** Rivals are written in Rust too. The time came out of three removals: the [`age`](https://github.com/FiloSottile/age) spawn, the shell and the extra decrypts. 4. **We chased the outright chip win, and parked it.** We built a helper that keeps a connection to the chip, measured it and had it reviewed. At best it tied. It also opened an offline leak path. We shelved it. The fast path we recommend is batching: one call per agent step. 5. **Our worst hole came from our own fallback.** A fallback in the reader ran whatever [`age`](https://github.com/FiloSottile/age) was first on PATH. A planted program there could return a forged value with exit 0. Our own security detectors found it. Version 0.2.0 removed it. 6. **Pin your upstream.** [age](https://github.com/FiloSottile/age) 1.4.0 changed the chip-key format on our release day. A pin and a dummy-data compatibility matrix turned a breaking change into a planned upgrade. 7. **The benchmark needed adversaries too.** An outside review found that our round-1 runner timed only successful samples, had no timeout and let entrants read the fixture. All three were fixed before the numbers above. ## The agents' mistakes Digital anthropology with AI. We ran this project with AI agents and wrote rules for them. They still broke some. - One let a keychain test hang for 8 minutes in a sandbox. - One ran a safety wrapper that hashed values from the real store and keychain. - One ran a downloaded binary outside the sandbox. - On the Linux box, one agent blamed slow sessions on host cron, then on zombie processes. Checking the timings showed the real cause: other tenants on the shared host were taking CPU. - In the voice-agent test, an agent's first process sampler used the wrong `ps` flag and reported zero leaks. The result was invalid. It caught the error, fixed the flag and ran again. The first three were self-reported, and all three were checked afterward. Written rules help. Checking the work catches the rest. ## Where to go from here ### [The benchmark](https://fastsecrets.abediaz.ai/benchmark/) Every table, every non-win and the fnox daemon row. ### [The guide](https://fastsecrets.abediaz.ai/docs/) Install, store, read, sync, recover and uninstall. ### [For agents](https://fastsecrets.abediaz.ai/agents/) The rules, a copy-paste SKILL.md and the voice-agent pattern.