Skip to content
Back to skills

Diagnosing The Jail

ASecurity

Diagnose a broken coding environment: provisioning failures, blocked tools, unavailable loopholes, or stale code, including jail-specific causes.

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

Security analysis

A100/100

Scanned December 5, 2026

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

Installs into .claude/skills of the current project.

Are you the author of Diagnosing The Jail?

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

Security grade badge for Diagnosing The Jail
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/mschulkind-oss-diagnosing-the-jail/badge)](https://www.skillsdirectory.com/skills/mschulkind-oss-diagnosing-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: diagnosing-the-jail
description: "Diagnose a broken coding environment: provisioning failures, blocked tools, unavailable loopholes, or stale code, including jail-specific causes."
---

# Diagnose this environment

When something inside the jail misbehaves, work this triage tree top to bottom.
Each step points at a live command — run its `--help` for detail rather than
guessing flags.

## 1. Check readiness first

```
yolo check
```

This is the broad in-jail readiness report: it checks config and the entrypoint
alongside the runtime and environment. It is not the config-edit check. After a
config edit, use `yolo config check` for config validity; it does not establish
that the jail is ready. A `[FAIL]` in this readiness report explains most
"why won't it start / why did provisioning break" symptoms. Fix reported
failures before anything else.

## 2. Provisioning failed → read the startup log

If tools the project expects are missing, the last boot's provisioning may have
failed. Look for `PROVISIONING FAILED` in the workspace's own `.yolo` directory:

```
/workspace/.yolo/logs/startup.log          # container backends
<your workspace>/.yolo/logs/startup.log    # macos-user, where /workspace does not exist
```

It is one file under two names on the container backends — `/workspace` is where
the workspace is mounted. On **macos-user** there is no mount and no `/workspace`,
so use the project's real path. A jail an older yolo started writes its logs directly
in `.yolo` instead (`.yolo/startup.log`); look there when `logs/` has no fresh one.

Self-serve from there: e.g. run `mise install` in the workspace, then re-run the
step that failed. (The briefing shows a `⚠ Provisioning failed` banner on the
next attach after a failed boot.)

## 2b. macOS only: `permission denied` writing inside the workspace

On the **macos-user** backend the jail runs as a separate macOS account
(`_yolojail`), so the workspace has to be *shared* with it by an ACL entry. If it
is not, writes fail with `permission denied` — during provisioning (six config
generators failing at once is the signature) or later, whenever something first
tries to write a path that was never shared.

```
yolo yolo-account share <workspace>     # or with no path: every project under the shared root
```

Idempotent and safe to re-run at any time.

**Why it happens.** macOS applies an inheriting ACL entry when a directory is
**created**, and never retroactively. `yolo yolo-account create` shares everything under
`/Users/Shared/yolo` and anything created there afterwards inherits the grant — so
the case left over is a project **moved or copied in** later, because `mv` renames
rather than creates and inherits nothing. (An ACL also names a UUID rather than a
name, so entries made before the sandbox account was last deleted and recreated go
inert while still reading correctly in `ls -le`.)

**Check it yourself:**

```
ls -lde <path>          # a live grant reads: group:_yolojail [inherited] allow …
                        # a bare UUID in that column is a dead grant
```

A launch does not fix these permissions for you; run the command once.

## 3. A tool is blocked or shimmed

Some tools are intentionally shimmed (e.g. `grep -r` → use `rg`, `find` → use
`fd`). If a command errors oddly or is "not found the way you expect":

- Blocked tools are in `~/.yolo/bin/block/`. Programs yolo installs on first
  use are in `~/.yolo/bin/launch/`.
- Run the real tool for a script/installer that needs it:
  `YOLO_BYPASS_SHIMS=1 <cmd>`
- **The `rg -r` trap:** in `rg`, `-r` means `--replace` and silently corrupts
  match output. Never pass grep-style `-r`/`-rn`; use `rg -n <pattern> [path]`.

## 4. A loophole (host capability) is down

Loopholes wire host capabilities (audio, claude-oauth-broker, host-processes)
into the jail. If one isn't working:

```
yolo loopholes list      # which loopholes this jail has, and whether each is running
yolo broker status       # for the claude-oauth-broker loophole specifically
yolo broker logs         # recent broker output
```

## 5. A port isn't reachable → establish the DIRECTION first

Half the time this is not a broken service, it is the wrong key or a transposed
entry. **`network.ports` is `"HOST:JAIL"`, `network.forward_host_ports` is
`"JAIL:HOST"` — opposite orders.** And there are two loopbacks: `localhost`
inside the jail is the *jail's*, never the host's.

**Jail → host** (you are in here, the service is out there). It should work with
no config at all: `host.containers.internal` reaches the host, including services
bound only to the host's `127.0.0.1`.

```
echo $YOLO_HOST_LOOPBACK     # requested | shared → forwarding is in place
                             # unsupported | unknown → it may genuinely be absent
(exec 3<>/dev/tcp/host.containers.internal/<port>) && echo CONNECT || echo FAIL
```

`requested` plus a service that does not answer is a **fault**, not a
limitation — yolo's own services would have stopped the launch if they could
not be reached — so suspect the service, its bind address, or its port. Only if something
must literally see `localhost:<port>` in here do you need
`network.forward_host_ports`; check that entry reads jail-port-first.

**Host → jail** (your server is in here and the host's browser can't load it).
Two causes, in this order:

1. **It's bound to the jail's loopback.** `network.ports` cannot publish a
   `127.0.0.1` listener. Confirm with `ss -ltnp` — you want `0.0.0.0:<port>`,
   not `127.0.0.1:<port>` — and rebind. Most dev servers need an explicit flag
   (`--host 0.0.0.0`). Binding wide inside the jail is safe.
2. **The mapping is inverted or absent.** `"HOST:JAIL"`, host side first, and it
   is applied at launch — adding it to the config does nothing until a restart.

```
ss -ltnp                                    # what is actually listening, and where
(exec 3<>/dev/tcp/127.0.0.1/<port>) && echo LISTENING-IN-JAIL || echo NOT-LISTENING
```

That second probe splits the two: if the server does not even answer inside the
jail, no port mapping was ever going to help.

## 6. "My fix isn't taking effect" → you're running stale code

Config edits refresh on the next `yolo` invocation, but the running container's
mounts/limits do NOT change until a restart — the briefing text can be ahead of
reality. `YOLO_DEBUG=1` is a knob on the **launch**, not on an arbitrary
command: set on a `yolo` invocation on the host it prints the assembled
container argv, which is the ground truth for the mounts, limits and env a
restart would actually apply. From in here, the launch that started this jail
already wrote its own transcript — read `<workspace>/.yolo/logs/launch.log` and the
entrypoint's `boot.log` beside it (directly in `.yolo` for a launch by an older yolo). For a
timeline of launches, config skips, and approvals, run `yolo history` (see the
**explaining-what-happened** skill).

## 7. Orphans and logs

- `yolo history` — structured timeline of this workspace's launches, config changes, approvals,
  and calls (see **explaining-what-happened**).
- `yolo ps` — list running jails (catches orphaned containers).
- Agent logs, for debugging a specific agent:
  `~/.copilot/logs/`, `~/.claude/projects/`.

## 8. Ruling out the workspace's state

To test whether something in the workspace's `.yolo` causes a problem, never
move, rename, delete or copy `.yolo` or anything in it. The agents' homes are
in there, this session's own files included, and a home moved out from under a
running jail is lost when the jail stops. A copy rules nothing out: the jail
keeps running on the original, and `.yolo/durable` is inside it, so the copy
recurses. The state cannot be ruled out from inside the jail that runs on it.
Instead:

- ask the human to run `yolo --fresh-home`, which starts the agent on a new,
  empty home and leaves the regular one untouched; or
- reproduce from a throwaway workspace (a new empty directory), which gets a
  `.yolo` of its own.

`<workspace>/.yolo/README.md` says what each part of the directory holds.

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.