Repository navigation
Description
User Story
I use OpenShell to contain AI agents in a prototype for clinical-development oversight, with one policy per zone and per-zone read allow-lists so each agent can read only its own staged inputs.
I directly encountered extra readable system paths in sandboxes whose policy has any network_policies entry, paths that do not appear in the policy I wrote.
This affects my ability to state and evidence least privilege for each zone from its policy file.
Problem Statement
When a policy contains any network_policies entry, the sandbox can also read system paths that the policy's filesystem section does not list. Nothing in the written policy indicates this; I found it only by comparing the applied policy with the policy file.
On 0.1.7 the applied policy gains read-only /usr, /lib, /etc, /var/log, /proc and /dev/urandom, and read-write /dev/null (reproduction below). An OpenShell contributor reviewing main at 438e07b reports /app is added too (crates/openshell-supervisor/src/lib.rs:2227-2325); I did not see /app on 0.1.7.
Impact / Why This Matters
When this happens, users must compare the applied policy with the policy they wrote to learn what their agents can actually read, and most users will not know to do that.
This results in policies that look least-privilege on paper but are broader in effect. In my project, zones I believed were separated by their policies were, in effect, much closer than their files suggested.
This matters because in regulated settings (GxP-style audit expectations) the policy file is the artefact reviewers inspect. A reviewer reading the file would reach the wrong conclusion about what an agent could read, including /var/log and /proc.
Acceptance Criteria
- Every path OpenShell adds implicitly is visible in the policy the runtime reports for a sandbox.
- The documentation lists the paths added when a policy has network rules, with their access mode.
- A policy author can tell from the docs or the reported policy whether a given system path is readable, without testing from inside the sandbox.
Reproduction Steps
-
Write two policies that differ only in
network_policies.policy-a.yaml:
version: 1 filesystem_policy: include_workdir: false read_only: - /usr/bin/bash - /usr/lib/x86_64-linux-gnu - /tmp read_write: [] landlock: compatibility: hard_requirement process: run_as_user: sandbox run_as_group: sandbox network_policies: {}
policy-b.yaml: identical, except:
network_policies: example: name: example endpoints: - host: api.example.com port: 443 protocol: rest enforcement: enforce rules: - allow: method: GET path: / binaries: - path: /usr/bin/curl
-
Create both sandboxes (both start) and save the applied policies:
openshell sandbox create --name repro-a --from <IMAGE> --policy policy-a.yaml --detach --no-auto-providers --no-tty openshell sandbox create --name repro-b --from <IMAGE> --policy policy-b.yaml --detach --no-auto-providers --no-tty openshell sandbox get repro-a --policy-only > applied-a.yaml openshell sandbox get repro-b --policy-only > applied-b.yaml -
In each sandbox, try to read /etc and /var/log using only bash (so no other binary needs to be readable):
openshell sandbox exec --name repro-a --no-tty --no-login-shell --timeout 60 -- /usr/bin/bash -c 'exec 3< /etc/os-release && echo readable' openshell sandbox exec --name repro-a --no-tty --no-login-shell --timeout 60 -- /usr/bin/bash -c 'exec 3< /var/log && echo readable'Repeat with
--name repro-b.sandbox read exit output repro-a /etc/os-release 1 /etc/os-release: Permission deniedrepro-a /var/log 1 /var/log: Permission deniedrepro-b /etc/os-release 0 readablerepro-b /var/log 0 readable(With
catandlsinstead, B also succeeds:cat /etc/os-releaseprintsPRETTY_NAME="Debian GNU/Linux 13 (trixie)".) -
diff applied-a.yaml applied-b.yaml: apart fromnetwork_policies, B's applied policy contains paths that are in neither input file:- read_only: /usr, /lib, /etc, /var/log, /proc, /dev/urandom
- read_write: /dev/null
-
Clean up:
openshell sandbox delete repro-aandopenshell sandbox delete repro-b.
Expected: adding a network rule leaves the filesystem section unchanged, and B refuses the same reads A refuses.
Actual: B silently gains read access to six system paths and read-write /dev/null. Reads that Landlock refuses in A succeed in B, and the policy file gives no sign of it. I found no policy field that turns this off.
Suggested UX (if applicable)
Notional only:
filesystem_policy:
implicit_system_paths: false # opt out entirely or narrow it: implicit_system_paths: [/usr, /lib]
At minimum, openshell sandbox get --policy-only would list the implicit paths, marked as added by the runtime.
Environment
- OpenShell: 0.1.7 (not retested on main)
- OS: Ubuntu 26.04.1 LTS, sandbox image based on Debian 13 (trixie)
- Deployment: Docker driver, gateway as a systemd user unit, Landlock compatibility hard_requirement
Activity