Why use a sandbox
- Isolation: the agent can install packages and run any command. A wrong command breaks only the sandbox, which you delete.
- Keys stay out of the sandbox: a secret gives the agent its model API key as a stand-in token. Superserve adds the real key only on requests to the provider.
- One sandbox per task: run many agents at the same time, each on its own branch in its own sandbox.
- Ready to start: public templates such as
superserve/claude-codeinclude the agent CLI, git, and common tools.
How it works
1
Store the model API key as a secret
Create the secret once. The sandbox gets a stand-in token, not the key.
2
Create a sandbox from an agent template
Bind the secret to the environment variable that the agent reads.
3
Clone the repository and run the agent
Run the agent’s non-interactive mode with
commands.run.4
Read the changes back
Read
git diff, run the tests, or push a branch. Then delete the sandbox.Run Claude Code on a repository
This example clones a repository, asks Claude Code to add a file, and prints the changes. Create theanthropic-key secret first, as shown in Claude Code.
- The task goes in through the
TASKenvironment variable, so quotes and other shell characters in it reach the agent unchanged. --permission-mode acceptEditslets Claude Code edit files without a prompt. Give more permissions only for commands that the task needs.- Agents can work for many minutes. Give
commands.runatimeoutthat is longer than the task, or stream the output to watch the agent work. - To keep the agent’s work, push a branch from the sandbox, or take a snapshot to continue later.
Integrations
Each integration guide shows the template, the secret, and the command for one agent. See the coding agents, such as Claude Code, Codex, and OpenCode. To let a platform run the agent loop on a Superserve sandbox, see the agent platforms.Related guides
Secrets
Give agents API keys without exposing them.
Snapshots
Save a sandbox’s state and continue later.
CI workers
Run builds and tests in sandboxes.
Code interpreter
Run model-generated code and read the output back.