Skip to content
Back to skills

Configuring The Jail

BSecurity

Configure the coding environment: add a permanent package or tool, set resources, ports, mounts, MCP/LSP, environment, or loophole policy. Not for one-off installs.

  • 6 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 4, 2026
ai-agentsrustgosqlexpressdockergitapibackend

Works with

  • terminal
  • cli
  • api
  • mcp

Security analysis

B84/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro shows the line behind each finding and how to fix it

Scanned December 5, 2026

npx -y skills add mschulkind-oss/yolo-jail --skill configuring-the-jail --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Configuring The Jail?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Configuring The Jail
[![Security: B — Skills Directory](https://www.skillsdirectory.com/api/skills/mschulkind-oss-configuring-the-jail/badge)](https://www.skillsdirectory.com/skills/mschulkind-oss-configuring-the-jail)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: configuring-the-jail
description: "Configure the coding environment: add a permanent package or tool, set resources, ports, mounts, MCP/LSP, environment, or loophole policy. Not for one-off installs."
---

# Configuring the environment

Use this when a change must be **baked into how the jail is built** so it
survives a restart: a package/runtime the project always needs, a resource
limit, a published port or mount, an MCP/LSP server, an env file, or a
request for something a loophole may do.

**Do NOT use this for one-off installs.** The jail has internet and you can
`npm i -g`, `pip install`, `uv pip install`, or `mise use` a tool right now with
no config change and no restart. Only change the config when the tool
must persist across restarts or be present for every future session.

Change it with a verb where one covers the key: `yolo config set <key> <value>`
(or `yolo config add <key> <value>` for a list), `yolo request <source> <capability>`
for a broker capability, `yolo pack add <name>` for a pack. They write the TOML
file (`yolo-jail.toml`) and validate the edit; hand-edit the file only for a key
no verb reaches, or in a workspace still on the legacy `yolo-jail.jsonc`.

## You already know the loop — here's what it leaves out

The always-on briefing already states the rule: **edit → `yolo config check`
→ fix any `[FAIL]` → then STOP and ask the human to run `yolo config apply` on
the host, in this workspace.** This is a fast, config-only check with no
persistent writes; selected-pack validation may stage privately under a temporary
directory. It is not a machine-readiness test. In a jail, host paths and mounts
cannot be verified, and a skipped fetched pack is not validated. `yolo check`
remains the broader readiness report. Approval is still required; this check
never approves a change. `yolo config apply` asks the human the same
question a launch does. Some changes apply at once: approved mounts under
`/ctx`, and the repositories gh may reach. Other changes wait for the next
restart. The command never restarts the jail.

### When the config file is read-only

If the project sets `workspace_readonly` at all, yolo also makes the workspace
config file **read-only inside the jail**, so an agent cannot edit its own
sandbox. Your briefing says so, and `yolo check` reports this broad readiness
condition. Then write out the exact edit and ask the human to apply it on the host,
run `yolo config check` there, and run `yolo config apply`; that command reports
whether the change takes effect live or remains pending for a restart. Do not route the
change through the local config file, an included file, or a new config file
beside the locked one: those are not locked, and using them to get round the
lock undoes the protection the human chose, and the config diff at the next
launch shows it to them.

### Rebuild vs. restart — which changes are slow

Most changes take effect on the **next restart** (config is re-read at launch).
Only changes to the **image package set** force a slower **image rebuild**
first, and there are exactly two ways to change that set:

- `install.nix` — nix packages built into the image.
- `gpu.vaapi: true` — but only when `gpu.enabled: true` and `gpu.vendor: "amd"`,
  which pulls `mesa` + `libva-utils` into the package set.

Everything else — `install.mise`, `resources`, `network`, `mounts`,
`mcp_servers`, `lsp_servers`, `env.files`, `packs` — is
restart-only, no rebuild. Prefer `install.mise` over `install.nix` for CLIs and
runtimes: it avoids the rebuild entirely. When you change the nix packages,
tell the user that the next start rebuilds the image.

No loophole has a switch: one runs whenever its pack is selected, and what it
may do is a grant (`yolo loopholes enable` and `disable` are retired and refuse).
Ask for a grant this project needs with `yolo request <pack> <kind>` (for
example `yolo request journal read`); the human approves it with
`yolo config apply` on the host, in this workspace. A kind their config does
not allow on request is theirs to allow for every project: give them
`yolo allow <pack> on_request <kind>`, alone on its own line, to run directly in
a host terminal. An allow is their own answer, so never wrap it in a
`yolo host-run` line. A brokered
loophole's read (the github pack's `github-broker`) is always the human's:
`yolo allow github read`. Don't write `loopholes.<name>.enabled` in the
workspace config; it is only a `[WARN]` in here but refuses the next host
launch. `yolo loopholes list` shows each kind's standing here.

Its repository list is the other way round: each repository is a `[repos.<name>]`
table, `repo = "github.com/OWNER/REPO"`, a workspace key you may write,
listing a repository the project has no remote for — or, with a whole-segment
wildcard, more than one: `*/*` is every repository the host login can reach,
`OWNER/*` is one owner's, and `*/REPO` is that name under any owner. Write it
with `yolo request repos <name> github.com/OWNER/REPO` (`yolo request git push <branch>` and
`yolo request git new_branches` are the same verb for git), which edits the
project's config; if it refuses because the file is read-only here, ask the human
to run the same command on the host. After it, run `yolo config check` and ask the human to run
`yolo config apply` on the host in this workspace. Its existing approval prompt
records the trust; a running broker that supports live scope takes the change
at its next request. When live scope is not available, the change remains pending for the next restart. The
command never restarts the jail or offers to do so.

### Which file — and how the layers merge

Three layers merge, later wins:

- `~/.config/yolo-jail/config.toml` — user/machine defaults.
- `<workspace>/yolo-jail.toml` — the committed per-project config. **Change this
  one** (with a verb where one covers the key) unless the human asks you not to, or unless it is read-only in here (see above:
  then propose the edit to the human instead).
- `<workspace>/yolo-jail.local.toml` — per-machine tweaks, auto-merged when
  present. Conventionally untracked, but yolo does not git-ignore it: run
  `git check-ignore yolo-jail.local.toml` before trusting it to stay out of a
  commit.

A workspace or user config not yet converted keeps its legacy name
(`yolo-jail.jsonc`, `yolo-jail.local.jsonc`, `~/.config/yolo-jail/config.jsonc`);
one format per scope, and `yolo config migrate` converts it. Either legacy
workspace file may be spelled `.json` instead (`yolo-jail.json`,
`yolo-jail.local.json`), which yolo reads only when the `.jsonc` name is absent.
Your briefing names the file this workspace uses. Edit that one: a new
`yolo-jail.jsonc` beside a `yolo-jail.json` is read in its place, and every key
in the `.json` file stops applying.

Merge edge cases that surprise people:

- Objects deep-merge; lists **union and de-dupe**.
- **`packs` is not in the merge at all — it is USER-SCOPE ONLY.** Which coding
  agent a jail gets is decided by `packs`, and that key is read from
  `~/.config/yolo-jail/config.toml` **directly**, never from the merged config
  (`yolo pack add <name>` writes it, on the host). A
  `packs` entry in the workspace config does nothing, and no amount of layering makes
  it work: workspace scope is inexpressible by construction rather than
  validated-against. The reason is the credential boundary — a pack can carry
  skills and briefing prose an agent then follows, and a workspace config travels
  with the repo and is agent-editable, so it must not be able to name content that
  enters the jail. If a project needs its own agent configuration it already has a
  git repo and can lay out whatever it likes in the workspace.
- The `agents` key is **retired**, and an `agents` entry is a hard `yolo check`
  error on the host rather than something ignored. An agent arrives as a pack:
  `yolo pack add claude` is the spelling, and `yolo pack --help` is the tooling.
- A scalar or `null` in a later layer **overrides**. Use this to disable an
  inherited entry: `mcp_servers.foo = "off"` removes an inherited server;
  the same trick disables an inherited preset.

## Two representative edits (then run `yolo config check`)

Add a CLI tool or runtime — the preferred, no-rebuild path:

```toml
[install]
mise = { neovim = "stable", kubectl = "latest" }
```


Add a nix package — only when no mise tool exists (triggers a rebuild):

```toml
[install]
nix = ["ffmpeg", "postgresql"]
```

Or with a verb: `yolo config add install.nix ffmpeg`.

## Some files in your home are GENERATED — don't hand-edit them

Your own agent config — `~/.claude/settings.json`, `~/.codex/config.toml`,
`~/.copilot/config.json`, and friends — is **not a file you own**. yolo composes
each one at every boot from an ordered stack of layers, so a change you make by
hand may be silently reverted, preserved, or discarded according to the file's owner. Edit
the *inputs*, not the output.

Find out what is generated and how, before editing anything in `~`:

```
yolo config ls                      # every composed file, its mode, and its source
yolo config render <agent> --explain   # which layer each key came from
yolo config diff <agent>            # your in-jail edits vs what yolo generated
```

The `MODE` column in `yolo config ls` is the part that decides whether your edit
survives. There are four values and every one of them means something different
for your edit:

- **capture** — your edit is recorded in a sidecar under `<workspace>/.yolo/prism/`
  and re-applied on later boots. Editing works, but it is invisible to anyone
  reading the config, so prefer changing the real input.
- **copy** — regenerated from scratch every boot. **Your edit is silently gone
  after a restart.** Never hand-edit these.
- **rmw** — the file is the AGENT'S, and yolo only asserts its own managed keys
  into it at boot, filling defaults where they are absent and preserving
  everything else. So your edit survives *unless* it touches a key yolo manages.
  This is the mode `~/.claude.json` is in, which is why `yolo config render` has
  nothing to show for it: there is no layer fold, so there is no preview.
- **unrendered** — yolo does not compose this file at all; the agent owns it.

To make a change that *persists and is legible*, change the input instead: an MCP
server belongs in `mcp_servers`, an LSP in `lsp_servers`, and an arbitrary host
file you want composed into the jail belongs in `host_files` (user config only —
`yolo config-ref` has the shape). If you edited a composed file and want to undo
it, `yolo config reset <agent>` discards the captured edits.

## Six things agents reliably get wrong

These are mistakes agents make when they are sure and do not check. Check
them even when you are sure.

### 1. The directory you launch from IS `/workspace`. Don't mount it.

`yolo` takes the **current working directory** as the workspace and bind-mounts
it **read-write and live** at `/workspace`. Configuring a jail for
`~/code/sysadmin` means `cd ~/code/sysadmin && yolo`, and that directory then
*is* `/workspace` — the same files, not a copy, no sync step either way.

It does **not** appear at `/ctx/sysadmin`, and putting it in `mounts` is wrong
twice over: redundant, and `mounts` is read-only, so you would be asking for a
crippled second view of a tree you can already write. **`mounts` is for paths
outside the workspace.**

Two consequences that follow from "it is literally the cwd":

- There is no `--workspace` flag and no walk up the tree looking for
  the workspace config. Launch from a subdirectory and *that subdirectory* is the
  whole workspace, with its own config and its own jail.
- The workspace config sits at the workspace root, so from inside a jail it is
  always `/workspace/yolo-jail.toml` (or `yolo-jail.jsonc` while legacy) — whatever it is called on the host.

### 2. A `mounts` entry lands at `/ctx/<basename>` — of the RESOLVED path

`mounts = ["~/code/sysadmin"]` mounts at `/ctx/sysadmin`. But the basename is
taken **after symlink resolution**, so if `~/code/sysadmin` is a link to
`~/src/sysadmin-config` it lands at `/ctx/sysadmin-config` instead. Write the
explicit `"~/code/sysadmin:/ctx/sysadmin"` form whenever you care about the name
— which is any time you are about to tell someone the path.

### 3. A string `mounts` entry is read-only, and `:ro` is NOT a suffix you write

Every string entry gets `:ro` appended for you. The one writable form is an
object with a required mode — `{ host = "~/scratch", at = "/ctx/scratch",
mode = "rw" }`, or `write = true` — and an agent cannot grant itself
one. In `yolo-jail.toml` (or `yolo-jail.local.toml`) the entry is a request: it
is refused until the human's user config allows it (`[allow.mounts]`
`on_request = ["write"]`), and then the launch's config-change prompt asks them. In a legacy `yolo-jail.jsonc` it is refused
outright; there it belongs in `~/.config/yolo-jail/config.toml`. A docker-style third field **silently breaks
the mount**: `"~/x:/ctx/x:ro"` parses as one host path literally named
`~/x:/ctx/x:ro`, which does not exist, so the entry is skipped with a warning.
`yolo check` only *warns* about it too — so the config looks accepted and mounts
nothing. `":rw"` is refused outright. Two fields maximum. Wherever the backend
puts context mounts, `$YOLO_CONTEXT_DIR` names the directory. `/ctx/packs`,
`/ctx/captures`, `/ctx/host-user` and `/ctx/host-nvim-config` are yolo's own, so
a mount landing at, inside or over one is a `yolo check` error; a bare path
whose basename is one of those names needs an explicit destination.

