sandboxinfra

package
v0.262.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 16, 2026 License: Apache-2.0 Imports: 17 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeniedHint added in v0.262.0

func DeniedHint(output string) string

DeniedHint names the sandbox when a confined command failed on a write or a read the kernel refused, so the model asks for the path instead of retrying.

func Enforced added in v0.262.0

func Enforced(cfg *config.Config) bool

Enforced reports whether Command confines its child on this platform.

func KernelDenied added in v0.262.0

func KernelDenied(cfg *config.Config) []sandboxdomain.Denied

KernelDenied lists the blocking deny entries the kernel itself refuses to read, rename or delete under Command, empty where the platform cannot.

func KernelName added in v0.262.0

func KernelName() string

KernelName names the confinement this platform applies, empty where there is none.

func PersistGrant

func PersistGrant(grant sandboxdomain.Allowed) error

PersistGrant adds an approved grant to the userspace ~/.infer/sandbox.yaml. A write grant goes first so it wins over a narrower read-only entry, a read grant goes last so it never shadows a write entry. A grant inside a config dir is refused and stays session-only.

Types

type Child added in v0.262.0

type Child struct {
	Cmd *exec.Cmd
	// WritePaths is what the kernel lets the child write, nil when unconfined.
	WritePaths []string
}

Child is the bash child for one command, with the confinement its platform applies: a Landlock ruleset on the thread that forks it on Linux, a Seatbelt profile around it on macOS, nothing elsewhere. Cmd is set up like any exec.Cmd, and Start is the one call that has to go through Child.

func Command added in v0.262.0

func Command(ctx context.Context, cfg *config.Config, mode agentdomain.AgentMode, command string) *Child

Command returns the bash child that runs command. Where the policy enforces and the platform can, the kernel confines the child's writes to sandbox.WritePaths and its reads of the blocking deny entries, so the command cannot reach past the policy whatever its arguments say. The Bash tool uses it unattended for allow-listed commands: approved ones run as approved.

func Unconfined added in v0.262.0

func Unconfined(ctx context.Context, command string) *Child

Unconfined returns the bash child that runs command with the permissions of the CLI process, for a command somebody approved.

func (*Child) Start added in v0.262.0

func (c *Child) Start() error

Start starts the child the way its platform confines it.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL