Environments
Named environments — variables and a setup script the sandbox runs before an agent starts.
A Named Environment is a workspace-scoped bundle of variables plus an optional setup script. Every Crew Agent references exactly one named environment, and the sandbox executes that environment's script before the agent's first turn.
What it stores
The workspace_named_environment table holds:
| Column | Notes |
|---|---|
name | Unique within the workspace. |
variables | JSON object — keys + string values. Materialized as environment variables in the sandbox. |
script | Shell script run inside the sandbox at start-up. Defaults to empty. |
A workspace can have many named environments. Different agents can share one (e.g. a prod environment with shared API keys) or have their own (e.g. an agent that needs a custom Python toolchain installed).
Variables vs. setup script
- Variables are the right place for credentials, endpoints, model parameters — anything the agent or its tools read at run time. They appear in the sandbox process environment.
- The setup script is the right place for installing dependencies, cloning repos, seeding fixtures — anything the sandbox needs to do once before the agent starts thinking. Each run gets a fresh sandbox, so the script runs every time.
The script is run with the variables already set, so commands can reference $MY_VAR.
Editing
Open Crew › Environments, pick an environment, and the detail page exposes a JSON variable editor and a script editor. Saving updates the row; the next agent run that references this environment picks up the change. There is no in-place reload of running sandboxes — changes apply on the next dispatch.
How the sandbox sees it
When the Agents block dispatches a run, it mints a setup OTP. The sandbox redeems that token at /env to fetch the environment's variables + script. See executor/handlers/agents/agents-handler.ts:124 for the mint and lib/crew/agent-config-serializer.ts for the payload shape.
Variables are stored as plain JSON in the database — there is no per-key encryption like there is for Model endpoints. Treat the variables field as you would environment variables in any other config store.
Source
apps/actana/app/workspace/[workspaceId]/w/crew/environments/— UIapps/actana/app/api/workspaces/[workspaceId]/named-environments/— APIpackages/db/schema.ts—workspace_named_environment