Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeniedHint ¶ added in v0.262.0
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
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
Child is the bash child for one command, with the confinement its platform applies: Landlock on Linux, Seatbelt on macOS, nothing elsewhere. Cmd is set up like any exec.Cmd and must Start through Child. WritePaths is what the kernel lets it write, nil when unconfined.
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
Unconfined returns the bash child that runs command with the permissions of the CLI process, for a command somebody approved.