### 4. An in-jail `yolo check` CANNOT judge a `mounts` path

`mounts` paths are resolved on the **host**, at launch. From inside a jail, `~`
is the jail's home, so an in-jail `yolo check` warns

```
config.mounts[0]: host path does not exist and will be skipped: /home/agent/code/sysadmin
```

for every entry you add. **That warning is expected in here and is not a
failure** — do not "fix" it by rewriting the path, and do not conclude the mount
won't work. Only a host `yolo check` can judge these. (Same reason `mounts` is
stripped from the in-jail user-config snapshot and is not inherited by a nested
jail.)

### 5. Networking: name the DIRECTION before you touch a port key

Bridge mode gives the jail its own netns; it does not cut it off from the host.
Two directions, one key each, and **the two keys put the ports in opposite
orders**. Decide which row you are in before writing anything:

| Who connects | Who listens | Key | Entry order |
|---|---|---|---|
| the host | the jail | `network.ports` | `"HOST:JAIL"` |
| the jail | the host | *nothing* — dial `host.containers.internal:<port>` | — |
| the jail | the host | `network.forward_host_ports` | `"JAIL:HOST"` |

`network.ports` goes to podman's `-p` verbatim, and podman is host-first.
`forward_host_ports` is yolo's own and is jail-first — the port you write is the
one you will dial from in here. A transposed entry usually does not error; it
forwards the wrong port and presents as a broken service, so **check the order
before you debug the service.**

