Create a key for CI
Create keys in the dashboard under API keys (owners and admins). Give CI its own key, with the least access it needs and an expiry:
Options on every key:
- Expiry: 7, 30, 90 or 365 days, or never.
- Sandbox list: limit the key to specific sandbox IDs. Other sandboxes answer “not found” to it.
vault:bind lets a key make new credential vault bindings: create a sandbox, or update its network, with a header rule that sends a stored secret to a host. No preset has it, not even Full access, because a key with it can send any of your secrets to any host on that secret’s allowed hosts. It does nothing on a key with a sandbox list.
An unrestricted API key has no scopes and no sandbox list. It may do everything an API key can, including change the team egress settings and the credential vault, which a scoped key may not. Keys you create on the dashboard always have scopes, so they are never unrestricted.
The secret is shown once. Revoking a key stops it at once. Keys created before the usage:read and billing:read scopes existed do not have them. Key management is a dashboard action: API keys cannot create, list or revoke keys (the /v1/api-keys routes accept dashboard sessions only, see the API reference).
Use it in a job
Store the key as a CI secret and name itANONA_API_KEY. The workflow below uses the stock e2b SDK, so it maps the secret to E2B_API_KEY and sets E2B_DOMAIN:
sweep.sh
The CLI with a key
The CLI takes--api-key, else ANONA_API_KEY, else the profile (other accepted names are in Configuration); a key wins over a browser sign-in. To keep one in a profile:
key_profile.sh