These are the docs for aquaman 0.21.0. Read the current version.
Docker Sandboxes secrets from 1Password, Bitwarden or your keychain
Docker Sandboxes (sbx) already keeps credentials out of the sandbox: a proxy on your machine injects them, and the agent in the VM sees a placeholder. By default the values come from your OS keychain. Point sbx at aquaman to source them from any vault aquaman supports, with an allow-list and an audit entry for each read.
npm install -g aquaman-proxy
aquaman setup # 1. pick your vault
aquaman daemon & # 2. start the daemon
aquaman credentials add github token # 3. store the secret, if it is not there yet
aquaman broker allow aquaman://github/token # 4. allow it to be handed out
sbx secret set github \
--command "$(command -v node) $(command -v aquaman) get aquaman://github/token" \
--refresh on-demand # 5. sbx reads it from aquaman
sbx runs that command from a background service without your shell’s PATH, which is why step 5 stores absolute paths. Repeat steps 4 and 5 per service.
A secret that is already in your vault
If the token is already an item in 1Password, Bitwarden, HashiCorp Vault, the Keychain, KeePassXC or Keeper, do not type it again. Link the reference to the item in place of step 3. Requires aquaman 0.19.0 or later.
With 1Password (aquaman setup --backend 1password, the op CLI signed in):
aquaman daemon & # the daemon shows the approval dialog
aquaman credentials link github/token 'op://Private/GitHub/token' # you allow it in the dialog
aquaman broker allow aquaman://github/token
sbx secret set github \
--command "$(command -v node) $(command -v aquaman) get aquaman://github/token" \
--refresh on-demand
With Bitwarden (aquaman setup --backend bitwarden, the bw CLI logged in):
aquaman daemon & # starts with the vault locked, unless this shell has a BW_SESSION
aquaman unlock # Bitwarden asks for your master password; the daemon gets the session
aquaman credentials link github/token 'bw://GitHub/password' # you allow it in the dialog
aquaman broker allow aquaman://github/token
sbx secret set github \
--command "$(command -v node) $(command -v aquaman) get aquaman://github/token" \
--refresh on-demand
- The locator names one field of one item. 1Password:
op://<vault>/<item>/[<section>/]<field>. Bitwarden:bw://<item id or exact item name>/<field>, where the field ispassword,username,notesor the name of a custom field. If two Bitwarden items have the same name, use the item id. The forms for the other vaults are in the agent contract. aquaman credentials linkopens a dialog that names the reference and the item. Nothing in your vault is read before you allow it. Then aquaman reads the item once to check it, and records your approval in the vault. Exit code 0 means linked, 2 means you denied it, 3 means nobody answered, 1 means it was refused or the daemon is not running.- aquaman only reads a linked item. It never changes or deletes it. After you change the value in the item,
sbxgets the new one once the daemon’s cache of the old one has expired (15 minutes by default with 1Password and Bitwarden).aquaman credentials unlink github/tokenremoves the link and leaves the item alone. aquaman broker allowis a separate step on purpose. A link alone does not letaquaman gethand the value out.- Reading linked items is tested against stand-ins for the
opandbwCLIs, not against live accounts.
The Bitwarden session
The Bitwarden backend runs the bw CLI, and bw only reads a vault that is unlocked. aquaman never asks for your master password. The daemon starts with the vault locked, and aquaman unlock, run in a terminal, opens it: Bitwarden’s own bw unlock asks for the master password there, and aquaman hands the session key that comes out to the running daemon over its Unix socket.
- Where the session is: in the daemon’s memory. aquaman does not write it to
config.yaml, the keychain, the login item or anywhere else on disk, does not print it, and does not put it into a command’s arguments. The daemon passes it to eachbwit starts, in that process’s environment. - How long it lasts: until the daemon stops, until
aquaman lock, or until Bitwarden ends it. Bitwarden’s documentation says a session key is valid untilbw lockorbw logout, and the CLI’s help forbw unlocksays that unlocking ends earlier session keys. After thataquaman getfails with the codevault_lockedand the fixRun: aquaman unlock, andsbxgets no value until you have run it. The daemon does not have to be restarted. - Until you unlock,
aquaman getexits non-zero and prints nothing on stdout, sosbxis not handed an empty or wrong secret. - Values are cached in the daemon’s memory for 15 minutes by default with Bitwarden, so
sbxasking often does not startbweach time.credentials.cacheTtlSeconds: 0in~/.aquaman/config.yamlturns that off.aquaman lockdrops the cached values together with the session. A session ended withbw lockis noticed at the next read that reachesbw, so a value already cached can be served until its 15 minutes are over. - A
BW_SESSIONin the shell still works. A daemon started from a shell whereBW_SESSIONholds a sessionbwaccepts starts unlocked, andaquaman unlockin such a shell hands that session over without asking for the password again. - With
aquaman service installthe daemon starts at login without a session, because aquaman writes no secret into the login item. Runaquaman unlockonce after logging in: Bitwarden: unlock after you log in. A HashiCorp Vault token inVAULT_TOKENand a 1Password service account token inOP_SERVICE_ACCOUNT_TOKENare not carried into the login item either, and for those the daemon is started by hand from a shell that has them. The macOS Keychain needs nothing from the environment. - Some commands read the vault themselves, from your shell and not through the daemon:
aquaman setup,aquaman credentials add,list,deleteandunlink, andaquaman audit verify. They need a session in that shell. Unlock there first (export BW_SESSION="$(bw unlock --raw)") and then runaquaman unlockin the same shell, so the daemon is handed that same session. Unlocking a second time would end the first session, the daemon’s with it.aquaman get,aquaman requestandaquaman credentials linkgo through the daemon and need nothing in the shell.
A service sbx has no built-in definition for
sbx secret set <service> covers the services Docker lists in its credentials guide (Anthropic, OpenAI, GitHub and others). For any other API, Docker’s guide documents sbx secret set-custom, which takes the destination hosts, the variable name the sandbox sees, and the same --command source. For Stripe:
aquaman credentials add stripe secret_key # or link an existing item, as above
aquaman broker allow aquaman://stripe/secret_key
sbx secret set-custom \
--host api.stripe.com \
--env STRIPE_SECRET_KEY \
--command "$(command -v node) $(command -v aquaman) get aquaman://stripe/secret_key"
Run with sbx 0.54.0 and aquaman 0.19.0: sbx stored the secret, printed the placeholder it generated for the variable, and listed the command as an on-demand source; aquaman’s audit log showed the read sbx made to check it. The same run stored a built-in service with sbx secret set github --command ... --refresh on-demand, which sbx answered with “command resolved successfully”. sbx calls custom secrets experimental, and says a command source runs from a fresh temporary directory, which is why the command holds absolute paths.
Cloud sandboxes
This page is for sandboxes on your machine. Docker’s documentation for cloud sandboxes says the cloud secret commands do not support --ref and --command sources, so a cloud sandbox cannot read from aquaman this way.
If you are an agent
- Hand the setup to the person.
aquaman setupasks questions,aquaman credentials addasks for the value (hidden),aquaman credentials linkopens a dialog for them, andaquaman daemonstays running. Give them the commands above; never ask for a secret in the conversation. - Use a locator only if the person gave it to you. Do not guess vault, item or field names: the dialog shows them exactly what you wrote.
- Where the secret ends up:
sbxreceives the value and its proxy injects it; the agent in the sandbox sees a placeholder. aquaman decides which references may be read and records each read. It does not hide the value fromsbx. - The daemon does not come back by itself.
aquaman daemonis gone after a reboot or logout, andsbxcannot read the secret until the person starts it again. Tell them.aquaman service installmakes it start at every login: Start the aquaman daemon at login.
Good to know
- For a service
sbxhas no built-in definition for, give the secret its destination hosts too: since sbx 0.51 a custom secret without them is not substituted. - In a script, pass
--forceinstead of piping a confirmation (sbx 0.48+). aquaman getonly works for references you allowed, and each read is inaquaman audit tail.- Docker’s proxy does the injecting here; aquaman supplies the value. The value is handed to
sbx, so this path is about where secrets live and who read them, not about hiding them fromsbx.
More: main README