**There are two loopbacks.** `localhost` / `127.0.0.1` inside the jail is the
*jail's* loopback, always. The host's is a different interface reached by name.
That single fact is true and is the seed of most of the confusion here.

Two corollaries worth having:

- **You usually need no config to reach the host.**
  `host.containers.internal:<port>` already reaches host services *including*
  ones bound only to the host's `127.0.0.1` — yolo has the rootless network stack
  forward the host's loopback in, which is how yolo's own host daemons are
  reached. If you think the host's localhost cannot be
  reached from a jail, check: it can. `$YOLO_HOST_LOOPBACK`
  (`requested`/`shared` = forwarding is in place) settles it. Reach for
  `forward_host_ports` only when something must literally see `localhost:<port>`.
- **To publish a server *out* of the jail, bind `0.0.0.0` in here**, not
  `127.0.0.1` — `network.ports` cannot publish a jail-loopback-only listener.
  Binding wide inside the jail is safe: the published port is the only way in.

### 6. Host `~` is NOT jail `/home/agent` — dotfiles do not project into the jail

A fundamental invariant of YOLO is credential and filesystem isolation. Running
`rcup` or managing dotfiles on the host into `~/.pi`, `~/.claude`, or `~/.codex`
does **not** project those files into `/home/agent/` inside the jail.

