PandaStack
Templates

Coding agent templates

Start a sandbox with Claude Code, Codex, OpenCode, Gemini CLI, Grok, Amp or GitHub Copilot CLI ready to run, by naming the tool as the template.

Seven template names start a sandbox that already has a coding agent's command-line tool installed. You name the tool, the sandbox starts in about a second, and the tool is on the PATH.

TemplateToolRun a prompt and exitWhat it needs
claudeClaude Codeclaude -p "…"ANTHROPIC_API_KEY
codexCodex CLIcodex exec "…"OPENAI_API_KEY
opencodeOpenCodeopencode run "…"the key of the model provider you choose
geminiGemini CLIgemini -p "…"GEMINI_API_KEY
grokGrok CLIgrok -p "…"XAI_API_KEY
ampAmpamp -x "…"AMP_API_KEY
copilotGitHub Copilot CLIcopilot -p "…"a GitHub token with Copilot access (GH_TOKEN)

All seven names start the same image, agent. So every one of these sandboxes has all seven tools, plus Node 24, Python 3, git and ripgrep. The name is how you say which tool you mean, in your code and in your sandbox list. It costs nothing extra: same 2 GB of memory, same 8 burstable vCPUs, same restore time as agent.

PandaStack does not supply the model. You bring the key for the tool you run, and the tool talks to its own provider from inside the sandbox.

Start one

import os
import shlex

from pandastack import Sandbox

sb = Sandbox.create(template="claude", ttl_seconds=1800)

key = shlex.quote(os.environ["ANTHROPIC_API_KEY"])
result = sb.exec(
    f"cd /workspace && ANTHROPIC_API_KEY={key} "
    "claude -p 'Explain what a microVM is in two sentences.'"
)
print(result.stdout)

sb.kill()
import { Sandbox } from "@pandastack/sdk";

const sb = await Sandbox.create({ template: "codex", ttlSeconds: 1800 });

const result = await sb.exec(
  `cd /workspace && OPENAI_API_KEY='${process.env.OPENAI_API_KEY}' ` +
    `codex exec "Explain what a microVM is in two sentences."`,
);
console.log(result.stdout);

await sb.kill();
# Create the sandbox; the command prints its id.
pandastack sandbox create --template gemini --ttl 1800

# Run the tool once and get the answer back.
pandastack sandbox exec <id> -- gemini --version

# Or open a terminal in the sandbox and use the tool interactively.
pandastack sandbox ssh <id>
curl -X POST https://api.pandastack.ai/v1/sandboxes \
  -H "Authorization: Bearer $PANDASTACK_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"template": "claude", "ttl_seconds": 1800}'

# → {"id": "…", "template": "agent", "status": "running",
#    "metadata": {"template_alias": "claude"}, …}

/workspace is there for the agent's work. Clone a repository into it first if the agent should work on your code.

Give the tool its key

The key is yours, and it should live only as long as the command that needs it. Put it in front of the command, as in the examples above, so it is in that one process's environment and nowhere on the sandbox's disk.

If you run many commands in one sandbox, you can export the key once in a shell profile inside the sandbox instead. Then remember that a snapshot of that sandbox contains the key too.

Do not bake a key into a custom template. A template is restored into every sandbox created from it.

Let the agent work without asking

On your laptop these tools stop and ask before they edit a file or run a command. In a sandbox there is nobody to ask, and nothing of yours to break: the sandbox is its own Firecracker microVM, and you delete it when the job is done. This is the place where each tool's "do not ask" mode is reasonable.

ToolFlag
Claude--permission-mode acceptEdits
Codex--dangerously-bypass-approvals-and-sandbox
Gemini--yolo
Grok--always-approve
Copilot--allow-all-tools

The tools change quickly. Run <tool> --help inside the sandbox to see the flags of the version installed there.

A sandbox still has network access, and the agent holds the key you gave it. Give it a key that is scoped to this work, not your main one.

What the name changes, and what it does not

  • The sandbox's template is agent. That is what GET /v1/sandboxes/{id} reports, and usage is metered exactly as for agent.
  • The name you asked for is kept in the sandbox's metadata as template_alias, so you can still tell your claude sandboxes from your codex ones.
  • GET /v1/templates lists the seven names, each with alias_of: "agent".
  • The names are reserved. A custom template cannot be called claude, codex, opencode, gemini, grok, amp or copilot.
  • Nothing else changes. Snapshots, forks, preview URLs, the idle timeout and every SDK method work as they do for any other sandbox.
  • Templates: the full catalog and how to build your own.
  • Claude Managed Agents: the claude-agent template, which is a different thing. There Anthropic runs the agent loop and your sandbox runs its tool calls.
  • Deep Agents and the other agent framework guides: when the agent is your own code and the sandbox is where its commands run.

On this page