Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DenyInit ¶ added in v0.9.3
func DenyInit(args []string)
DenyInit is called early in main when the binary is re-exec'd as a sandbox wrapper. It runs as root (UID 0) inside the user namespace so it can:
- Mount tmpfs over denied paths to hide their contents
- Apply write isolation: make HOME read-only, then bind writable sub-mounts
After setup, it spawns the agent in a nested user namespace (via exec.Command + CLONE_NEWUSER) mapped to the real UID.
Args format: --uid UID --gid GID [--deny PATH...] [--home PATH] [--writable PATH...] -- CMD ARGS...
Types ¶
type Config ¶
type Config struct {
Isolation Level
Mounts []Mount
Deny []string // paths to mask (e.g. ~/.ssh)
NetworkNeed NetworkNeed // granular network access required by the agent
Timeout time.Duration
CPULimit time.Duration // RLIMIT_CPU (0 = backend default)
MemLimit uint64 // RLIMIT_AS in bytes (0 = backend default)
MaxFDs uint32 // RLIMIT_NOFILE (0 = backend default)
}
Config holds sandbox creation parameters.
type EnforcementError ¶ added in v0.8.4
EnforcementError is returned when the system cannot enforce the requested sandbox config.
func (*EnforcementError) Error ¶ added in v0.8.4
func (e *EnforcementError) Error() string
type Mount ¶
type Mount struct {
Source string
Target string
ReadOnly bool
UseRegex bool // macOS: emit regex rule instead of subpath (covers adjacent files like ~/.claude.json)
}
Mount describes a filesystem mount for the sandbox.
type NetworkNeed ¶ added in v0.9.8
type NetworkNeed int
NetworkNeed describes how much network access an agent requires.
const ( NetworkNone NetworkNeed = iota // fully isolated NetworkLocal // localhost only (e.g. ollama) NetworkHTTPS // outbound 443/80 + DNS 53 NetworkFull // no restrictions )
func (NetworkNeed) String ¶ added in v0.9.8
func (n NetworkNeed) String() string
Click to show internal directories.
Click to hide internal directories.