Prime Agent
Start from Tenki's pre-built Prime Agent image and run Prime Intellect's coding and research harness headlessly.
Tenki's public tenki/prime-agent:stable image starts from the standard sandbox base image and adds Prime Intellect's Prime Agent coding and research harness (the prime-agent command) plus the prime-agent-smoke command for a one-shot connectivity check. It pins prime-agent at version 0.9.8. No credential is baked into the image. Prime Agent authenticates two ways and both work in a sandbox: a PRIME_API_KEY from your Prime Intellect account passed per session, or a browser login from Prime Agent's interactive interface. The key is the better default here, since nothing has to be approved by hand and a session can start and finish unattended. Sandbox usage is programmatic, so you drive Prime Agent with its print mode, prime-agent -p, which runs a single prompt and exits.
Prime Agent: Prime Intellect's coding and research harness in your sandbox
Prime Agent is built around a persistent Python REPL kernel as the model's only tool — its own prime-agent-runtime package, not Jupyter's ipykernel — plus recursive sub-agents that can spawn further sub-agents to delegate or parallelize parts of a task. Routing everything through one stateful kernel means variables, imports, and intermediate results carry across turns within a run, instead of each tool call starting cold.
This image prewarms that kernel's Python environment at build time, so the first prime-agent -p in a session does not pay to bootstrap it.
Isolation
Prime Agent executes model-generated Python and project commands with the permissions of its own process. Its worker and kernel processes improve lifecycle isolation and recovery, but are not themselves a security boundary. In a Tenki sandbox, the guest is the entire boundary, and it is enforced per session.
What that boundary does here:
- Inside the guest: Prime Agent runs as the unprivileged
tenkiuser (uid 1000), which has passwordlesssudo. It can read and write within that guest's filesystem, run shell commands, and use the installed toolchain, all as that user, and it can reach root there. - Outside the guest: Prime Agent cannot reach the host kernel or filesystem, other tenants' sessions, or the Tenki control plane.
- Network: Prime Agent reaches the network only through the sandbox's normal egress path. It gets no special network capability beyond a standard sandbox session.
- Credentials and state: a provider key exists only as session environment, set at creation; a browser login is stored in
~/.prime/agent/auth.jsoninside that session only. No credential or state is carried from one session to the next, so nothing bleeds between sessions. The image itself contains no credential.
Start a session with an API key
Export your Prime Intellect API key locally, then pass it only to the session. Prime Agent reads it straight from the session environment and uses Prime Inference as the provider, so it needs no login step. An optional PRIME_TEAM_ID selects a Prime Intellect team:
export PRIME_API_KEY=<your-prime-api-key>
tenki sandbox create \
--image tenki/prime-agent:stable \
--env "PRIME_API_KEY=$PRIME_API_KEY" \
--name prime-agent-demoPass the key only through --env when you create the session. Never put it in a template, image, or source file, where it would reach every session built from them. Snapshots taken from this session also contain the key.
Run the built-in connectivity check:
tenki sandbox exec --session prime-agent-demo -- prime-agent-smokeprime-agent-smoke reads PRIME_API_KEY, asks Prime Agent to use its Python kernel tool to print a sentinel, and checks the reply. A successful result looks like:
TENKI_SANDBOX_OKprime-agent-smoke exits 2 when PRIME_API_KEY is unset, and 1 when the run times out, fails outright, produces no output, or replies without the sentinel.
Terminate the Tenki session when you finish:
tenki sandbox terminate prime-agent-demoStart a session with a browser login
Use this path to sign in with your Prime Intellect account instead of passing an API key. Create the session with no key:
tenki sandbox create --image tenki/prime-agent:stable --name prime-agent-demoOpen a shell over SSH and start Prime Agent's interactive interface:
tenki sandbox ssh prime-agent-demo
prime-agentChoose Log in with Prime Intellect. Prime Agent prints a URL on app.primeintellect.ai and a verification code. Open that URL on your own machine and complete the sign-in, or paste an existing API key at the prompt instead. The login creates an API key on your Prime Intellect account and stores it in ~/.prime/agent/auth.json inside that session, so prime-agent -p then runs with no PRIME_API_KEY set. Snapshots taken from this session also contain that key. Terminating the session does not revoke that key; revoke it from your Prime Intellect dashboard when you finish.
If a session has both, PRIME_API_KEY takes precedence over the stored login, so an invalid key fails the run even when a valid login is present.
Environment passed with --env reaches tenki sandbox exec, not SSH shells. To use PRIME_API_KEY in the interactive interface over SSH, export it in that shell first.
Run a headless task
Drive Prime Agent programmatically with -p, which runs a single prompt and exits. Add --mode json to get the run as JSON Lines, one event per line ending with an agent_end event, which is what you'll want when a script or SDK has to parse the result. For anything beyond -p, run prime-agent --help inside the session or see Prime Agent's documentation.
# One-shot task that runs code in Prime Agent's Python kernel
tenki sandbox exec --session prime-agent-demo -- prime-agent -p "write a Python script that prints the first 10 prime numbers, run it, and show the output"
# Against your own project: clone it into the session first, then run Prime Agent inside it, with structured output
tenki sandbox exec --session prime-agent-demo -- \
bash -lc "git clone https://github.com/your-org/your-repo /home/tenki/work && cd /home/tenki/work && prime-agent -p --mode json 'list the top-level modules and how they build'"A -p run proceeds to its configured budget, not to a verified correct result, so review its output before trusting it.
Prime Agent also reads other providers' own keys straight from the session environment, such as ANTHROPIC_API_KEY, OPENAI_API_KEY, XAI_API_KEY, and OPENROUTER_API_KEY, and around twenty others. Pass that provider's variable with --env instead of, or alongside, PRIME_API_KEY.
Scope
This image is for one-shot, headless runs. Prime Agent's attach/detach flow and long-running interactive sessions are not supported in v1, apart from the one-time browser login described above. A -p run starts Prime Agent's background daemon, even with --no-session, and the daemon stays running, idle, after the run finishes. Run prime-agent shutdown --force to stop it, or terminate the session.
Prime Agent keeps session history and settings under ~/.prime/agent (override with PRIME_AGENT_CODING_AGENT_DIR), which the image pre-creates, owned by the tenki user. History is append-only JSONL. None of it, or anything else written in the session, survives termination unless you've attached a volume.
Traces
Prime Agent has two separate telemetry paths. Generic install and usage telemetry (PostHog-backed, pseudonymous, limited to primitive properties) defaults on upstream; the prime-agent command in this image is a wrapper that sets DO_NOT_TRACK=1 by default, so that path is off unless a session explicitly overrides it. Full session trace upload (PRIME_AGENT_TRACES_BASE_URL, using a separate agent_traces-scoped API key) is its own system that defaults off and needs its own opt-in; the image doesn't touch it either way. So by default, Prime Agent sends no telemetry beyond ordinary calls to your configured provider.
The image pins prime-agent, but an explicit prime-agent update still runs Prime Intellect's public installer and can move the session off the pinned version. Prime Agent's bundled prime-intellect skill can also install the prime CLI on demand with uv tool install prime.
Pin an exact build
stable moves to each newly published build. When a workload has to stay on the exact build it was tested against, resolve the tag once and launch the snapshot reference it returns:
tenki sandbox registry resolve tenki/prime-agent:stable
# image_id : <image-id>
# snapshot_id : <snapshot-id>
tenki sandbox create --image tenki/prime-agent@<snapshot-id>A snapshot reference never moves, so it keeps launching that build after stable advances.