Environment
Ara sessions run in cloud sandboxes. A repository’s Environment is the saved
definition of the box its sessions run in. At the start of each session, Ara boots
the Image and injects your repo, secrets, tools, and guides on top of it. The
Image is built from a Recipe, base, env, and setup steps, just like a
Dockerfile.
If you know Docker: the Recipe is your Dockerfile and the Image is
the built image. base is your FROM, env bakes in variables, setup is
your RUN steps. Everything injected on top is per session, so changing it
never rebuilds the Image.
A concrete example
acme-ara / acme-monorepo, a Bun app with a little Python tooling:
Only the Recipe (base, env, setup) becomes an Image and needs a build.
Secrets and MCP tools are injected fresh each session, so rotating a key or
adding a tool never rebuilds anything.
Use an Environment when a repo needs more than a plain clone. The fastest setup is
usually a small Session Start Script. Move only stable, expensive work into the
Recipe’s setup steps.
The concepts
Recipe → Build → Image → Pin
The Recipe is declarative, like a Dockerfile. A Build turns it into an Image, and you pin a successful build to make it the Active Image your sessions boot from.
Only changes to base, env, or setup (the initialize key) require a new
build. Editing the Session Start Script, Knowledge, or Clone never does. If a pin
is missing, stale, or invalid, Ara falls back to the default base image so a bad
build never bricks the repo.
Where each part runs
base, env, and setup steps are baked into the Image at build time. This runs once per build, not per session.
Ara syncs the repo and prepares a warm sandbox before it can be claimed.
Repo-specific setup runs after a session claims the sandbox, with runtime secrets available.
The Recipe: base, env, and setup
The Recipe is the part of the Environment that becomes an Image. Its setup
steps (the initialize key) run at build time, not on every session. Non-secret
environment variables go in env, and base selects what everything is built on.
Use setup steps for stable, expensive tools that do not need the current repo
checkout:
- system packages and language toolchains
- large Python wheels
- global CLIs
- browser or desktop support packages
Do not put repo-lockfile installs in setup; the repo checkout is not part of the
Image. Keep bun install, pnpm install, uv sync, and similar commands in the
Session Start Script unless they are intentionally global and independent of the
repository.
Do not bake credentials into the Image, not in setup steps and not in env.
Secret-shaped env names (*_TOKEN, *_SECRET, *_PASSWORD, *_API_KEY,
*PRIVATE_KEY) are rejected outright. Steps that need secrets belong in the
Session Start Script, where the session’s encrypted secrets are sourced at
runtime. env values must be scalars (string, number, or boolean).
Session Start Script
session_start compiles into a shell script that runs in the cloned repository
after a session claims the sandbox. It is not baked into the Image, so editing it
takes effect on the very next session with no rebuild.
The Session Start Script is launched in the background after the repository is cloned and the run’s secrets are available. It does not block the first model token. If the agent reaches a command before setup is done, it receives a note to retry or install what is missing.
Use the Session Start Script for anything that tracks the current repository state:
- package installs from the lockfile
- code generation
- Prisma or ORM generation
- private registry auth
- commands that need repo files or run secrets
Base Images
The base key selects what the Recipe is built on.
Ara Base Images
Custom Base Images
Any public Docker image works as a base, write a full image reference instead of a catalog name:
Ara automatically appends its runtime layer (the sandbox API, Codex, git, and the GitHub CLI) on top of your base, so any image becomes session-capable without manual setup. A few rules apply:
- The image must be publicly pullable (private registries are not supported).
- It must be amd64 and Debian-family (the runtime layer uses
apt-get; Alpine/musl bases fail the build). - Compressed size is capped at 5 GiB.
- Before a Custom Base Image can be pinned, Ara boot-tests it: the image must start and pass a runtime check. A failing image is rejected at pin time and your repo keeps its previous Active Image.
A base-only Recipe (no setup steps) still goes through the build-and-pin
workflow, so boot behavior is identical whichever parts you use.
A practical Environment
Start with a Session Start Script. Promote only the slow, stable pieces into the
Recipe’s setup steps once you see them repeated across sessions.
knowledge is never executed. It remains declarative Environment reference data;
it is not copied into the retired Knowledge product or into native Codex memory.
Apply an Environment
You can manage environment setup from the app, or through the API. The API shape below is enough for the common flow; the full request and response schemas live in the API Reference.