API key vault
The vault is a recovery surface, not a permission surface. When a workspace turns it on, API keys and provider credentials issued from then on are encrypted at rest alongside the existing one-way hash of the same credential. A personal access token is stored encrypted only if you choose that when you create it. The hash still gates request authentication; the vault lets an owner or admin recover the plaintext if the human who issued the key lost it.
Revealing someone else's key needs the same authority as creating keys, and any member can reveal their own API key. The vault does not introduce a new admin role. An admin who could have issued the key in the first place can also reveal a previously-issued key after stepping up their own credentials, unless an owner has turned off key reveal for admins.
When to enable the vault
Turn it on when at least one of the following is true:
- You issue keys on behalf of teammates who do not have IQ accounts (consultants, contractors, agencies). Without the vault, a rotated or lost key forces a new issue and a new wiring step in their application; with the vault, you reveal once and resend.
- Your org keeps key plaintext in 1Password / Bitwarden / a password manager and the manager occasionally loses sync. The vault is the recovery path of last resort.
- Your security review requires that key plaintext is recoverable for forensic purposes (incident response, audit trail correlation).
Leave it off when the operational pattern is "the human who created the key keeps the plaintext; if they lose it, they re-issue." That is the default flow and it remains supported.
How to enable
Settings → Key vault → toggle the switch. The change applies to all keys, tokens, and provider credentials issued after the toggle flips. Existing rows stay unvaulted; the next rotation will encrypt them into the vault.
The dashboard surface lives at /settings#key-vault.
How a reveal works
- Open Keys and click the eye icon on a vaulted key's row.
- Key reveals are temporarily unavailable while IQ fixes step-up code delivery. If you need access to a key you vaulted, revoke and reissue an IQ API key or operator token, or re-enter a provider credential from that provider's own console. This section will describe the reveal flow again once step-up delivery ships.
- The reveal endpoint decrypts the encrypted blob server-side, returns the plaintext, and starts a 30-second display window. A countdown ticks down on screen; the plaintext clears from the DOM when it reaches zero.
- Every API key reveal writes an
api_key_revealedrow to the audit log with the actor email, the key id, and the step-up method. Personal access token and provider credential reveals writepersonal_access_token_revealedandorg_provider_credential_revealedrows instead. The audit row surfaces in Audit under the actor's filter chip. - Every reveal also enqueues a webhook delivery to any active
destination subscribed to the
api_key_revealedevent so external security tooling (a SIEM, a Slack channel) can react in real time.
Limits and rate limits
- 10 reveals per user per hour. The window is rolling rather than
calendar-aligned, so capacity comes back an hour after each individual
reveal rather than all at once on the hour. The count spans all three
reveal kinds (API key, personal access token, provider credential).
Exceeding it returns
429 Too Many Requests. - 5 wrong codes per challenge. After five incorrect code submissions against a single challenge, that challenge stops accepting codes; request a new one to try again.
- 30-second TTL on the plaintext. No way to extend; copy the plaintext to your password manager during the window or re-issue.
- One step-up per reveal. Step-up does not grant a session-wide trust window; every reveal re-prompts.
- Vaulted rows only. Keys issued before the vault toggle flipped
are unvaulted; their reveal endpoint returns
404 Not Found. Rotate them to encrypt forward.
Encryption details
- Authenticated encryption. Tampering with the ciphertext at rest causes decrypt to fail rather than return garbage.
- Key material. The master key is held in the hosted gateway's secret store, never written alongside the ciphertext, and never emitted to logs. The gateway refuses to encrypt at all rather than fall back to a process-local key, so a vaulted row cannot become undecryptable across a restart.
- Rotation-safe. A future master-key rotation does not force a re-encrypt pass or a reveal outage: rows vaulted before and after a rotation both stay decryptable through the normal reveal flow, with no action required on your side.
- No client-side decrypt. The encrypted blob never leaves the gateway. The dashboard receives only the plaintext during the bounded reveal window.
Rollback
The Settings → Key vault toggle only ever looks forward. Turning it off stops new keys, tokens, and provider credentials from being vaulted from that point on -- the mirror image of turning it on -- but it does not reach back into anything already vaulted. Rows vaulted before the flip stay encrypted and stay revealable through the normal reveal flow, with the same step-up, rate limit, and IP allowlist checks as always. The toggle is read only at issue time; nothing in the reveal path checks it. Hash-based credential verification is unaffected by the toggle either way, so request authentication keeps working throughout.
See also
- /docs/auth -- how API keys, scopes, and the
gw_live_prefix work end-to-end. - /docs/webhooks -- wiring the
api_key_revealedevent into an external destination. - /audit -- the audit log surface where reveal rows land.
IP allowlist
The reveal endpoint enforces step-up auth, the per-user 10/hour rate limit, the active-org membership check, and a mandatory audit row. A per-org IP allowlist sits on top.
Set the allowlist in Settings → Key vault → IP allowlist. The
textarea accepts one CIDR per line (203.0.113.0/24, 2001:db8::/32,
or a single host like 203.0.113.42/32). An empty list disables the
gate; a non-empty list rejects any reveal whose source IP does not
match. Rejected attempts write an api_key_reveal_ip_blocked audit
row carrying the resolved source IP and the size of the allowlist.
The source IP comes only from the IQ dashboard, which passes on the address
it saw over an authenticated link. IQ does not read forwarded headers and
does not fall back to the connection address, so with an allowlist set, a
reveal works only through the dashboard. When no valid address arrives, the
reveal is refused with 403 Source IP not resolvable and an
api_key_reveal_ip_blocked audit row, so the gate fails closed rather than
open.
The allowlist is per-org, not per-user. An operator who works from multiple machines lists every CIDR; the allowlist is defence in depth on top of step-up auth, not a per-machine identity.
WebAuthn-required reveals
Key reveals are temporarily unavailable while IQ fixes step-up code delivery. If you need access to a key you vaulted, revoke and reissue an IQ API key or operator token, or re-enter a provider credential from that provider's own console. This section will describe the reveal flow again once step-up delivery ships.
For orgs whose compliance posture requires hardware-backed step-up,
flip Settings → Key vault → Require passkey for reveals. When
reveals return, the toggle will reject code-only step-up with
403 WebAuthn registration required: the operator will need a
WebAuthn assertion in addition to the step-up code, never in place of
it. The operator must register a passkey under Settings → Key
vault first. A WebAuthn assertion that is present but fails
signature verification returns a different error, 403 WebAuthn assertion verification failed.
The toggle is independent of the vault enable/disable toggle; an org can enable vaulting and code-only reveals together during an initial trial, then promote to passkey-required once every operator has enrolled. A passkey loss does not lock the operator out of the dashboard -- only the reveal endpoint gates on the passkey, so the operator can still log in normally, disable the toggle, and rotate keys via the existing revoke-and-reissue flow.
For an even stricter posture, Settings → Key vault → Hardware token requirement for reveals (button: Require hardware token) accepts only a cross-platform FIDO2 authenticator over USB, NFC, or BLE; a platform passkey such as Touch ID or Windows Hello is refused once this is on.