Jail mode

Confine the agent's tools to the current directory.

Jail mode locks the agent's tools to a sandbox rooted at the working directory shown in the status bar. Toggle it with /jail and lift it again with /unjail. While active, the status bar shows jailed, ~/your/cwd. It is a guardrail against accidents, a speed bump for the model, not a hard security boundary.

Jail new sessions by default

Enable jail new sessions by default in /settings to start every new agent with jail mode active. It is off by default and applies to interactive, print, JSON, RPC, and background-agent runs. The preference is stored as jail_by_default in $ZOT_HOME/config.json.

Changing the setting also locks or unlocks the current interactive session immediately. /jail and /unjail remain session-scoped overrides, so they do not change the saved default. For example, /unjail unlocks the current session while the next session still starts jailed.

What it enforces

The file tools resolve their target path (following symlinks) and enforce these limits:

  • write and edit only touch paths inside the sandbox root.
  • read and glob can also access loaded, enabled extension directories, as described below.
  • Symlinks that point outside the allowed roots are rejected, including for files that do not exist yet.
  • bash rejects obvious escape patterns and paths that resolve outside the sandbox root.
  • powershell refuses all execution while jailed. The existing shell checks do not parse PowerShell syntax, so enabling the optional tool in /settings does not bypass jail mode. See Tools.

Read-only extension access

While jailed, read and glob can access the individual directories of loaded, enabled extensions. This includes explicit --ext paths and skill-only bundles, so skills can read bundled reference files without disabling jail. It does not grant access to every installed extension or the entire extensions parent directory.

Symlinked installations are supported, but links inside an extension cannot grant access outside the allowed roots. Reloading extensions replaces the grants with the current selection. Agent rebuilds retain the shared jail state and refresh these grants.

Packaged-agent filesystem read permissions still apply. This exception does not relax write, edit, or shell checks, and reading a bundled script does not authorize executing it outside the jail. Extensions themselves still run with the user's permissions, not inside an operating-system sandbox. See Extensions.

Bash guardrails

While jailed, bash refuses commands that contain destructive or escalating patterns, rejects shell arguments and redirections that resolve outside the root, and refuses a leading cd that tries to leave the root:

  • rm -rf /, rm -rf ~, rm -rf $HOME
  • sudo, su
  • chmod -R, chown -R
  • mkfs, dd if=, dd of=/
  • leading cd /, cd ~, cd $HOME, cd ..
  • outside paths in arguments or redirections, such as cat /etc/passwd or cat </etc/passwd

Not a security boundary

The bash checks are heuristics on the command string, not a real sandbox. A determined command can still escape. For true isolation, run zot under Docker or a proper OS sandbox. Use /unjail to disable jail mode when you need to reach outside the directory.