Secrets
Updated November 10, 2026 · first published October 28, 2026 · by the AQ team
Secrets in AQ are API keys, tokens and connection strings stored encrypted and handed to agents, terminals and previews as environment variables. No AQ screen or API ever shows a saved value again. Manage them in Settings, Organization, Secrets.
Personal and organization secrets
Any member can save personal secrets; admins manage the organization's. A secret can be limited to one repository. When the same name exists more than once, the personal secret wins over the organization's, which wins over the repository's uploaded .env file.
Where secrets appear
Terminals, previews, services and every agent run on a work item or in a bot's chat get the secrets as environment variables. When an agent needs one that is missing, it asks with a secure card in the thread: Save and continue, or Skip. A value saved there reaches the turn that asked without restarting it.
Secrets added while an agent works
A process gets its environment when it starts, so a secret saved, replaced or removed while an agent is running does not change the environment of processes that were already running. Every agent run on a machine has the variable AQ_SECRETS_FILE, the path of a file readable only by the person the run acts as (mode 0600). Within a few seconds of any change, from Settings, a .env or Doppler import, the API or a request card, AQ rewrites that file for every live session that can see the secret, with every secret the work item can see as shell assignments: one export NAME='value' per secret, values single-quoted so multiline values survive. The file is replaced in one step, so it is never half-written, and a removed secret disappears from it. Until a secret changes during the session, the file may not exist; the run's environment already has every secret. The agent is told which names changed in its next AQ tool result or its next turn, and loads them with:
set -a; . "$AQ_SECRETS_FILE"; set +a
New terminals, previews, services and the next agent process get the change as environment variables on their own. AQ never wakes a sleeping machine to update the file; its next run starts with the current secrets. The file is deleted when the session ends.
Kept out of the record
Every saved value is replaced with [secret: NAME] in transcripts, run output, commit messages and pull request titles. If you paste something that looks like a key into the composer, AQ offers to save it as a secret instead of sending it.
Multi-line values
A secret can span several lines: an rclone config, an SSH or PEM private key, a service account JSON file. Every value is kept byte for byte, including newlines, a trailing newline, quotes and $; nothing is trimmed.
- The card in a thread and Settings. The value field is a hidden multi-line box. Paste the whole thing, then use Show to check it; the field says how many lines it holds. On the iPhone, Paste takes the clipboard exactly as it is.
- A .env import. A quoted value can span lines up to its closing quote and becomes one secret. Single quotes and backticks are literal. Double quotes turn
\ninto a newline and\"into a quote, and leave$HOMEas written. - In a running turn. A value saved from a card while a turn runs is written to the file named by
$AQ_SECRETS_FILEasexport NAME='...', single-quoted the way the shell expects (a quote inside becomes'\''), soset -a; . "$AQ_SECRETS_FILE"gives back the exact value with its newlines. New processes get it as an ordinary environment variable.
RCLONE_CONFIG_REMOTE="[remote]
type = s3
provider = AWS"
SSH_KEY='-----BEGIN OPENSSH PRIVATE KEY-----
...
-----END OPENSSH PRIVATE KEY-----'
Imports
Import secrets from a .env file, or from Doppler with the repository's Doppler token, refreshed hourly. Background: keep secrets out of coding agent prompts.