Closed beta: the Secrets API is currently in closed beta. Contact us to get onboarded.
- Exchange and EMS API keys for trading operations (REST and WebSocket)
- Long-lived JWTs and bearer tokens with broad authority
- OAuth refresh tokens for backend services
- Service account credentials for third party platforms
Why not a traditional secrets vault?
Key implementation decisions
Example: exchange trading key for a trading firm
A trading firm holds a long-lived JWT for an execution management system that authorizes placing and canceling orders on crypto exchanges. The plaintext should never exist in the firm’s own infrastructure.Policy: scope retrieval to the trading service
Implementation steps
1
Import the API key
Import the credential once, with static properties the policies above target. The client encrypts the plaintext to the enclave. Turnkey’s API and database only ever see ciphertext:You can now delete the plaintext from wherever it existed before.
2
Retrieve at runtime
The trading service authenticates with its own credentials and retrieves the key when it boots or opens a session.
exportSecret generates the ephemeral keypair, submits the export activity, decrypts the result, and zeroizes the key:3
Require approval for high-risk keys
For withdrawal-capable keys, add a consensus policy so no service can retrieve them alone:The export stays in
ACTIVITY_STATUS_CONSENSUS_NEEDED until a risk admin approves it from the dashboard or via approve_activity, and the released payload is still readable only by the trading service.4
Rotate and revoke
Rotate by importing the replacement key and deleting the old secret. Revoke a service by invalidating its session keys or removing its user. Policy changes take effect immediately, with no re-encryption or re-import of the stored keys.