Skip to main content

Module sandbox

Module sandbox 

Source
Expand description

Sandbox — how a process is constrained.

The split this contract exists to keep: a backend decides how to constrain, the kernel decides what to constrain and whether to at all. The policy below is the kernel’s; an implementation may only report how much of it it managed to deliver.

The hard invariant: a policy that asked for constraint must never silently become an unconstrained run. A backend that cannot deliver says so through Enforcement, and the caller — with sandbox.require — decides whether to refuse. A warn! nobody reads is not a decision.

Structs§

Confined
A command, after the sandbox has had its say.
ConfinementReport
What the session’s sandbox holds a command to, found once when the session is built. The permission policy reads it and never probes the sandbox itself.
EgressProxy
sandbox.network.proxy: the proxy a sandboxed command’s traffic must go through. Addresses, never names, so that nothing has to be resolved to write the rule or the variables.
SandboxPolicy
What to constrain. The kernel’s, not a backend’s.
SandboxSettings
The engine’s sandbox settings for a session, as settings.json’s sandbox section gave them: what a command is held to, before any one call narrows it. Every SandboxPolicy a command or the engine’s own git runs under is derived from this, here.

Enums§

Enforcement
How much of the policy is actually in force.
NetworkMode
ReadScope
What a confined command may read.
SandboxMode
Which backend ran. Advisory — for logs and tests.

Traits§

Sandbox
How a process is constrained.

Functions§

default_deny_read
Default deny-read paths — credential stores that almost never want to be inside an LLM tool result. User can override via sandbox.allow_read in settings.json. Returned absolute (HOME resolved).
default_deny_read_in
default_deny_read for the home directory home.