Documentation
¶
Overview ¶
Package sandbox confines the commands the agent runs.
The agent has a shell. On a machine that also holds your files, your keys, and your network, that is a lot of reach for something driven by a model following instructions from a web page it just read.
Nothing here needs root. It uses what an unprivileged user already has: bubblewrap when installed, and Linux user namespaces when not. Where neither is available it says so rather than pretending — a sandbox you believe in but do not have is worse than none.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultHidden = []string{
"~/.ssh",
"~/.aws",
"~/.gnupg",
"~/.config/gh",
"~/.antares/.env",
"~/.kube",
"~/.docker/config.json",
}
DefaultHidden is what stays out of a sandbox unless someone says otherwise. These are the paths an agent has no business reading, and the ones an injected instruction would go for first.
Functions ¶
Types ¶
type Mode ¶
type Mode string
Mode names how much confinement to apply.
const ( // None runs commands directly. None Mode = "none" // Auto picks the strongest mechanism available and falls back quietly. Auto Mode = "auto" // Bubblewrap confines filesystem and network. Needs bwrap installed. Bubblewrap Mode = "bubblewrap" // Namespace blocks the network with a user namespace. Needs no tools, but // leaves the filesystem alone. Namespace Mode = "namespace" )
type Policy ¶
type Policy struct {
// Workspace is writable. Everything else is read-only under bubblewrap.
Workspace string
// AllowNetwork leaves the network reachable. Off means no network at all,
// not a filtered one.
AllowNetwork bool
// ReadOnly adds paths the command may read but not change.
ReadOnly []string
// Hidden names paths to keep out of the sandbox entirely — credentials,
// mostly.
Hidden []string
}
Policy is what a confined command may reach.