[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EMYQZXA60B14ZQEXMSWNVG":3,"skill-same:01M7EMYQZXA60B14ZQEXMSWNVG":72},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":13,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":29,"install":30,"resources":43},"01M7EMYQZXA60B14ZQEXMSWNVG","docker-sandboxes-env",null,"Use this skill when authoring, planning, or running a declarative `sbxenv.yaml` file for Docker Sandboxes (`sbx env create\u002Frun\u002Fplan\u002Fexec\u002Frm`), even if the user just says they want to \"check in a sandbox config\", \"make onboarding reproducible for a sandbox\", \"run a setup script before the agent starts\", or \"define arguments for a shared sandbox environment\". Covers the sbxenv.yaml schema (schemaVersion, agent, kits, workspace\u002FadditionalWorkspaces, args, env, secrets, registries, bindings, mcp, ports, sandboxOptions), host `lifecycle:` commands (initialize\u002FpostCreate\u002FpreRemove) and their approval-plan model, multi-file merge (`-f`-style deep merge and the user-level `.sbxenv.yaml` base layer), and file-write-protection (`sandboxOptions.writableEnvFiles`).","Rainbow609\u002Fagent-skills","Rainbow609","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F101709481?v=4","01M7EMQ6CNBNP7TVFZ4Z63RZXD","01M7EMQ6ENV4B0Y542WKXNZBSM",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002FRainbow609\u002Fagent-skills\u002Fblob\u002Fmain\u002Fupstream\u002Fdocker\u002Fskills\u002Fdocker-sandboxes-env\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: docker-sandboxes-env\ndescription: Use this skill when authoring, planning, or running a declarative `sbxenv.yaml` file for Docker Sandboxes (`sbx env create\u002Frun\u002Fplan\u002Fexec\u002Frm`), even if the user just says they want to \"check in a sandbox config\", \"make onboarding reproducible for a sandbox\", \"run a setup script before the agent starts\", or \"define arguments for a shared sandbox environment\". Covers the sbxenv.yaml schema (schemaVersion, agent, kits, workspace\u002FadditionalWorkspaces, args, env, secrets, registries, bindings, mcp, ports, sandboxOptions), host `lifecycle:` commands (initialize\u002FpostCreate\u002FpreRemove) and their approval-plan model, multi-file merge (`-f`-style deep merge and the user-level `.sbxenv.yaml` base layer), and file-write-protection (`sandboxOptions.writableEnvFiles`).\nlicense: Apache-2.0\ncompatibility: Requires standalone sbx with sbx env support and sbxenv.yaml schemaVersion \"1\", not the legacy docker sandbox wrapper. Verified against docker\u002Fsandboxes df5c96ba60484fa2c375469dbac912c205da6c37; installed-help version and provenance are in references\u002Fsources.md. docker_help does not cover standalone sbx.\n---\n\n# Docker Sandboxes: Declarative sbxenv.yaml Environments\n\n## Overview\n\n`sbxenv.yaml` (schemaVersion `\"1\"`, EXPERIMENTAL) declaratively describes one\nsandbox environment — agent, mixin kits, workspace mounts, environment\nvariables, secrets\u002Fregistries\u002Fbindings to provision, MCP servers, ports, and\nhost-side lifecycle commands — so `sbx env create|run|plan|exec|rm` can stand\nit up and tear it down reproducibly instead of a long flag invocation. This\nskill owns that file format end to end. It delegates the sandbox lifecycle\nsemantics it wraps, the credential\u002Fnetwork model it provisions into, and the\nkit schema its `kits:` entries reference, to their own skills.\n\n## When to use this skill\n\nActivate this skill when:\n- The user wants a checked-in, reproducible definition of a sandbox\n  environment instead of a long `sbx create`\u002F`sbx run` command line.\n- The user wants host-side setup\u002Fteardown commands (cloning a repo, seeding\n  fixtures, archiving state) tied to a sandbox's create\u002Fattach\u002Fremove\n  lifecycle.\n- The user wants to parameterize a shared environment file with named\n  arguments (`args:` + `--env-arg`).\n- The user is debugging why `sbx env create`\u002F`run` is asking for approval,\n  or why a file, kit, or secret it declares was skipped or flagged.\n\n## Do not use this skill when\n\nDo not use this skill when:\n- The task is the underlying `sbx create`\u002F`run`\u002F`rm` flag-based workflow with\n  no `sbxenv.yaml` file involved — use `docker-sandboxes-lifecycle`.\n- The task is choosing network policy or storing a secret\u002Fregistry\n  credential independent of any environment file — use\n  `docker-sandboxes-network-credentials` (this skill's `secrets:`\u002F\n  `registries:`\u002F`bindings:` blocks provision into that same store, but do not\n  redefine its rules here).\n- The task is authoring the kit `spec.yaml` a `kits:` entry points at — use\n  `docker-sandboxes-kits`.\n\n## Core guidance\n\n### File resolution and required fields\n\n- The file `sbx env` reads from a directory is exactly `sbxenv.yaml` — no\n  other name, and a directory-named `.sbxenv.yaml` at the project level is\n  **not** read as a project's own file (only the home-directory base layer\n  uses that hidden name; see below).\n- Every environment file requires `schemaVersion: \"1\"` and `agent:` (a\n  built-in agent name or the manifest name of an agent kit supplied via\n  `kits:`). Everything else is optional. `agent: shell` needs no credentials\n  and is the simplest way to validate a file's mechanics.\n- `sbx env create|run|plan|exec|rm` accept one or more `PATH` arguments.\n  Each `PATH` is either a directory (resolved to `\u003CPATH>\u002Fsbxenv.yaml`) or the\n  file itself. Passing more than one deep-merges them in declaration order —\n  **`docker compose -f`-style semantics**: later files override earlier ones,\n  mappings merge key-by-key, sequences concatenate.\n  ```bash\n  sbx env create sbxenv.yaml override.yaml\n  ```\n\n### Naming, workspace, and the `.sbxenv.yaml` user base layer\n\n- Unless the file sets `name:` or `--name` overrides it, the sandbox is\n  named after the mounted directory (or the project directory when nothing\n  is mounted) — so an environment that mounts nothing is still the same\n  sandbox every time it is applied. **Two different environment files in the\n  same directory derive the same sandbox name and collide** unless each sets\n  its own `name:` (or you pass a distinct `--name` per invocation) — always\n  give each environment its own explicit `name:` when more than one may\n  exist in the same directory.\n- `workspace:` names the read\u002Fwrite mount, exactly like `sbx create`'s\n  omitted-path behavior: **omitting `workspace:` mounts nothing** at all.\n  A relative `workspace:` path resolves against the **directory of the file\n  that declares it** — `workspace: .` mounts the directory the file sits\n  in. `${{ env.projectDir }}` names the project directory (the one holding\n  the first `PATH`, or cwd when none is named); `${{ env.fileDir }}` names\n  the declaring file's own directory. Nothing else is expanded — a bare `$`\n  is literal text, so a value written for the container\n  (`PATH: $PATH:\u002Fopt\u002Fbin`) reaches it unchanged.\n  ```yaml\n  workspace: .                       # mounts the directory this file sits in\n  # workspace: ${{ env.projectDir }} # mounts the project directory explicitly\n  ```\n- Relative kit sources follow the same file-directory anchoring rule as\n  `workspace:` (see `docker-sandboxes-kits` for kit reference syntax).\n- **Files within a mounted workspace get default read-only masking, and that\n  protection is complete only when the file sits directly at the mount's own\n  root.** A read-only bind at the mount point cannot be renamed by the\n  sandbox — there is nothing above it inside the mount to rename. But an\n  environment file in a **subdirectory** of a read-write mount is protected\n  only at its current path: the sandbox can rename the containing directory\n  (which it can write to) and then recreate the original path itself,\n  landing a sandbox-controlled file back where the read-only bind no longer\n  applies. `sbx env plan` calls this gap out explicitly for a file that is\n  not at a mount's root. Do not claim renaming the containing directory\n  creates no gap — for anything but the mount root, it does.\n- With **no `PATH`** given, an `.sbxenv.yaml` in the **home directory** is\n  merged underneath as a base layer for defaults shared across projects;\n  naming any `PATH` skips this layer entirely. The base layer may not set\n  `name:` (which identifies one project) and its `workspace:` must be rooted\n  at `${{ env.projectDir }}` — any other value would mount one fixed\n  directory under every project that merges it.\n\n### `args:` — parameterizing a shared file\n\n- Declare named inputs under `args:`, each with a `default` (making it\n  optional, `default: \"\"` counts as a real default) or `required: true`\n  (mutually exclusive), plus optional `description`, `enum`, or `pattern`.\n- Reference one as `${{ env.args.NAME }}` anywhere a value appears in the\n  file, and supply it with `--env-arg NAME=VALUE` (repeatable) or\n  `--env-args-file PATH`.\n\n### `lifecycle:` — host commands and the approval plan\n\n- `lifecycle:` declares shell commands that run **on the host, outside the\n  sandbox, with your own privileges** — not inside the container. Three\n  phases, run in this order per invocation:\n  - **`initialize`** — runs on **every** `create` **and** `run`, including\n    one that only attaches to an existing sandbox. It is the one phase that\n    can produce what the environment needs to exist (a cloned workspace, a\n    generated file), so **it must be idempotent** — it reruns on every\n    reattach.\n  - **`postCreate`** — runs once, after the sandbox exists, before an\n    interactive attach takes the terminal.\n  - **`preRemove`** — runs before `sbx env rm` deletes the sandbox, while\n    `sbx env exec` can still reach it. **A failing `preRemove` is only a\n    warning** — the failure itself does not block removal. After the hook,\n    removal rechecks the approved destroy plan and sandbox identity. A new\n    credential or changed binding not covered by that approval, or a\n    replacement sandbox under the same name, stops removal before deletion.\n    Review the new destroy plan before retrying.\n  - `sbx env exec` **runs no lifecycle commands at all, and requires the\n    sandbox to already exist** — it does not create one. Run\n    `sbx env create`\u002F`sbx env run` first.\n  ```yaml\n  lifecycle:\n    initialize:\n      - command: test -d app || git clone https:\u002F\u002Fgithub.com\u002Facme\u002Fapp\n    postCreate:\n      - command: .\u002Fscripts\u002Fseed-fixtures.sh\n    preRemove:\n      - command: .\u002Fscripts\u002Farchive-state.sh\n  ```\n- Every command runs through the shell from the **project directory** by\n  default (override per-command with `workdir:`; bound its runtime with\n  `timeout:`).\n- **A file that declares any lifecycle command is asked about on every\n  invocation that reaches it, whether or not this particular invocation\n  changed anything** — approving a command also trusts whatever it invokes,\n  including a script whose contents can change after the answer, so the\n  question is repeated rather than remembered by default. The one exception:\n  `sbx settings set env.rememberHostCommands true` makes it ask again only\n  when the commands actually change. **Never treat an untrusted file's or an\n  untrusted kit's lifecycle commands as pre-approved**, and never enable\n  `rememberHostCommands` for a file whose commands you have not reviewed. An\n  environment that declares **no** host commands at all, and whose config is\n  otherwise unchanged from what was last approved, applies silently with no\n  prompt. Use `--skip-host-commands` to run none of the declared commands\n  for one invocation.\n\n### The environment plan: what it is and is not\n\n- `sbx env plan [PATH...]` prints everything applying the file would set up\n  — host commands, credentials\u002Fbindings, MCP registrations, directories,\n  published ports, the sandbox itself, and its variables — compared against\n  what was last applied\u002Fapproved. **It changes nothing.**\n- `sbx env create`\u002F`sbx env run` show the same plan and require approval\n  before doing any work (`--auto-approve`\u002F`-y` skips the prompt for\n  non-interactive use — **never default to `-y` for a file or kit you have\n  not reviewed**). A secret's literal `value:` is the one field shown both\n  in the plan and recorded to state as a `sha256:` digest rather than in the\n  clear; a `ref:`\u002F`command:` secret shows where the credential comes from,\n  not its resolved value.\n\n### Secrets, registries, and bindings scoped to the environment\n\n- `secrets:` and `registries:` provision into the **same credential store**\n  `sbx secret set` uses, at this environment's **sandbox scope**, so\n  `sbx env rm` can remove exactly what it created. Each entry uses the same\n  `value`\u002F`ref`\u002F`command` shape as `sbx secret set` (exactly one of the\n  three) — see `docker-sandboxes-network-credentials` for what those mean at\n  runtime and why a literal secret value should not otherwise appear in a\n  checked-in file.\n- `bindings:` are per-service credential bindings merged into the user's\n  **global** `credentials.yaml`; unlike `secrets:`\u002F`registries:`, they are\n  **left in place by default** by `sbx env rm` (they are user-wide and may\n  be shared with other sandboxes\u002Fenvironments) — pass `--prune-bindings` to\n  also remove them.\n- **Never write a literal secret value directly into a checked-in\n  `sbxenv.yaml`.** Use `ref:` (1Password\u002FAWS Secrets Manager) or `command:`\n  so the value never lives in the file at all; if a literal `value:` is used\n  transiently, both the plan and state show only its digest, but the\n  original environment file still contains the plaintext secret. See the labeled `secrets:` fragment below for the\n  shape — it is intentionally not part of the minimal asset, which needs no\n  credentials at all to validate.\n  ```yaml\n  # OPTIONAL fragment — add only if this environment actually needs a\n  # credential; the minimal asset omits this entirely.\n  secrets:\n    anthropic:\n      ref: op:\u002F\u002FPrivate\u002FAnthropic\u002Fapi-key   # never a literal `value:` in a checked-in file\n      refresh: 55m\n  ```\n\n### `kits:`, `additionalWorkspaces:`, `mcp:`, `ports:`, and `sandboxOptions:`\n\n- `kits:` composes mixin kits (and, exactly once, an agent kit whose name\n  matches `agent:`) onto the base agent; a relative source anchors to the\n  **declaring file's own directory**, the same rule as `workspace:`.\n- `additionalWorkspaces:` mounts extra directories beyond the primary\n  `workspace:` (a file cannot declare one without the other) — the\n  `sbxenv.yaml` equivalent of `sbx run`'s extra positional workspace\n  arguments with `:ro`.\n- `mcp.servers:` registers MCP servers on the host and adds them to the\n  sandbox's fixed (static) MCP set at create time; registrations are\n  host-global and **left in place** by `sbx env rm`.\n- `ports:` pins explicit host-port bindings for container ports the\n  sandbox exposes — the equivalent of `sbx ports --publish` — and is torn\n  down automatically when `sbx env rm` deletes the sandbox.\n- `sandboxOptions:` (beyond `writableEnvFiles`, below) maps onto the\n  remaining `sbx create` flags: `template`, `memory`, `cpus`,\n  `pullPolicy`, `profile`, `skills`.\n\nSee `references\u002Fenv-schema-fields.md` for the exact field shapes, required\nkeys, and a YAML example for each of the five blocks above.\n\n### `sandboxOptions.writableEnvFiles` — a deliberate, explicit downgrade\n\n- By default, **every environment file mounted inside the workspace is\n  read-only at its own path**, even though the rest of the mount is\n  writable. This stops an agent editing the very file that decides what\n  host lifecycle commands and secret-resolving commands run on your machine\n  on the next invocation.\n- Set `sandboxOptions.writableEnvFiles: true` only where an agent is\n  deliberately meant to edit its own environment file. This is a real\n  security downgrade — the plan then reports the file as writable — so\n  treat it the same as any other explicit trust decision, not a default.\n- **The protection is complete only at a mount's own root.** A file placed\n  directly at the root of a read-write mount cannot be reached even by\n  renaming, because the sandbox cannot rename the mount point itself. A file\n  in a subdirectory of that mount is a different case: it is read-only at\n  its current path, but the sandbox can rename the directory holding it\n  (which it can write to) and recreate a file at the original path, ending\n  up with a sandbox-controlled file there. `sbx env plan` flags this gap for\n  a file that is not directly at a mount's root — read the plan's output\n  rather than assuming renaming is always harmless.\n\n## Related skills\n\n- For the `sbx create`\u002F`run`\u002F`rm` flag-based workflow this file wraps, use\n  `docker-sandboxes-lifecycle`.\n- For what `secrets:`\u002F`registries:`\u002F`bindings:` mean at runtime, and for\n  configuring network policy independent of any environment file, use\n  `docker-sandboxes-network-credentials`.\n- For the schema of the kit `spec.yaml` a `kits:` entry (or `agent:`\n  pointing at an agent kit) references, use `docker-sandboxes-kits`.\n\n## References\n\n- `references\u002Fsources.md` — provenance for every rule above (help captures, source paths, docs URLs).\n- `references\u002Fenv-schema-fields.md` — exact field shapes and YAML examples for `kits:`, `additionalWorkspaces:`, `mcp:`, `ports:`, and `sandboxOptions:`.\n\n## Assets\n\n- `assets\u002Fsbxenv.yaml` — a complete, minimal, safe example: a `shell` agent\n  mounting the declaring file's own directory, one static env var, and no\n  credentials at all — it validates and plans without any onboarding\n  authentication.\n\n## Checks\n\n- `checks\u002Fverification.md` — Verification runbook for sbxenv.yaml commands (unexecuted runbook; run manually with an isolated, uniquely-named `--app-name`, never with real secret values or untrusted lifecycle commands auto-approved).\n","# Docker Sandboxes: Declarative sbxenv.yaml Environments\n\n## Overview\n\n`sbxenv.yaml` (schemaVersion `\"1\"`, EXPERIMENTAL) declaratively describes one\nsandbox environment — agent, mixin kits, workspace mounts, environment\nvariables, secrets\u002Fregistries\u002Fbindings to provision, MCP servers, ports, and\nhost-side lifecycle commands — so `sbx env create|run|plan|exec|rm` can stand\nit up and tear it down reproducibly instead of a long flag invocation. This\nskill owns that file format end to end. It delegates the sandbox lifecycle\nsemantics it wraps, the credential\u002Fnetwork model it provisions into, and the\nkit schema its `kits:` entries reference, to their own skills.\n\n## When to use this skill\n\nActivate this skill when:\n- The user wants a checked-in, reproducible definition of a sandbox\n  environment instead of a long `sbx create`\u002F`sbx run` command line.\n- The user wants host-side setup\u002Fteardown commands (cloning a repo, seeding\n  fixtures, archiving state) tied to a sandbox's create\u002Fattach\u002Fremove\n  lifecycle.\n- The user wants to parameterize a shared environment file with named\n  arguments (`args:` + `--env-arg`).\n- The user is debugging why `sbx env create`\u002F`run` is asking for approval,\n  or why a file, kit, or secret it declares was skipped or flagged.\n\n## Do not use this skill when\n\nDo not use this skill when:\n- The task is the underlying `sbx create`\u002F`run`\u002F`rm` flag-based workflow with\n  no `sbxenv.yaml` file involved — use `docker-sandboxes-lifecycle`.\n- The task is choosing network policy or storing a secret\u002Fregistry\n  credential independent of any environment file — use\n  `docker-sandboxes-network-credentials` (this skill's `secrets:`\u002F\n  `registries:`\u002F`bindings:` blocks provision into that same store, but do not\n  redefine its rules here).\n- The task is authoring the kit `spec.yaml` a `kits:` entry points at — use\n  `docker-sandboxes-kits`.\n\n## Core guidance\n\n### File resolution and required fields\n\n- The file `sbx env` reads from a directory is exactly `sbxenv.yaml` — no\n  other name, and a directory-named `.sbxenv.yaml` at the project level is\n  **not** read as a project's own file (only the home-directory base layer\n  uses that hidden name; see below).\n- Every environment file requires `schemaVersion: \"1\"` and `agent:` (a\n  built-in agent name or the manifest name of an agent kit supplied via\n  `kits:`). Everything else is optional. `agent: shell` needs no credentials\n  and is the simplest way to validate a file's mechanics.\n- `sbx env create|run|plan|exec|rm` accept one or more `PATH` arguments.\n  Each `PATH` is either a directory (resolved to `\u003CPATH>\u002Fsbxenv.yaml`) or the\n  file itself. Passing more than one deep-merges them in declaration order —\n  **`docker compose -f`-style semantics**: later files override earlier ones,\n  mappings merge key-by-key, sequences concatenate.\n  ```bash\n  sbx env create sbxenv.yaml override.yaml\n  ```\n\n### Naming, workspace, and the `.sbxenv.yaml` user base layer\n\n- Unless the file sets `name:` or `--name` overrides it, the sandbox is\n  named after the mounted directory (or the project directory when nothing\n  is mounted) — so an environment that mounts nothing is still the same\n  sandbox every time it is applied. **Two different environment files in the\n  same directory derive the same sandbox name and collide** unless each sets\n  its own `name:` (or you pass a distinct `--name` per invocation) — always\n  give each environment its own explicit `name:` when more than one may\n  exist in the same directory.\n- `workspace:` names the read\u002Fwrite mount, exactly like `sbx create`'s\n  omitted-path behavior: **omitting `workspace:` mounts nothing** at all.\n  A relative `workspace:` path resolves against the **directory of the file\n  that declares it** — `workspace: .` mounts the directory the file sits\n  in. `${{ env.projectDir }}` names the project directory (the one holding\n  the first `PATH`, or cwd when none is named); `${{ env.fileDir }}` names\n  the declaring file's own directory. Nothing else is expanded — a bare `$`\n  is literal text, so a value written for the container\n  (`PATH: $PATH:\u002Fopt\u002Fbin`) reaches it unchanged.\n  ```yaml\n  workspace: .                       # mounts the directory this file sits in\n  # workspace: ${{ env.projectDir }} # mounts the project directory explicitly\n  ```\n- Relative kit sources follow the same file-directory anchoring rule as\n  `workspace:` (see `docker-sandboxes-kits` for kit reference syntax).\n- **Files within a mounted workspace get default read-only masking, and that\n  protection is complete only when the file sits directly at the mount's own\n  root.** A read-only bind at the mount point cannot be renamed by the\n  sandbox — there is nothing above it inside the mount to rename. But an\n  environment file in a **subdirectory** of a read-write mount is protected\n  only at its current path: the sandbox can rename the containing directory\n  (which it can write to) and then recreate the original path itself,\n  landing a sandbox-controlled file back where the read-only bind no longer\n  applies. `sbx env plan` calls this gap out explicitly for a file that is\n  not at a mount's root. Do not claim renaming the containing directory\n  creates no gap — for anything but the mount root, it does.\n- With **no `PATH`** given, an `.sbxenv.yaml` in the **home directory** is\n  merged underneath as a base layer for defaults shared across projects;\n  naming any `PATH` skips this layer entirely. The base layer may not set\n  `name:` (which identifies one project) and its `workspace:` must be rooted\n  at `${{ env.projectDir }}` — any other value would mount one fixed\n  directory under every project that merges it.\n\n### `args:` — parameterizing a shared file\n\n- Declare named inputs under `args:`, each with a `default` (making it\n  optional, `default: \"\"` counts as a real default) or `required: true`\n  (mutually exclusive), plus optional `description`, `enum`, or `pattern`.\n- Reference one as `${{ env.args.NAME }}` anywhere a value appears in the\n  file, and supply it with `--env-arg NAME=VALUE` (repeatable) or\n  `--env-args-file PATH`.\n\n### `lifecycle:` — host commands and the approval plan\n\n- `lifecycle:` declares shell commands that run **on the host, outside the\n  sandbox, with your own privileges** — not inside the container. Three\n  phases, run in this order per invocation:\n  - **`initialize`** — runs on **every** `create` **and** `run`, including\n    one that only attaches to an existing sandbox. It is the one phase that\n    can produce what the environment needs to exist (a cloned workspace, a\n    generated file), so **it must be idempotent** — it reruns on every\n    reattach.\n  - **`postCreate`** — runs once, after the sandbox exists, before an\n    interactive attach takes the terminal.\n  - **`preRemove`** — runs before `sbx env rm` deletes the sandbox, while\n    `sbx env exec` can still reach it. **A failing `preRemove` is only a\n    warning** — the failure itself does not block removal. After the hook,\n    removal rechecks the approved destroy plan and sandbox identity. A new\n    credential or changed binding not covered by that approval, or a\n    replacement sandbox under the same name, stops removal before deletion.\n    Review the new destroy plan before retrying.\n  - `sbx env exec` **runs no lifecycle commands at all, and requires the\n    sandbox to already exist** — it does not create one. Run\n    `sbx env create`\u002F`sbx env run` first.\n  ```yaml\n  lifecycle:\n    initialize:\n      - command: test -d app || git clone https:\u002F\u002Fgithub.com\u002Facme\u002Fapp\n    postCreate:\n      - command: .\u002Fscripts\u002Fseed-fixtures.sh\n    preRemove:\n      - command: .\u002Fscripts\u002Farchive-state.sh\n  ```\n- Every command runs through the shell from the **project directory** by\n  default (override per-command with `workdir:`; bound its runtime with\n  `timeout:`).\n- **A file that declares any lifecycle command is asked about on every\n  invocation that reaches it, whether or not this particular invocation\n  changed anything** — approving a command also trusts whatever it invokes,\n  including a script whose contents can change after the answer, so the\n  question is repeated rather than remembered by default. The one exception:\n  `sbx settings set env.rememberHostCommands true` makes it ask again only\n  when the commands actually change. **Never treat an untrusted file's or an\n  untrusted kit's lifecycle commands as pre-approved**, and never enable\n  `rememberHostCommands` for a file whose commands you have not reviewed. An\n  environment that declares **no** host commands at all, and whose config is\n  otherwise unchanged from what was last approved, applies silently with no\n  prompt. Use `--skip-host-commands` to run none of the declared commands\n  for one invocation.\n\n### The environment plan: what it is and is not\n\n- `sbx env plan [PATH...]` prints everything applying the file would set up\n  — host commands, credentials\u002Fbindings, MCP registrations, directories,\n  published ports, the sandbox itself, and its variables — compared against\n  what was last applied\u002Fapproved. **It changes nothing.**\n- `sbx env create`\u002F`sbx env run` show the same plan and require approval\n  before doing any work (`--auto-approve`\u002F`-y` skips the prompt for\n  non-interactive use — **never default to `-y` for a file or kit you have\n  not reviewed**). A secret's literal `value:` is the one field shown both\n  in the plan and recorded to state as a `sha256:` digest rather than in the\n  clear; a `ref:`\u002F`command:` secret shows where the credential comes from,\n  not its resolved value.\n\n### Secrets, registries, and bindings scoped to the environment\n\n- `secrets:` and `registries:` provision into the **same credential store**\n  `sbx secret set` uses, at this environment's **sandbox scope**, so\n  `sbx env rm` can remove exactly what it created. Each entry uses the same\n  `value`\u002F`ref`\u002F`command` shape as `sbx secret set` (exactly one of the\n  three) — see `docker-sandboxes-network-credentials` for what those mean at\n  runtime and why a literal secret value should not otherwise appear in a\n  checked-in file.\n- `bindings:` are per-service credential bindings merged into the user's\n  **global** `credentials.yaml`; unlike `secrets:`\u002F`registries:`, they are\n  **left in place by default** by `sbx env rm` (they are user-wide and may\n  be shared with other sandboxes\u002Fenvironments) — pass `--prune-bindings` to\n  also remove them.\n- **Never write a literal secret value directly into a checked-in\n  `sbxenv.yaml`.** Use `ref:` (1Password\u002FAWS Secrets Manager) or `command:`\n  so the value never lives in the file at all; if a literal `value:` is used\n  transiently, both the plan and state show only its digest, but the\n  original environment file still contains the plaintext secret. See the labeled `secrets:` fragment below for the\n  shape — it is intentionally not part of the minimal asset, which needs no\n  credentials at all to validate.\n  ```yaml\n  # OPTIONAL fragment — add only if this environment actually needs a\n  # credential; the minimal asset omits this entirely.\n  secrets:\n    anthropic:\n      ref: op:\u002F\u002FPrivate\u002FAnthropic\u002Fapi-key   # never a literal `value:` in a checked-in file\n      refresh: 55m\n  ```\n\n### `kits:`, `additionalWorkspaces:`, `mcp:`, `ports:`, and `sandboxOptions:`\n\n- `kits:` composes mixin kits (and, exactly once, an agent kit whose name\n  matches `agent:`) onto the base agent; a relative source anchors to the\n  **declaring file's own directory**, the same rule as `workspace:`.\n- `additionalWorkspaces:` mounts extra directories beyond the primary\n  `workspace:` (a file cannot declare one without the other) — the\n  `sbxenv.yaml` equivalent of `sbx run`'s extra positional workspace\n  arguments with `:ro`.\n- `mcp.servers:` registers MCP servers on the host and adds them to the\n  sandbox's fixed (static) MCP set at create time; registrations are\n  host-global and **left in place** by `sbx env rm`.\n- `ports:` pins explicit host-port bindings for container ports the\n  sandbox exposes — the equivalent of `sbx ports --publish` — and is torn\n  down automatically when `sbx env rm` deletes the sandbox.\n- `sandboxOptions:` (beyond `writableEnvFiles`, below) maps onto the\n  remaining `sbx create` flags: `template`, `memory`, `cpus`,\n  `pullPolicy`, `profile`, `skills`.\n\nSee `references\u002Fenv-schema-fields.md` for the exact field shapes, required\nkeys, and a YAML example for each of the five blocks above.\n\n### `sandboxOptions.writableEnvFiles` — a deliberate, explicit downgrade\n\n- By default, **every environment file mounted inside the workspace is\n  read-only at its own path**, even though the rest of the mount is\n  writable. This stops an agent editing the very file that decides what\n  host lifecycle commands and secret-resolving commands run on your machine\n  on the next invocation.\n- Set `sandboxOptions.writableEnvFiles: true` only where an agent is\n  deliberately meant to edit its own environment file. This is a real\n  security downgrade — the plan then reports the file as writable — so\n  treat it the same as any other explicit trust decision, not a default.\n- **The protection is complete only at a mount's own root.** A file placed\n  directly at the root of a read-write mount cannot be reached even by\n  renaming, because the sandbox cannot rename the mount point itself. A file\n  in a subdirectory of that mount is a different case: it is read-only at\n  its current path, but the sandbox can rename the directory holding it\n  (which it can write to) and recreate a file at the original path, ending\n  up with a sandbox-controlled file there. `sbx env plan` flags this gap for\n  a file that is not directly at a mount's root — read the plan's output\n  rather than assuming renaming is always harmless.\n\n## Related skills\n\n- For the `sbx create`\u002F`run`\u002F`rm` flag-based workflow this file wraps, use\n  `docker-sandboxes-lifecycle`.\n- For what `secrets:`\u002F`registries:`\u002F`bindings:` mean at runtime, and for\n  configuring network policy independent of any environment file, use\n  `docker-sandboxes-network-credentials`.\n- For the schema of the kit `spec.yaml` a `kits:` entry (or `agent:`\n  pointing at an agent kit) references, use `docker-sandboxes-kits`.\n\n## References\n\n- `references\u002Fsources.md` — provenance for every rule above (help captures, source paths, docs URLs).\n- `references\u002Fenv-schema-fields.md` — exact field shapes and YAML examples for `kits:`, `additionalWorkspaces:`, `mcp:`, `ports:`, and `sandboxOptions:`.\n\n## Assets\n\n- `assets\u002Fsbxenv.yaml` — a complete, minimal, safe example: a `shell` agent\n  mounting the declaring file's own directory, one static env var, and no\n  credentials at all — it validates and plans without any onboarding\n  authentication.\n\n## Checks\n\n- `checks\u002Fverification.md` — Verification runbook for sbxenv.yaml commands (unexecuted runbook; run manually with an isolated, uniquely-named `--app-name`, never with real secret values or untrusted lifecycle commands auto-approved).\n",{"name":5,"license":14,"description":7,"compatibility":23},"Requires standalone sbx with sbx env support and sbxenv.yaml schemaVersion \"1\", not the legacy docker sandbox wrapper. Verified against docker\u002Fsandboxes df5c96ba60484fa2c375469dbac912c205da6c37; installed-help version and provenance are in references\u002Fsources.md. docker_help does not cover standalone sbx.","main","18e26686a1432c54293deba762caad02ba886925","upstream\u002Fdocker\u002Fskills\u002Fdocker-sandboxes-env","https:\u002F\u002Fgithub.com\u002FRainbow609\u002Fagent-skills","https:\u002F\u002Fgithub.com\u002FRainbow609","2026-11-15 11:39:03",{"source":8,"skillName":5,"commands":31,"prompt":41,"zipAvailable":42},[32,35,38],{"tool":33,"command":34},"npx","npx skills add Rainbow609\u002Fagent-skills --skill docker-sandboxes-env",{"tool":36,"command":37},"bunx","bunx skills add Rainbow609\u002Fagent-skills --skill docker-sandboxes-env",{"tool":39,"command":40},"pnpm","pnpm dlx skills add Rainbow609\u002Fagent-skills --skill docker-sandboxes-env","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FRainbow609\u002Fagent-skills\u002Fblob\u002Fmain\u002Fupstream\u002Fdocker\u002Fskills\u002Fdocker-sandboxes-env\u002FSKILL.md",true,[44,50,56,60,64,68],{"path":45,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":48,"sourceHtmlUrl":49},"agents\u002Fopenai.yaml","REFERENCE","参考文档",428,"https:\u002F\u002Fgithub.com\u002FRainbow609\u002Fagent-skills\u002Fblob\u002Fmain\u002Fupstream\u002Fdocker\u002Fskills\u002Fdocker-sandboxes-env\u002Fagents\u002Fopenai.yaml",{"path":51,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":54,"sourceHtmlUrl":55},"assets\u002Fsbxenv.yaml","ASSET","资产文件",286,"https:\u002F\u002Fgithub.com\u002FRainbow609\u002Fagent-skills\u002Fblob\u002Fmain\u002Fupstream\u002Fdocker\u002Fskills\u002Fdocker-sandboxes-env\u002Fassets\u002Fsbxenv.yaml",{"path":57,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":58,"sourceHtmlUrl":59},"checks\u002Fverification.md",4688,"https:\u002F\u002Fgithub.com\u002FRainbow609\u002Fagent-skills\u002Fblob\u002Fmain\u002Fupstream\u002Fdocker\u002Fskills\u002Fdocker-sandboxes-env\u002Fchecks\u002Fverification.md",{"path":61,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":62,"sourceHtmlUrl":63},"references\u002Fenv-schema-fields.md",3654,"https:\u002F\u002Fgithub.com\u002FRainbow609\u002Fagent-skills\u002Fblob\u002Fmain\u002Fupstream\u002Fdocker\u002Fskills\u002Fdocker-sandboxes-env\u002Freferences\u002Fenv-schema-fields.md",{"path":65,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":66,"sourceHtmlUrl":67},"references\u002Fsources.md",7325,"https:\u002F\u002Fgithub.com\u002FRainbow609\u002Fagent-skills\u002Fblob\u002Fmain\u002Fupstream\u002Fdocker\u002Fskills\u002Fdocker-sandboxes-env\u002Freferences\u002Fsources.md",{"path":69,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":70,"sourceHtmlUrl":71},"skill.yaml",1280,"https:\u002F\u002Fgithub.com\u002FRainbow609\u002Fagent-skills\u002Fblob\u002Fmain\u002Fupstream\u002Fdocker\u002Fskills\u002Fdocker-sandboxes-env\u002Fskill.yaml",[73,82,90,97,104,111],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":77,"licenseFileUrl":78,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":18},"01M7EN4N53ENQWQE5NDRT64NDC","archify","Create validated architecture, workflow, sequence, data-flow, lifecycle\u002Fstate, entity-relationship, class\u002Finterface, tree, timeline, and execution waterfall diagrams as explorable standalone HTML with inline SVG, dark\u002Flight themes, optional motion, and image\u002FSVG\u002FWebM export. Accept plain-language requirements or Mermaid; inspect repository evidence for code-backed diagrams. Use when visualizing infrastructure, cloud\u002Fsecurity networks, API calls, data pipelines, ETL\u002FELT, state machines, database schemas, class contracts, module hierarchies, incident\u002Frelease histories, or request and agent-run timings. Also use for everyday subjects with steps, parts, relationships, or states: leave and travel plans, applications and approvals, renting conversations, money or document flows, and order progress. Not for numeric charts or dashboards.","MIT","https:\u002F\u002Fgithub.com\u002FRainbow609\u002Fagent-skills\u002Fblob\u002Fmain\u002Fupstream\u002Ftt-a1i\u002Farchify\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FRainbow609\u002Fagent-skills\u002Fblob\u002Fmain\u002Fupstream\u002Ftt-a1i\u002Farchify\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":77,"licenseFileUrl":86,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":18},"01M7EN4GGKJXFVK85685S30141","distilly","Set up the owner profile so a personal agent knows who it works for (first-run setup, \"get to know me\"), or distill colleague, relationship, or celebrity source material into reusable Person Profiles for agents.","https:\u002F\u002Fgithub.com\u002FRainbow609\u002Fagent-skills\u002Fblob\u002Fmain\u002Fupstream\u002Ftitanwings\u002Fdistilly\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FRainbow609\u002Fagent-skills\u002Fblob\u002Fmain\u002Fupstream\u002Ftitanwings\u002Fdistilly\u002FSKILL.md",[],[],{"skillNo":91,"name":92,"nameZh":6,"description":93,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":18},"01M7EMZQREVCNAJA9DY7NQ7M7Q","docker-sandboxes-network-credentials","Use this skill when configuring what a Docker Sandboxes (`sbx`) sandbox can reach on the network or which credentials it authenticates with, even if the user just says they want to \"let the agent call an internal API\", \"block all network access\", \"give the agent a GitHub token\", or \"use a private registry image for a sandbox\". Covers `sbx policy init\u002Fallow\u002Fdeny\u002Fls\u002Finspect\u002Flog\u002Fcheck\u002Frm network` (global and per-sandbox egress rules, deny-over-allow precedence) and `sbx secret set\u002Fset-custom\u002Fls\u002Frm\u002Fimport` (service secrets, dynamic secrets via --ref\u002F--command, and registry pull credentials with their host-pulls-only-by-default injection scope).","https:\u002F\u002Fgithub.com\u002FRainbow609\u002Fagent-skills\u002Fblob\u002Fmain\u002Fupstream\u002Fdocker\u002Fskills\u002Fdocker-sandboxes-network-credentials\u002FSKILL.md",[],[],{"skillNo":98,"name":99,"nameZh":6,"description":100,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":18},"01M7EMZE6V7A70RR2AMMDAGP3S","docker-sandboxes-lifecycle","Use this skill when creating, running, reattaching to, listing, stopping, or removing Docker Sandboxes (the standalone `sbx` CLI that runs AI coding agents in isolated microVMs), even if the user just says they want to \"run claude in a sandbox\", \"isolate an agent from my repo\", \"give an agent its own git clone\", or \"clean up old sandboxes\". Covers `sbx run`\u002F`sbx create` (including the built-in agents claude, codex, cursor, devin, docker-agent, gemini, opencode, shell), workspace bind-mount vs `--clone` isolation, additional read-only workspaces, reattaching by `--name`, `sbx ls`\u002F`stop`\u002F`rm`\u002F`prune`, `sbx exec`, `sbx cp`, and `sbx ports`.","https:\u002F\u002Fgithub.com\u002FRainbow609\u002Fagent-skills\u002Fblob\u002Fmain\u002Fupstream\u002Fdocker\u002Fskills\u002Fdocker-sandboxes-lifecycle\u002FSKILL.md",[],[],{"skillNo":105,"name":106,"nameZh":6,"description":107,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":108,"categories":109,"keywords":110,"publishedAt":18},"01M7EMZ2BN8Z7P5H557RS8WYP2","docker-sandboxes-kits","Use this skill when authoring, validating, packaging, signing, or composing a Docker Sandboxes kit `spec.yaml` (`sbx kit add\u002Finspect\u002Fpack\u002Fpull\u002Fpush\u002Fsign\u002Fvalidate\u002Fverify`), even if the user just says they want to \"add a tool to a sandbox agent\", \"build a reusable sandbox extension\", \"publish a kit to a registry\", or \"give a mixin its own credentials and network access\". Covers the kit-spec v2 grammar (`kind: sandbox` vs `kind: mixin`, the `sandbox:` block, `permissions.network`, `ports`, `credentials` apiKey\u002Foauth, `environment`, `setup` install\u002Fstartup\u002Ffiles, `volumes`, `args`, `extends`, `mixins`, `requires.agent`), composition via `--kit`\u002F`sbx kit add`, and distribution (pack\u002Fpush\u002Fpull\u002Fsign\u002Fverify\u002Fprovenance).","https:\u002F\u002Fgithub.com\u002FRainbow609\u002Fagent-skills\u002Fblob\u002Fmain\u002Fupstream\u002Fdocker\u002Fskills\u002Fdocker-sandboxes-kits\u002FSKILL.md",[],[],{"skillNo":112,"name":113,"nameZh":6,"description":114,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":115,"categories":116,"keywords":117,"publishedAt":18},"01M7EMYJMDPM8DNFM4F3RTKRCT","docker-project-foundations","Use this skill when setting up, initializing, or Dockerizing a project, even if the user doesn't explicitly mention Docker but describes a need for containerized local development, adding a database or cache dependency, or running services without host-level installs. Covers Dockerfile, compose.yaml, and .dockerignore creation with Docker best practices.","https:\u002F\u002Fgithub.com\u002FRainbow609\u002Fagent-skills\u002Fblob\u002Fmain\u002Fupstream\u002Fdocker\u002Fskills\u002Fdocker-project-foundations\u002FSKILL.md",[],[]]