Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
f4802c4
docs(sandboxes): add sbx env experimental section to workflows page
dvdksn Jul 3, 2026
c5e7e8f
docs(sandboxes): add dedicated sandbox environment files page
dvdksn Jul 3, 2026
d4bce81
docs(sandboxes): fix schema accuracy from source code review
dvdksn Jul 3, 2026
e40a32b
docs(sandboxes): polish sandbox-environments page
dvdksn Jul 3, 2026
20dde9e
docs(sandboxes): add Experimental sidebar badge to sandbox-environmen…
dvdksn Jul 3, 2026
4450c95
Merge remote-tracking branch 'upstream/main' into codex/update-sbx-en…
dvdksn Aug 11, 2026
899edf4
docs: align sandbox environment reference with v0.39
dvdksn Aug 11, 2026
f1f14b2
sandboxes: prepare environment docs for v0.39
dvdksn Aug 11, 2026
9feb274
sandboxes: link environment files from get started
dvdksn Aug 11, 2026
63b47b3
sandboxes: improve environment file introduction
dvdksn Aug 12, 2026
3456c6b
sandboxes: add environment workflow gallery
dvdksn Aug 12, 2026
8f2a9a7
sandboxes: omit environment interpolation docs
dvdksn Aug 12, 2026
74499a9
docs(sandboxes): improve environment file learning flow
dvdksn Aug 14, 2026
03e08ea
docs(sandboxes): strengthen environment starter example
dvdksn Aug 14, 2026
1b95d19
docs(sandboxes): keep automation workflow focused
dvdksn Aug 14, 2026
1cb30b4
docs(sandboxes): move update details after workflows
dvdksn Aug 14, 2026
c69be6e
docs(sandboxes): remove redundant project workflow
dvdksn Aug 14, 2026
7db7bbb
docs(sandboxes): add port to starter environment
dvdksn Aug 14, 2026
6afa473
docs(sandboxes): clarify environment field behavior
dvdksn Aug 14, 2026
fc07891
docs(sandboxes): keep environment files outside workspaces
dvdksn Aug 17, 2026
2f4d007
docs(sandboxes): link clone mode guidance
dvdksn Aug 17, 2026
092a2d1
docs(sandboxes): consolidate workspace warning
dvdksn Aug 17, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions content/manuals/ai/sandboxes/get-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,9 @@ Then explore:
publishing.
- [Workflow patterns](workflows.md) — Git strategies, local services, CI, and
authenticated tools.
- [Sandbox environment files](sandbox-environments.md) — declare and share
repeatable local sandbox configurations with `.sbxenv.yaml`. Requires `sbx`
0.39.0 or later.
- [Customize with kits](customize/) — package an agent, its tools, and its
network rules into a reusable definition you launch with a single flag.
- [Agents](agents/) — the full list of supported agents and how to configure
Expand Down
391 changes: 391 additions & 0 deletions content/manuals/ai/sandboxes/sandbox-environments.md

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions content/manuals/ai/sandboxes/workflows.md
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,11 @@ CI provider's secret store, use `-t`. For example, in a GitHub Actions step:
- run: sbx secret set anthropic -t "${{ secrets.ANTHROPIC_API_KEY }}"
```

## Sandbox environments

For a declarative alternative to `sbx run` flags, see
[Sandbox environment files](sandbox-environments.md).

## Share setup across a team

When several people use sandboxes on the same project, separate repeatable
Expand Down
28 changes: 28 additions & 0 deletions data/sbx_cli/sbx_env.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: sbx env
Comment thread
dvdksn marked this conversation as resolved.
synopsis: |
Manage sandboxes declaratively from a .sbxenv.yaml file
experimental: true
description: |-
Manage a sandbox environment declared in a .sbxenv.yaml file.

The file describes the agent, optional mixin kits, workspace mounts,
environment variables, secrets to provision, and per-service credential
bindings. Secrets are provisioned at the environment's sandbox scope so
`sbx env rm` can remove everything it created.
usage: sbx env COMMAND
options:
- name: help
shorthand: h
default_value: "false"
usage: help for env
inherited_options:
- name: debug
shorthand: D
default_value: "false"
usage: Enable debug logging
see_also:
- sbx - Manage AI coding agent sandboxes.
- sbx env create - Create a sandbox environment from .sbxenv.yaml
- sbx env exec - Execute a command inside a sandbox environment
- sbx env rm - Remove a sandbox environment and its scoped resources
- sbx env run - Create (if needed) and attach to a sandbox environment
30 changes: 30 additions & 0 deletions data/sbx_cli/sbx_env_create.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: sbx env create
synopsis: Create a sandbox environment from .sbxenv.yaml
experimental: true
description: |-
Read the environment file from PATH (default: current directory),
provision its declared secrets at the sandbox scope, merge its credential
bindings, and create the sandbox. Use "sbx env run" to attach.

Each PATH may be a directory (the file is <PATH>/.sbxenv.yaml) or the
path to the environment file itself. Passing more than one PATH deep-merges them
in order (docker-compose `-f` semantics): later files override earlier ones.
Values may reference environment variables with ${VAR} / $VAR (and
${VAR:-default}); see the docs for the full syntax.
usage: sbx env create [PATH...] [flags]
options:
- name: clone
default_value: "false"
usage: |
Override workspace.clone in .sbxenv.yaml (see 'sbx create --clone')
- name: help
shorthand: h
default_value: "false"
usage: help for create
inherited_options:
- name: debug
shorthand: D
default_value: "false"
usage: Enable debug logging
see_also:
- sbx env - (Experimental) Manage sandboxes declaratively from a .sbxenv.yaml file
68 changes: 68 additions & 0 deletions data/sbx_cli/sbx_env_exec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: sbx env exec
synopsis: Execute a command inside a sandbox environment
experimental: true
description: |-
Run COMMAND in the sandbox declared in .sbxenv.yaml. The sandbox
must already exist (see "sbx env create" and "sbx env run"); a stopped sandbox is
started first.

Arguments before `--` are environment-file paths, following the same rules as
the other "sbx env" subcommands: each PATH may be a directory (the file is
<PATH>/.sbxenv.yaml) or the path to the environment file itself, and passing
more than one deep-merges them in order. Without a `--` every positional
argument forms the command and the environment file is read from the current
directory.

Flags match the behavior of "sbx exec".
usage: sbx env exec [flags] [PATH...] -- COMMAND [ARG...]
options:
- name: detach
shorthand: d
default_value: "false"
usage: 'Detached mode: run command in the background'
- name: detach-keys
usage: Override the key sequence for detaching a container
- name: env
shorthand: e
default_value: '[]'
usage: Set environment variables
- name: env-file
default_value: '[]'
usage: Read in a file of environment variables
- name: help
shorthand: h
default_value: "false"
usage: help for exec
- name: interactive
shorthand: i
default_value: "false"
usage: Keep STDIN open even if not attached
- name: privileged
default_value: "false"
usage: Give extended privileges to the command
- name: tty
shorthand: t
default_value: "false"
usage: Allocate a pseudo-TTY
- name: user
shorthand: u
usage: 'Username or UID (format: <name|uid>[:<group|gid>])'
- name: workdir
shorthand: w
usage: Working directory inside the container
inherited_options:
- name: debug
shorthand: D
default_value: "false"
usage: Enable debug logging
example: |4-
# Run a command in the environment declared in the current directory
sbx env exec go test ./...

# Open a shell
sbx env exec -it -- bash

# Run against explicitly merged environment files
sbx env exec .sbxenv.yaml override.yaml -- npm test
see_also:
- sbx env - (Experimental) Manage sandboxes declaratively from a .sbxenv.yaml file
35 changes: 35 additions & 0 deletions data/sbx_cli/sbx_env_rm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: sbx env rm
synopsis: Remove a sandbox environment and its scoped resources
experimental: true
description: |-
Remove the sandbox declared in .sbxenv.yaml along with the
secret values provisioned at its sandbox scope (service, custom, and registry
credentials). Global credential bindings are left in place by default since
they are user-wide and may be shared with other sandboxes; pass
--prune-bindings to also remove the bindings this environment declares.

Each PATH may be a directory (the file is <PATH>/.sbxenv.yaml) or the
path to the environment file itself. Passing more than one PATH deep-merges them
in order (docker-compose `-f` semantics), so the same set used to create the
environment resolves to the same sandbox on removal.
usage: sbx env rm [PATH...] [flags]
options:
- name: force
shorthand: f
default_value: "false"
usage: Skip confirmation prompts
- name: help
shorthand: h
default_value: "false"
usage: help for rm
- name: prune-bindings
default_value: "false"
usage: |
Also remove this environment's bindings from the global credentials.yaml
inherited_options:
- name: debug
shorthand: D
default_value: "false"
usage: Enable debug logging
see_also:
- sbx env - (Experimental) Manage sandboxes declaratively from a .sbxenv.yaml file
35 changes: 35 additions & 0 deletions data/sbx_cli/sbx_env_run.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: sbx env run
synopsis: Create (if needed) and attach to a sandbox environment
experimental: true
description: |-
Read the environment file from PATH (default: current directory)
and drop into the sandbox shell. If the sandbox already exists it is started
and re-attached without re-provisioning; otherwise it is created first
(provisioning secrets and bindings) and then attached.

Each PATH may be a directory (the file is <PATH>/.sbxenv.yaml) or the
path to the environment file itself. Passing more than one PATH deep-merges them
in order (docker-compose `-f` semantics): later files override earlier ones.
Values may reference environment variables with ${VAR} / $VAR (and
${VAR:-default}); see the docs for the full syntax.
usage: sbx env run [PATH...] [flags]
options:
- name: clone
default_value: "false"
usage: |
Override workspace.clone in .sbxenv.yaml (see 'sbx create --clone')
- name: detached
shorthand: d
default_value: "false"
usage: Create/start the sandbox without attaching
- name: help
shorthand: h
default_value: "false"
usage: help for run
inherited_options:
- name: debug
shorthand: D
default_value: "false"
usage: Enable debug logging
see_also:
- sbx env - (Experimental) Manage sandboxes declaratively from a .sbxenv.yaml file