Give the sandbox what it needs
Your toolchain, a browser, network access for packages, and what to do about secrets tests need.
A session's sandbox starts from an image with git, and Pistis copies the repository in. Your tests may need more: a language toolchain, a browser, a package registry, a database. This page shows how to give the sandbox each of them.
Your own image
Build an image on the base you already use and copy Pistis's sandbox program into it. Any Linux base works, glibc or musl:
FROM node:24-bookworm
COPY --from=ghcr.io/akshay5995/pistisd:<version> /usr/local/bin/pistisd /usr/local/bin/pistisd-musl /usr/local/bin/pi-env /usr/local/bin/pistisd-entry /usr/local/bin/
RUN mkdir -p /workspace
WORKDIR /workspace
ENTRYPOINT ["/usr/local/bin/pistisd-entry"]Put in it whatever a fresh checkout needs to build and test: compilers, package managers, system libraries. Then tell Pistis to use it:
| Where Pistis runs | Set |
|---|---|
| Compose | PISTIS_SANDBOX_IMAGE in .env, then docker compose up -d |
| Kubernetes | image.pistisd in the chart's values |
| Any server | sandboxes.image in pistis.json |
| Your laptop | pnpm pistis dev --image my-sandbox |
With Docker, Pistis never pulls a sandbox image: it must be on the host already. Compose pulls the one in PISTIS_SANDBOX_IMAGE for you; elsewhere, docker pull or build it on the host. On Kubernetes the nodes pull it as usual.
A browser
For the agent to open web pages, the image needs Chromium; Pistis finds it and offers the browser tools by itself. On Debian, add apt-get install -y chromium, or start from ghcr.io/akshay5995/pistis-browser, which has Debian's Chromium, Node and git. Other bases are listed in A browser in the sandbox.
Network access
Pistis clones the repository on your server, so the sandbox needs no network for git. By default it reaches nothing else. To install packages during a session:
- Docker: list the hosts it may reach in
sandboxes.allow(shorthandsnpm,pypi,cratesandgo), or--allow-registry npmwithpistis dev. A proxy lets those through and logs each request.sandboxes.internetopens the internet but not other sandboxes. - Kubernetes:
sandboxes.egress=openlets sandbox pods reach the internet but never private address ranges.
Faster and safer still: install the packages in your image, so a session needs no network at all. See Sandboxes for how each setting works.
Databases and services
A database or service your tests need can run inside the sandbox: install it in the image and start it from the tests, or from a setup script the agent runs. Nothing outside the sandbox can reach it.
Secrets your tests need
Pistis can't yet give one agent's sandboxes a secret of their own, such as a token for a test account. Until it can:
- Prefer tests that need no secret. Run the database in the sandbox, and fake the outside services the tests call.
- Put work that needs a real key in a tool on your server: an MCP server or a plugin tool. It keeps the key, every call is recorded, and it can wait for approval.
- If you must, bake a low-value test key into your own image. Every session on that image can read it, and so can any code the agent runs, so use a key that can only touch test data and that you can revoke.
Never put a production key in a sandbox image.
Anything in the image is readable by the agent and by the code it runs. Pistis keeps its own keys out of the sandbox for that reason.