Skip to main content
Amp is a terminal coding agent from ampcode.com. Run it in a Superserve sandbox so its shell commands and file edits stay isolated from your machine.
Amp bills agent usage to your Amp account. The free Hobby tier includes no usage, so buy credits or pick a paid tier (pricing) before you run the agent. To bill your own provider instead, set up model routing.

Via the console

  1. Go to console.superserve.ai and click Create sandbox.
  2. Pick the superserve/node-22 template.
  3. Under Advanced Options → Environment Variables, add AMP_API_KEY and paste your Amp access token (it starts with sgamp_).
  4. Create the sandbox, open its Terminal, and run:

Via the SDK

Amp reads AMP_API_KEY from the environment. Environment variables are plain text, so any process in the sandbox, including the agent, can read the token. Revoke it on the access token page if it leaks.
Don’t bind the token as a secret. Amp runs each agent turn over a WebSocket connection to ampcode.com. When a secret is bound, the sandbox sends outbound HTTPS traffic through the secrets proxy, and Amp’s WebSocket client can’t connect through it. Amp then exits with WebSocket connection failed.
Open the sandbox in the console, launch the terminal, and run amp.

Run headless

Pass a prompt with -x (execute mode). Amp runs it in the sandbox, prints its final message, and exits. Amp doesn’t ask for approval before it runs tools, so the agent runs shell commands and edits files without stopping.
Use -x, not -ox. -ox runs the agent in an orb on Amp’s servers, so its commands and file edits don’t happen in your Superserve sandbox.
Auto-approved commands stay inside the sandbox and can’t touch your machine, but the sandbox can still reach the internet. Use network rules to limit where it can connect.
Add --stream-json to get one JSON event per line instead of only the final message. The last event has type: "result" and the thread ID in session_id. If the turn succeeds, the final answer is in result. If it fails, is_error is true and the message is in error. Check is_error, because Amp can exit with code 0 when a turn fails. Check the command result before you parse: at the timeout, run() stops Amp and returns exit code 124, and truncated is true when the output was cut off. In both cases the last event can be missing or incomplete.

Continue a thread

Amp saves each conversation as a thread. Pass the thread ID to amp threads continue to send a follow-up with the earlier context. Amp archives a thread that -x creates when the command finishes, and an archived thread can’t be continued. Pass --no-archive-after-execute on the first turn, as the --stream-json example above does.

Keep the version fixed

Amp updates itself in the background, so a long-lived or resumed sandbox can end up on a newer version than the one you installed. Set AMP_SKIP_UPDATE_CHECK=1 to turn off update checks:

Persist sessions