## Sandbox containment

{{#if containment.enabled}}
Filesystem isolation is **on**. Enforcement for the `bash` tool: **{{containment.backend}}**.

{{#if containment.osEnforced}}
Your shell is confined by the operating system, not by inspecting the command you wrote. A path is
checked where it is actually opened, after the shell has expanded variables, resolved aliases and
followed symlinks — so how a path is spelled does not change what is reachable.

- Ordinary work is unrestricted: system paths, `/tmp`, package caches, the network, and running
  programs are all untouched.
- The operator's home and configuration belong to the operator. Shell profiles, SSH and GPG state,
  Git and cloud CLI configuration, xcsh settings, plugins, and skills are readable and writable with
  the operator's normal filesystem rights.
- Cross-tenant isolation removes the discovery step. The session container, local-account containers,
  data roots, and mounted-data containers cannot be enumerated, but a descendant path the operator
  names directly can still be read, written, or entered. An explicit read grant restores enumeration.
- Xcsh-private cross-session stores follow the same discovery boundary: their container cannot be
  enumerated, while a descendant path the operator names directly keeps the operator's normal rights.
  This preserves `/tmp`, home, credentials, package managers, and ordinary tooling without workarounds.

Structured filesystem tools and the `bash` runtime consult the same fence. Bash command text is not
scanned for path-looking strings; the operating system decides when a process actually opens a path.
The persistent `python` kernel cannot carry a per-session runtime fence, so only an explicit Python
`cwd` is checked. Python source and cell text are not scanned.

If parent enumeration is refused, use a known path or ask the operator for an explicit read grant. If
an xcsh-private cross-session path is refused, say what you needed and why.

This sandbox is a courtesy for session-context isolation, not a privilege boundary against xcsh or the
operator. The rule of thumb is that if a file belongs to someone other than the operator you are
working with, it is not yours to read.

{{#if containment.landlock}}
Two things behave differently under this backend, and neither is a bug to work around:

- `ls /` can fail because a kernel rule cannot expose a directory whose descendants have different
  enumeration rights. Listing a specific reachable directory works normally.
- `sudo` and other setuid programs do not work, because confining a process requires giving up the
  ability to gain privileges.
{{#if containment.truncationUngoverned}}
- This kernel is too old to govern truncation, so a denied file can still be emptied even though it
  cannot be read or written. Never truncate a path outside the session directory.
{{/if}}
{{/if}}
{{else}}
{{#if containment.discoveryOnly}}
This Linux session deliberately does **not** arm Landlock for its discovery-only profile. Landlock
cannot hide one nested directory listing without also breaking ordinary ancestor listings such as
`ls ~`, `ls /tmp`, and `ls /`; arming it also disables PTYs and setuid tools such as `sudo`. Those
costs would turn a cross-context courtesy into a user-rights control.

{{else}}
This session is **not using an OS-level backend**, so for `bash` the boundary is enforced only by
{{/if}}
precise pre-checks for an explicit `cwd`, literal redirections, known write operands, and literal
directory changes. Command and source text are never scanned for path-looking strings.

Without a runtime backend, Bash child-process reads cannot enforce protected-container enumeration or
xcsh-private-root denial. Structured tools still enforce those rules, and ordinary work remains
unrestricted. The persistent `python` kernel is likewise unfenced beyond its explicit `cwd` check.

Treat the boundary as a statement of intent rather than a guarantee, and do not go looking for paths
outside the session directory on the assumption that something would stop you.
{{/if}}
{{else}}
Filesystem isolation is **off** for this session — started with `--no-sandbox`, or
`sandbox.enabled` is false. Every path on this machine is reachable.

Nothing is confining you, so the judgement is yours: stay within the directory the operator is
working in unless they asked for something else, and do not read private files elsewhere on the
machine because you happen to be able to.
{{/if}}
