Reference
Undoing a change
Every write keeps the last 5 versions, and rm keeps the file too.
passbox restore github/token # list versions
passbox restore github/token --index 0 # put the newest one backWhat is on disk
~/.passbox/
store/<random-id>.age one self describing secret per file
store/<random-id>.tomb deletion marker
store/.versions/<id>/ earlier versions, never synced
wraps/recipient the store public key, no secret in it
wraps/recovery.age the store key under your passphrase, once sync is on or when there is no Enclave
wraps/yubikey.age the store key under the YubiKeys, once one is added
wraps/yubikey.recipients the YubiKey recipients that wrap holds
wraps/se-<host>.json the store key under that Mac's Secure Enclave
wraps/phone-<host>.json the store key under an enrolled iPhone's Secure Enclave, never synced
audit-<host>.log one encrypted record per line
grants-<host>.age project approvals, never synced
config.toml where sync copies to, the plugin and SSH windows and the phone delay, never synced
windows-<host>.json the hash of the approved plugin windows, never synced
windows-ssh-<host>.json the hash of the approved SSH windows, never synced
plugins/ installed plugins, never synced
ssh-keys.pub the public halves the SSH agent lists, never synced
broker.sock the approval socket, never synced
ssh-agent.sock the SSH agent socket, never synced
host on a client, the Mac to ask, never syncedThe filename is a random id. Names live inside the ciphertext, so nothing on disk says what a secret is called. What still leaks: how many secrets exist, their sizes, and their modification times.
Environment
| Variable | Effect |
|---|---|
PASSBOX_DIR | Where the store lives, default ~/.passbox |
PASSBOX_REMOTE | Overrides the destination for one run, ahead of the one sync --enable recorded |
PASSBOX_AGENT | Name shown in the prompt beside the secret |
PASSBOX_HOST | The Mac to ask, for one run, ahead of ~/.passbox/host |
PASSBOX_NO_AUTOSYNC | Set to stop a write copying to the configured directory |
PASSBOX_PASSPHRASE | Supplies the passphrase for CI and headless use, and turns off the Enclave path |
PASSBOX_TOKEN | A grant token, used for reads it covers |
PASSBOX_NO_ENCLAVE | Refuses any Secure Enclave operation. The tests and CI set it, so a bug fails them instead of asking for a fingerprint |
passbox moves PASSBOX_TOKEN and PASSBOX_PASSPHRASE out of its environment when it starts and overwrites their bytes, so ps eww cannot read them and nothing it runs inherits them: not the exec child, a plugin, an MCP command, git or the broker. A secret injected under one of those names with --env still reaches the child.
Building
cargo test --features mock-enclave # everything, the broker through a fake enclave
cargo test secure_enclave_round_trip -- --ignored # the real Enclave, needs a fingermock-enclave swaps the Secure Enclave helper for a fake that prompts nobody and logs each prompt a person would have seen, so the tests can count them. It is for tests only: a release build with it does not compile, and a build with it aborts outside a cargo target directory. A plain cargo test skips the tests that need it.
build.rs compiles the Swift helper with swiftc from the Command Line Tools.
Fields in one entry
An entry can hold more than a password. The first line is the secret, later key: value lines are fields, which is the layout pass uses and import pass keeps. A field whose value spans lines is a YAML block, as gopass writes it: key: |, then each line indented by two spaces.
hunter2
username: gb
license key: |
line one
line twopassbox get db/prod # the whole thing
passbox get db/prod --field username # just that one
passbox copy db/prod --field username # that one, to the clipboard
passbox fields db/prod # the field names, such as password, username, url, and none for a noteAt a terminal, passbox add db/prod --field username --field url asks for the password hidden and twice, as usual, then asks for each field by name. -m then reads more fields and notes one per line until an empty line. Field values and notes show as you type. Without either, add asks for the password alone. Piped input is stored whole.
Reading one field hands a caller the password without the note beside it. The broker cuts the field out, so the rest of the entry never leaves it. A note is one text and has no fields, so --field on a note is refused.
Whole text: certificates, JSON keys, recovery codes
A value that spans lines and is not key: value fields, such as a PEM, a service account JSON file or a list of recovery codes, goes in as a blob. A blob is never parsed, so a header like Proc-Type: 4,ENCRYPTED stays part of the text.
passbox add tls/key --blob # paste, then Ctrl-D
passbox add gcp/key --file service.json # or read a file
passbox exec --env KEY=tls/key -- ./deploy # the whole text in the variable
passbox exec --file GOOGLE_APPLICATION_CREDENTIALS=gcp/key -- ./job--file VAR=name writes the value to a private temporary file, sets VAR to its path and removes the file when the child exits. Use it for tools that only take a path. The pasted text echoes at a terminal, and --blob and --file refuse --field and -m. Do not use --field on a blob, since it would still parse the text.
Using it from a program
Launch the program under passbox exec and read the environment. It needs no library and no dependency:
passbox exec --env API_KEY=acme/api --env DB=acme/db -- ./deployOne prompt covers every --env. The whole entry lands in the variable, so a program that wants a field splits the key: value lines itself. examples/rust runs itself this way.
There is no in-process read. passbox get refuses a pipe, and the passbox crate is the CLI alone since 2.0.0, so cargo install passbox is still how it installs outside Homebrew.
examples/ also holds Python and TypeScript clients, each with a runnable self-check. The same shape works in any language: shell out to passbox exec to hand a secret to a child process, and mint one grant per process rather than one per read.
For agents, see AGENTS.md, and the SKILL.md that teaches a coding agent to use passbox. Install the copy that matches your binary with passbox skill install, and run passbox skill check after an upgrade, since it exits 1 when the installed copy is older or differs.