default. A sandbox reads its environment at the start of every exec and spawn session, so a change applies to the next command without a restart. See Environments and secrets.
Start a sandbox in an environment
Sandbox.create({ environment }) takes an environment id (env_...) or name. Left out, the sandbox uses default. An unknown id or name fails with unknown_environment (400). A fork keeps its parent’s environment.
zode.environments
Every method that takesenv accepts an id or a name.
Environment names follow the sandbox name rules: lowercase letters, digits and
-, 1 to 63 characters, not starting or ending with -.
resolve returns a well-formed id unchanged and looks names up with list(). A name with no match throws ZodeError not_found (404). The default environment cannot be deleted. To delete by name, resolve first:
Variables
Variables are plain values. Anyone in the workspace who can run sandboxes can read them.- Names are letters, digits and
_, do not start with a digit, and are at most 128 characters. Names starting withZODE_are reserved. - A value is UTF-8 text without NUL bytes, at most 4096 bytes.
- An environment holds at most 100 variables, with values totalling at most 32 KB.
env option of exec and spawn adds variables for one command; they win over the environment’s on a name clash.
Secrets
The sandbox never sees a secret’s value. It sees a placeholder,zode_vault_..., in the variable of that name. When a request leaves the sandbox over TLS to one of the secret’s allowedHosts, the host’s egress proxy swaps the placeholder for the real value. Requests to any other host carry the placeholder unchanged.
allowedHostsneeds 1 to 20 host names, such asapi.stripe.comor*.example.com, without scheme or port.valueis required for a new secret and optional when you update one. It is UTF-8 text without NUL bytes, at most 16 KB.- An environment holds at most 50 secrets. A secret and a variable in the same environment cannot share a name.
- Values are encrypted at rest.
secrets()returnsname,allowed_hosts,created_at,updated_at,updated_byandlast_used_at.
Who can change them
Owners and admins create and delete environments and set or delete variables and secrets. Members can list environments and read variables and secret names. The billing role sees none of it. Other roles getforbidden (403).
Limits
A workspace has at most 20 environments. Going over any limit on this page fails withlimit_reached (409); a duplicate name fails with name_taken (409).