PanCode
All tutorials

Safety and autonomy7 min read

Let PanCode work without watching every call

Check the sandbox, undo a change with /rewind, tell the safety judge about your machine, and know when yolo is the right call.

Written for
v0.9.0
Works in
Terminal · Desktop alpha
Basis
Recorded session
Updated
Terminal recording on gpt-6-luna: pancode doctor reports chat on target copilot with the endpoint reachable, warnings about directory and settings.yaml permissions, missing state metadata and the herdr pane host not being installed, and 5 rows need attention, 46 checks passed, 14 notes. On the scratch branch, Panos then searches package.json, runs rm -rf dist, checks build and test (both exit 0) and reports that it deleted dist/, ran npm run build to regenerate it, and all 7 tests passed; /rewind lists snapshot #1 from the bash delete as same as now, and its preview says the workspace already matches the snapshot, so nothing would change.
Doctor's report, a rebuild on a scratch branch, and /rewind's preview, closed with Esc so nothing is restored. Terminal · v0.9.1 Recording · 0:34
Transcript
Letting PanCode work: sandbox, snapshot and rewind
Recorded with PanCode 0.9.1. Each section is the terminal screen at that moment.

== doctor

~/projects/calibration-lab $ pancode doctor
OK   chat                   target 'copilot', model 'gpt-6-luna'; endpoint reachable
OK   PanCode version        0.9.1
WARN state dir mode         /home/researcher/.local/state/pancode is 755: group or other users can enter it and read session transcripts (run `pancode doctor --fix`, or `chmod 700` it when the directory is not PanCode's alone)
WARN data dir mode          /home/researcher/.local/share/pancode is 755: group or other users can enter it and read memory, project store data and vendored tools (run `pancode doctor --fix`, or `chmod 700` it when the directory is not PanCode's alone)
WARN settings.yaml mode     644 lets group or other users read it (run `pancode doctor --fix` to set 600)
!!   state metadata         missing (run `pancode doctor --fix`)
WARN external tool herdr    pane host 0.9.5 is not installed; run `pancode panes install`
5 rows need attention, 46 checks passed, 14 notes; `pancode doctor --verbose` prints every row
~/projects/calibration-lab $

== report












▐∀▌ PanCode 0.9.1

▌ Delete the build output directory, regenerate it, and run the project's test check. Report what you ran.

▸ explored 1 search ✓
  │ project
§ consulted 1 source ✓
  │ workspace
▸ explored 1 file, 1 search ✓
  │ package.json · `outDir|dist|build`

│ Thinking · /view · ≈125 tokens

$ Panos ran `rm -rf dist` · exit 0 ✓
$ checked build · exit 0 · 5 lines ✓
$ checked test · exit 0 · 19 lines ✓

■ Deleted dist/, ran npm run build to regenerate it, then ran npm run test. Build succeeded; all 7 tests passed.

✓ Done · 11s · 12:18

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 Ask Panos…  ? keys · / commands
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 ▐∀▌ default · projects/calibration-lab · scratch │ ✓ ready                        ctx ▰▱▱▱▱▱ 5% · low · gpt-6-luna · ?

== rewind











▐∀▌ PanCode 0.9.1

▌ Delete the build output directory, regenerate it, and run the project's test check. Report what you ran.

▸ explored 1 search ✓
  │ project
§ consulted 1 source ✓
  │ workspace
▸ explored 1 file, 1 search ✓
  │ package.json · `outDir|dist|build`

│ Thinking · /view · ≈125 tokens

$ Panos ran `rm -rf dist` · exit 0 ✓
$ checked build · exit 0 · 5 lines ✓
$ checked test · exit 0 · 19 lines ✓

■ Deleted dist/, ran npm run build to regenerate it, then ran npm run test. Build succeeded; all 7 tests passed.

✓ Done · 11s · 12:18

━ Rewind workspace files ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  ❯ #1  12:18:33  delete · bash                                                                          ✓ same as now
    ✓ same as now · delete · bash
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ [Enter] preview rewind · [↑↓] select · [Tab] detail · [Esc] close ━
 ▐∀▌ default · projects/calibration-lab · scratch │ ✓ ready                            ctx ▰▱▱▱▱▱ 5% · low · gpt-6-luna

== preview







▐∀▌ PanCode 0.9.1

▌ Delete the build output directory, regenerate it, and run the project's test check. Report what you ran.

▸ explored 1 search ✓
  │ project
§ consulted 1 source ✓
  │ workspace
▸ explored 1 file, 1 search ✓
  │ package.json · `outDir|dist|build`

│ Thinking · /view · ≈125 tokens

$ Panos ran `rm -rf dist` · exit 0 ✓
$ checked build · exit 0 · 5 lines ✓
$ checked test · exit 0 · 19 lines ✓

■ Deleted dist/, ran npm run build to regenerate it, then ran npm run test. Build succeeded; all 7 tests passed.

✓ Done · 11s · 12:18

━ Rewind files to snapshot #1 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   snapshot #1 · 2026-11-26 12:18:33 · delete · bash
   The workspace already matches this snapshot. Nothing would change.
   Pinned refs ─────────────────────────────────────────────────────────────────────────────────────────────────── 1
     HEAD aae72d8ff787 on scratch · still in place
   Never touched ────────────────────────────────────────────────────────────────────────────────────────────────────
   Gitignored files are never touched. Your Git index, HEAD and branches do not change.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ [↑↓] scroll · [Esc] back to snapshots, nothing changed ━
 ▐∀▌ default · projects/calibration-lab · scratch │ ✓ ready                            ctx ▰▱▱▱▱▱ 5% · low · gpt-6-luna

== kept











▐∀▌ PanCode 0.9.1

▌ Delete the build output directory, regenerate it, and run the project's test check. Report what you ran.

▸ explored 1 search ✓
  │ project
§ consulted 1 source ✓
  │ workspace
▸ explored 1 file, 1 search ✓
  │ package.json · `outDir|dist|build`

│ Thinking · /view · ≈125 tokens

$ Panos ran `rm -rf dist` · exit 0 ✓
$ checked build · exit 0 · 5 lines ✓
$ checked test · exit 0 · 19 lines ✓

■ Deleted dist/, ran npm run build to regenerate it, then ran npm run test. Build succeeded; all 7 tests passed.

✓ Done · 11s · 12:18

━ Rewind workspace files ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  ❯ #1  12:18:33  delete · bash                                                                          ✓ same as now
    ✓ same as now · delete · bash
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ [Enter] preview rewind · [↑↓] select · [Tab] detail · [Esc] close ━
 ▐∀▌ default · projects/calibration-lab · scratch │ ✓ ready                            ctx ▰▱▱▱▱▱ 5% · low · gpt-6-luna
On this pageBefore you start Contain, run and undo a task What still reaches you When to use yolo

Most of a coding task should not need you. At the default level, PanCode runs shell work inside an OS sandbox, snapshots your files before it changes them, and has a safety judge review what escapes the sandbox. You are asked only when the judge has no verdict or the decision is yours.

This guide shows how to check that setup, undo a change, and choose when to step up to yolo.

Before you start

  • PanCode installed, with a connected model.
  • A Git repository you can experiment in, with a clean working tree.

Contain, run and undo a task

  1. Check what this host can contain

    Shell

    pancode doctor --verbose

    Plain doctor lists only the rows that need attention; --verbose prints every row. Look for the shell sandbox row. It names the backend and where contained commands may write. If no backend exists, commands outside the recognized set go to the judge and then to you, so the rest of this guide still holds with more questions.

    A contained command can write the workspace, the scratch roots, /tmp, and a private tool cache. Your own ~/.cache and ~/.npm stay read-only. Credentials, credential variables, secret files such as .env, and the SSH agent are hidden, new local Unix sockets are refused, and the network stays on. A directory your scripts must always write belongs in safety.scratchRoots.

    A secret path is also refused before any sandbox is involved. In the recording below, asked how many bytes .env holds, the agent tried wc -c .env with bash, and PanCode stopped it before it ran:

    rule: secret_path_bash
    This is a hard block; confirmation cannot override it.
    Terminal recording in which the user asks PanCode on gpt-6-luna how many bytes .env holds, using wc -c .env with bash. The bash call is marked blocked under rule secret_path_bash as a hard block that confirmation cannot override, and Panos reports that the command did not run, so it cannot give the byte count.
    A command that names the project's .env is refused before it runs; confirmation cannot override the block. Terminal · v0.9.1 Recording · 0:17
    Transcript
    PanCode refuses to read a project secret
    Recorded with PanCode 0.9.1. Each section is the terminal screen at that moment.
    
    == ready
    
    
    
    
    
    
       ██████  ██    ██ ███   ██
       ██   ██ ████████ ████  ██
       ██████  ██    ██ ██ ██ ██
       ██      ██    ██ ██  ████
       ██       ██████  ██   ███       ▐∀▌ PanCode 0.9.1 · Systems software for coding agents
                                       /model switches the chat model.
     ██████  ██████  ██████  ███████
    ██      ██    ██ ██   ██ ██
    ██      ██    ██ ██   ██ █████
    ██      ██    ██ ██   ██ ██
     ██████  ██████  ██████  ███████
    
    
    
    
    
    
    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
     Ask Panos…  ? keys · / commands
    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
     ▐∀▌ default · projects/calibration-lab · main* │ ✓ ready                               ctx 272k · low · gpt-6-luna · ?
    
    == blocked
    
    
    
    
    
    
    
    
    ▐∀▌ PanCode 0.9.1
    
    ▌ How many bytes is .env? Run wc -c .env with bash and tell me exactly what happens. If it is blocked, name the rule.
    
    $ bash `wc -c .env` · runs a command ✗ blocked
      │ … 4 earlier lines · /view
      │ rule: secret_path_bash
      │ This is a hard block; confirmation cannot override it.
    
    ■ PanCode blocked wc -c .env under the secret_path_bash rule: .env matches the zero-access path. The command did not
      run, so I can’t report its byte count. The rule says this is a hard block; confirmation cannot override it.
    
    ✓ Done · 2.9s · 12:18
    
    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
     Ask Panos…  ? keys · / commands
    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
     ! PanCode's safety net blocked bash because it runs a command. This gate applies at…     Alt+U more · Ctrl+G X dismiss
     ▐∀▌ default · projects/calibration-lab · main* │ ✓ ready                          ctx ▰▱▱▱▱▱ 4% · low · gpt-6-luna · ?
    
    == answer
    
    
    
    
    
    
    
    
    ▐∀▌ PanCode 0.9.1
    
    ▌ How many bytes is .env? Run wc -c .env with bash and tell me exactly what happens. If it is blocked, name the rule.
    
    $ bash `wc -c .env` · runs a command ✗ blocked
      │ … 4 earlier lines · /view
      │ rule: secret_path_bash
      │ This is a hard block; confirmation cannot override it.
    
    ■ PanCode blocked wc -c .env under the secret_path_bash rule: .env matches the zero-access path. The command did not
      run, so I can’t report its byte count. The rule says this is a hard block; confirmation cannot override it.
    
    ✓ Done · 2.9s · 12:18
    
    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
     Ask Panos…  ? keys · / commands
    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
     ! PanCode's safety net blocked bash because it runs a command. This gate applies at…     Alt+U more · Ctrl+G X dismiss
     ▐∀▌ default · projects/calibration-lab · main* │ ✓ ready                          ctx ▰▱▱▱▱▱ 4% · low · gpt-6-luna · ?
  2. Give it a task and watch what happens

    On a scratch branch, type this:

    Delete the build output directory, regenerate it, and run the project's test check. Report what you ran.

    Workspace edits and contained commands run without a card. A delete inside the workspace runs after a snapshot is taken. Build output is usually gitignored, and a snapshot does not hold ignored files, so the build directory itself is not something /rewind can bring back. A push or a command that leaves the sandbox goes to the judge first.

  3. Undo it with /rewind

    /rewind

    The list shows this session's snapshots, newest first, with how many files each differs by. Enter previews a restore before anything is written. Confirming takes one more snapshot, so the rewind itself can be rewound. Esc goes back without writing anything.

    In the recorded session behind this guide, the regenerated build was gitignored and nothing tracked had changed, so the preview read:

    The workspace already matches this snapshot. Nothing would change.

    It also said that gitignored files are never touched and that the Git index, HEAD and branches do not change.

  4. Tell the judge about your machine

    The judge reads your typed messages and the proposed call. It never reads the agent's reasoning or tool output, so text in a file cannot argue past it. Name what is yours in your user settings, the settings.yaml file in the folder that pancode paths prints on its config line:

    settings.yaml

    safety:
      judge:
        environment:
          - "Shared cluster; /scratch/$USER is mine to create and delete in."
        allow:
          - "restarting the dev containers this project's compose file defines"

What you should see

Contained work runs without a card, and /rewind lists a snapshot from before the first change of the turn. This shows the controls work on your host. It does not show that the agent's change is correct, so review the diff and the check results.

What still reaches you

Some decisions never go to the judge: ask_user questions, PanCode's own settings, a plan-scale dispatch, and a model edit of project settings. An approval card nobody answers within safety.unattendedAfterMs (5 minutes by default) is denied, never approved, and the turn continues. A question nobody answers takes its recommended option, and /decisions shows what was chosen for you.

When to use yolo

yolo is for long jobs you leave running: nothing waits for you. It is contained by default. The sandbox, snapshots, and safety judge work as at default, and a call that would have asked you is refused back to PanCode, so the job keeps going without it.

Shell

pancode --autonomy yolo

The first interactive activation shows a one-time acceptance card, and yolo is refused as root outside a detected container. A short floor still blocks deleting your home directory or a system tree, mkfs, writes to a block device, fork bombs, and reads of PanCode's credential store. Your project's approved rules and the run's ceilings also hold. Snapshots stay on.

After 600 tool calls since you last spoke, set by safety.limits.autonomousToolCalls, the session pauses until you continue.

Unconfined yolo is the skip-permissions mode for a container or another disposable environment: nothing asks, and commands run unsandboxed with your credentials. It takes effect only with safety.yoloConfinement: unconfined in your user settings and its own one-time acceptance. The footer shows which one is active.

To keep unconfined yolo inside the sandbox, also set safety.sandbox: required. Commands then run contained, and a retry with unsandboxed: true is refused. An outward command such as git push or gh pr create leaves the sandbox only as one literal command on that tool's short option list, with no pipe, redirect, or substitution. doctor reports which rule applies.

default yolo, contained yolo, unconfined
Shell commands In the OS sandbox when a backend exists As at default Unsandboxed as you, unless safety.sandbox: required
Would-be approvals Judge first, then you Judge first, then refused back to PanCode None
Your questions Wait, then resolve after the timeout Answered at once Answered at once
Workers Own sandbox, asks go to the judge Dispatched as at default Own sandbox, run the yolo way in their scope
/rewind Available Available Available

What this does not protect

  • The sandbox contains bash, run_script and checks that run commands through verify. Typed write and edit calls follow the rules instead.
  • Ignored files, untracked files over 16 MiB, and nested repositories are not in a snapshot.
  • /rewind restores files. It never moves refs: it prints the commands that bring a moved branch back.
  • The judge is a model. It can be wrong, and a route error means no verdict, so the call parks or is denied.
  • Stronger isolation needs an external sandbox such as a container.

By Anthony Kougkas · PanCode

Continue with the documentation