Sandboxer
API keys for agents
A Sandboxer API key can be limited to a few actions, a set of sandboxes or environments, and a lifetime. Give an agent or a CI job only the key it needs, and a leaked key can't reach anything else.
Updated November 12, 2026
How is a key's scope decided?
Per Sandboxer's API keys docs, a request is allowed only when both of these hold:
- its action is in the key's actions, such as
exec,file.readorsandbox.create; - its target sandbox is one of the key's sandboxes, or in one of its environments.
Everything else is denied.
sbx api-key create one-sandbox --sandbox <sandbox-id> --actions sandbox.read,exec,file.read --ttl 7dWhich presets are there?
| Preset | For |
|---|---|
read-only | Dashboards and monitoring |
full-sandbox | Operating existing sandboxes, without creating or deleting them |
ci | Pipelines: full-sandbox plus create, resume, fork and deleting only the sandboxes the key created |
admin | Automation that manages the account |
A key keeps the actions it was created with, even if a preset gains actions later.
What about the key inside a sandbox?
Every sandbox gets SANDBOXER_TOKEN for the SDK and CLI calls it makes about itself. The in-sandbox key section lists what it can do. It can't create or delete sandboxes, save snapshots, or read or change your account. If code in a sandbox needs more, pass it a key of its own with only the actions it needs and a short --ttl.
How do you rotate or revoke a key?
Sandboxer stores only a hash of each key, and shows the full secret once, when you create or rotate it. You can rotate or revoke a key from the dashboard or the CLI. Its usage stays readable after you revoke it, including which sandboxes it created.
Which actions can a key have?
The API keys docs list each action a key can carry. The main ones:
sandbox.create,sandbox.read,sandbox.update, and the stop, resume, fork and delete calls;execto run commands, andfile.readandfile.writefor files;sshfor SSH, scp and port forwarding,hostto host ports, anddesktopfor the desktop and browser streams;agent.promptto prompt, steer or interrupt an integrated agent;snapshot.readandsnapshot.write, andenvironment.readandenvironment.writefor environments and secrets.
Creating keys needs a browser session or a key with the admin preset, so an agent holding a narrow key can't mint itself a wider one.
Frequently asked questions
How long should an agent's key last?
As long as the task. A key can expire in minutes or days with --ttl, so a key for one run can end with the run.
Can a key delete only what it made?
Yes. The sandbox.delete-own action, part of the ci preset, deletes only sandboxes that key created.