- Inside the jail, `/home/agent/.pi` (and similar agent state directories) is an isolated
  per-workspace overlay (`<workspace>/.yolo/setups/<setup>/home/pi` for this launch's setup,
  or `.yolo/setups/<setup>/home/.pi` on Apple Container), not your host home.
- Agent configs and briefings in the jail are composed exclusively by **YOLO packs**
  and the config layering system (`yolo config ls`).
- If you need agent-specific rules or briefings, choose among the three supported paths:
  1. **Pack Briefing Slot (`to`)** (Global: Host + Jails) — declare
     `[[briefing]]` with `to = "pi/briefing"` (or a list `to = ["claude/briefing", "pi/briefing"]`)
     and `from = "prose/pi.md"` in a personal or shared pack's `pack.toml`
     (e.g. `~/.config/yolo-jail/packs/matt/pack.toml`). `to` addresses a named slot exposed by an
     agent pack (`<agent>/<slot>`, where `briefing` and `skills` are reserved slot names and
     `pi/packages` is pi's package folder slot); pack-scope `agent` and `[[exposes]]` belong to
     the pack that supplies the agent, not to a content pack. (Legacy `agents = [...]` is still
     read on user packs and `yolo pack migrate` rewrites it to `to`.) Omit `from` to carry every
     `*.md` in the pack's `briefing/` directory that no other entry names, and omit `to` entirely
     to broadcast to every selected agent's `briefing` slot. A root `AGENTS.md` is never shipped:
     it is the pack repository's own instructions, and a `from` naming `AGENTS.md`, `CLAUDE.md`
     or `GEMINI.md` is refused. Each file has one governing entry, so declaring one file's target
     never stops the rest shipping.
     YOLO composes these into `/home/agent/.pi/agent/AGENTS.md` in the jail and
     `~/.pi/agent/AGENTS.md` on the host via `yolo host apply`.
  2. **Workspace Project Files** (Per-repository) — place instructions in `<workspace>/AGENTS.md`
     (or `<workspace>/.pi/`), committed directly into the project repository.
  3. **Explicit Projections** (Per-jail bridge) — declare explicit host file projections in
     `host_files` in user config (`yolo config-ref`). Ad-hoc agent dotfiles on the host
     (like `~/.pi/agent/APPEND_SYSTEM.md`) are never read or mounted by YOLO.

## Don't guess at keys — the schema lives in the CLI

This skill shows two shapes on purpose. For **every** other key — `resources`,
`network`/`ports`/`forward_host_ports`, `mounts`, `mcp_servers`,
`lsp_servers`, `env.files`, and their exact fields, allowed
values, and defaults — run the authoritative, always-current reference:

```
yolo config-ref
```

Read it before inventing a key name. `yolo check` will reject unknown keys, but
reading first saves a slow, human-gated round-trip.

## Scoped packs are a host-side user choice

**Direct scoped pack selection is user-only.** Ask the human to run
`yolo pack add local/corpus --skills-dir skills/core-tools --only skill-a --dry-run`
on the host to inspect a raw selection, then omit `--dry-run` to write the user TOML
entry:
`{ pack = "local/corpus", skills = { dir = "skills/core-tools", only = ["skill-a"] } }`
The same entry can be written with the editing verb instead of `yolo pack add`. User scope is
the host's, so `yolo config add` run in the jail stops and prints a host-run line; the human runs:
`yolo config add packs '{ pack = "local/corpus", skills = { dir = "skills/core-tools", only = ["skill-a"] } }' --user --dry-run`,
then the same command without `--dry-run`. If the human says their user config's source lives in
this workspace (a dotfiles repository, say), they may have you add that same TOML line to the
`packs` list in that source file, then run `yolo config check`. Do not write
`~/.config/yolo-jail/config.toml` from the jail.
The entry applies across workspaces, not through this project's config. Omit `--skills-dir` for
typed candidate-name selectors; `--subdir` alone still imports a whole pack.
Scoped entries activate no programs, hooks, briefing, native plugins or host
capabilities. `yolo pack explain local/corpus` inspects all matching tuples without
fetching or writing; unavailable content is explicitly unverified. Scoped Check is
pure, but whole-pack readiness keeps its ordinary staging. Ambiguous
`yolo pack remove` names indexed edits or `--subdir`/`--skills-dir` to choose one
tuple. Do not rewrite legacy file filters as name selectors by guesswork, or
substitute workspace
`skill_imports`, which has its own approved Git authority.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.