Use
printf 'ghp_xxx' | passbox add github/token
passbox ls
passbox get github/token # prints it, for a terminal
passbox copy github/token # to the clipboard, cleared after 20 secondsget writes the secret to stdout, so it refuses when stdout is not a terminal, where the value would land in a pipe, a file or an agent's context. No flag overrides that. For the clipboard use copy, which marks the entry so clipboard managers skip it and clears it after 20 seconds, or after --clear N seconds up to 60. For a command use exec.
add refuses a name that already exists. To change a value, use passbox add NAME --replace, which keeps a blob a blob, or passbox rm it and add it again. The old value stays in its versions, so passbox restore brings it back.
Alfred
The Alfred workflow copies a secret through passbox copy. Type pbx, press ⏎ and touch the sensor. Alfred reopens with your names: pick one, then press ⏎ to copy the password or ⌘⏎ to copy the username. It needs the Powerpack.
curl -fsSLO https://github.com/gabrielkoerich/passbox/releases/latest/download/passbox.alfredworkflow
open passbox.alfredworkflowMac app
The menu-bar app opens a search panel on ⌘⇧Space. ⏎ copies the password and ⌘⏎ the username, through passbox copy. It lists the names once and keeps them in memory, so later searches need no fingerprint. It needs macOS 14 and builds with the Command Line Tools alone:
app/build.sh dev ~/Applications/passbox.app
open ~/Applications/passbox.appSSH keys
The broker is also an SSH agent. Add a key as a secret, point SSH_AUTH_SOCK at the broker, and every signature asks for your fingerprint. The private key never leaves the broker.
passbox add ssh/github < ~/.ssh/id_ed25519
export SSH_AUTH_SOCK=~/.passbox/ssh-agent.sock # in ~/.zshrc
ssh-add -L # lists it, no promptThe agent signs with Ed25519 and ECDSA (P-256, P-384, P-521) keys. An RSA key is stored and protected like any other, but the agent does not sign with it. A key with a passphrase asks for it once at add and is stored decrypted, as 1Password does, because the store encrypts it and every signature prompts. Delete the file once the key is in the store. A key only signs: get, copy, exec, a grant token and a plugin all refuse it. passbox get --encrypt ssh/github > id_ed25519 asks for a new passphrase and prints the key encrypted with it, for one Touch ID prompt. The prompt says what is signed, where to and with which key, such as "sign an SSH login as git to github.com with SSH key you@mac for ssh". A key synced from another Mac is offered once passbox ls has run on this one. Git commit signing with gpg.format ssh goes through the same agent, and its prompt names the repository and the programs that asked, such as "sign a git signature for git commit in "~/Projects/passbox" on "main" with SSH key you@mac for git (ssh-keygen < git < zsh)". A signature carries only a hash of the commit, so the prompt cannot show the message. The agent needs the broker running, which the LaunchAgent keeps up.
Signing windows
A job that connects to the same hosts every half hour cannot answer a prompt while you are away from the Mac. ~/.passbox/config.toml can list hosts that a key may sign logins to for a while:
[ssh.windows]
"legion" = "12h"
"m1" = "12h"
"vpsbr" = "4h"The first login to a listed host prompts, such as "sign an SSH login as gb to legion with SSH key you@mac for ssh (ssh < zsh), and its logins to legion for 12h without asking". Later logins with that key to that host skip the prompt until the window ends, also while the screen is locked, and each is audited as by window. A host not listed prompts every time.
- A host is named as
~/.ssh/known_hostslists it, or by its host key fingerprint, such as"SHA256:...", which is the only way to name a host whose known_hosts entry is hashed.*,a,band any other pattern are refused. - The window is bound to the host key, not the name. ssh 8.9 and later proves the host key to the agent (
[email protected]), and a login signs that session. Another server that claims the name gets a prompt of its own. A host with only an RSA host key, a forwarded agent, and commit signing withgpg.format sshalways prompt. - A window is capped at 24 hours, lives in the broker's memory and ends on a restart. It holds the private key, so a key removed from the store keeps signing for that host until its window ends.
- Every program on the Mac shares one window, as with plugin windows. The audit log shows which program signed.
- An edit to the section takes effect after one prompt that lists it, such as
allow SSH windows legion 12h, m1 12h for ssh, then .... Approving it ends the windows opened under the old section.
Git signs each commit with the same key, and a signature names no host, so [ssh.signing] opens a window for a signature namespace instead:
[ssh.signing]
git = "8h"The first git signature prompts, such as "allow SSH windows git signatures 8h for git, then sign a git signature for git commit in "~/Projects/passbox" on "main" with SSH key you@mac for git (ssh-keygen < git < zsh), and its git signatures for 8h without asking". Later git signatures with that key skip the prompt until the window ends. A login, or a signature in any other namespace, still prompts.
- Only
ssh-keygenon this Mac gets the window, the program git signs with, and only on a connection with no session bind. A forwarded agent reaches the broker through the ssh client, which binds since OpenSSH 8.9, or through a relay such as OrbStack's or Docker Desktop's, and neither isssh-keygen, so a server or container you forward the agent to never signs under it. - Any program on this Mac can sign a commit as you while the window is open, since nothing that asks can prove which repository it is in. Every signature is audited with its repository, branch, git subcommand and the programs that asked.
- The section shares the approval prompt and the 24 hour cap with
[ssh.windows].
Coming from pass
passbox import pass # everything
passbox import pass acme # one namespace
passbox import pass acme/token # one entry
passbox import pass acme --prefix old --dry-runpassbox decrypts each entry through GPG and re-encrypts it to the store key. It keeps the whole body, so the key: value lines many pass entries carry under the password survive. It refuses entries already in the store, and it changes or removes nothing in pass. --prefix puts every name under one namespace, and --dry-run lists what each entry would become and writes nothing.
Coming from 1Password
passbox import 1password --dry-run # what each item becomes, no values
passbox import 1password # every vault
passbox import 1password Work --prefix 1p # one vaultIt reads through the op CLI, so sign in with op signin first and passbox never sees the 1Password account password. Each item becomes <vault>/<title>, lowercased with spaces and punctuation made -, and --prefix puts every name under one namespace. Values go from op to the store inside the passbox process and are never printed or written to a file. One approval covers the whole import.
| 1Password | passbox |
|---|---|
| Login, password, and any item with a concealed field | the password on the first line, the username, URLs and other fields as key: value lines, a value of more than one line as a `key: |
| Secure note | its text, as a blob. A note with fields, such as several passwords, is kept as a login is |
| Document | its text as a blob, or skipped when it is binary |
| SSH key | the OpenSSH key as a blob, of every type. The agent offers Ed25519 and ECDSA keys, and the report names any other, such as RSA |
| One-time password | the otpauth:// seed as a field, passbox does not make codes from it |
| A field with more than one line | after the notes, as its name and then its text, where get --field cannot read it |
A name already in the store is refused, as add refuses it, and listed at the end. Nothing is overwritten. Only an empty item or a binary document is skipped, since passbox holds text. The report lists every skip and every note, and the import changes nothing in 1Password.
Giving a secret to an agent
The value goes into one child process and never into the agent.
passbox exec --env GITHUB_TOKEN=github/token -- gh api /user
passbox exec --stdin docker/token -- docker login -u me --password-stdinPrefer --stdin where the tool accepts it. Any process running as you can read a child's environment with ps eww.
Set PASSBOX_AGENT to name the caller in the prompt. Without it, passbox reads the process chain and uses the first ancestor that is not a shell, such as claude or codex.
PASSBOX_AGENT=claude-code passbox exec --env GH_TOKEN=github/token -- gh pr listThe prompt then reads passbox is trying to release the password for github/token to claude-code. macOS writes the opening clause from the binary name, and passbox writes the rest.
Through MCP
An agent asks through tools rather than a shell, and the tools cannot hand it a value at all.
claude mcp add passbox -- passbox mcp # Claude Code
codex mcp add passbox -- passbox mcp # CodexAny client that speaks MCP over stdio works, and the command is always passbox mcp. For one configured by file:
{
"mcpServers": {
"passbox": { "command": "passbox", "args": ["mcp"] }
}
}That file is ~/.claude.json for Claude Code, ~/.codex/config.toml for Codex in TOML form, and ~/.cursor/mcp.json for Cursor. Check it took with claude mcp list.
The server has two tools of its own, and neither returns a secret. Each installed plugin adds its tools beside them. See Plugins.
| Tool | Returns |
|---|---|
list_secrets | names only |
run_with_secret | the command's output, with the value scrubbed out of it |
There is no get_secret. A tool result lands in the model's context, where it is logged and sent onward, so the tools run the command for the agent. If the command prints the secret anyway, passbox replaces it in the output before returning.
The agent name in the prompt comes from the MCP handshake, so it is the client's own clientInfo.name rather than a guess up the process tree.
Grants and MCP
The MCP server is a client of the broker like anything else, so a token works the same way: PASSBOX_TOKEN in the server's environment covers the secrets it was granted, and those reads stop prompting.
The server inherits the environment of whatever launched it, which for an editor is the editor itself. So the token has to be in the MCP entry rather than your shell:
{
"mcpServers": {
"passbox": {
"command": "passbox",
"args": ["mcp"],
"env": { "PASSBOX_TOKEN": "..." }
}
}
}The cost is a bearer token in a config file. It is worth it for an agent that reads the same few secrets all day and otherwise prompts on every call. For an agent that reads a secret now and then, take the prompt instead.
examples/mcp speaks the protocol to passbox mcp from Python with no SDK, and holds a project .mcp.json. Models that need the whole MCP guide in one place can read llms.txt.
A token changes only whether you are asked. It cannot widen what the tools refuse: list_secrets still returns names only, run_with_secret still runs the command, and there is still no get_secret.
Tokens live in the broker's memory, so restarting it revokes every one of them and the MCP server goes back to prompting. The MCP server itself needs no restart.
Approving a project once
A project declares what it needs in .passbox.toml:
secrets = ["github/token", "npm/token"]
window_secs = 3600The first time an agent working in that directory asks for one of them, passbox shows a single prompt covering the whole list, and does not ask again for the window. The default is an hour and the cap is twelve.
The file is a request, not a grant. An agent can write one itself, so nothing is approved until you put your finger on the sensor. The approval is bound to the file's SHA-256: add a secret to the list and the hash changes, so it asks again.
The project is the caller's working directory, read from the kernel rather than taken from the request, so a caller cannot point at a manifest somewhere else. Grants live in grants-<host>.age, encrypted, and never sync.
.passbox.toml and .env.passbox are different files
The names are similar and the jobs are different. A project can have both, and they work together.
.passbox.toml | .env.passbox | |
|---|---|---|
| Answers | may this project ask for these | which variable gets which secret |
| Read by | the broker, when deciding | your program, at startup |
| Effect | one prompt covers the list, for a window | populates process.env or equivalent |
| Approval | yes, bound to the file's hash | none, it is a lookup table |
| Safe to commit | yes, it names secrets and grants nothing | yes, same |
The .toml changes how often you are asked. The .env says where a value lands once you have it. Neither holds a value, so you can commit both, and neither grants anything on its own.
If a project uses both, the .toml covers the same names the .env maps, so the one prompt covers the whole startup.
Seeing what was released
passbox audit --tail 50Every decision is logged, encrypted, one record per line, with the agent, the secret and the caller's process chain. A granted, delegated or by token record also carries grant, the id of the approval behind it, so every read through a token or its children traces back to one fingerprint. A plugin record that is approved, by window or released also carries args, the call's arguments as its prompt showed them, such as query="invoice" mailbox="INBOX".
| Decision | Meaning |
|---|---|
released | A prompt was approved and the value went out, to a caller or a plugin's stdin |
signed | A prompt was approved and an SSH key in the store signed |
exported | A prompt was approved and an SSH key went out encrypted with a new passphrase |
withheld | A prompt was approved for an SSH key, and the key stayed in the store |
by token | A grant token covered the read, no prompt |
granted | A grant was approved for this name |
delegated | A child token was minted from a live token, no prompt |
project grant | A .passbox.toml grant covered the read |
approved | A listing or a plugin run was approved |
by window | A plugin call ran inside an approval window from config.toml, no prompt |
unknown | The prompt was approved, and no secret or SSH key has that name |
denied | The prompt was refused |
prompt failed | No prompt could be shown, such as with the lid closed, or it did not complete |