Help us shape the future of Go! Take the 2026 Go Developer Survey

sandbox

package
v0.13.2 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package sandbox confines agent-selected commands with Landlock. The worker re-executes itself with a landlock-exec subcommand, which calls Restrict and then execs the real program, because Go cannot run code between fork and exec.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ABI

func ABI() (int, error)

ABI reports the Landlock ABI version of the running kernel, or 0 when the kernel does not support Landlock or it is disabled.

func Restrict

func Restrict(runRoot string) error

Restrict confines the calling thread to the system toolchain paths plus full access under runRoot. It is irreversible and inherited across exec, so call it from the thread that will exec the confined program.

func RestrictWithPaths

func RestrictWithPaths(runRoot string, readExecPaths, readWritePaths []string) error

RestrictWithPaths additionally grants full access to operator-selected writable state directories. Both path lists must come from trusted runtime configuration, never agent-controlled command arguments.

func RestrictWithReadExec

func RestrictWithReadExec(runRoot string, readExecPaths []string) error

RestrictWithReadExec confines the calling thread like Restrict and grants read/execute access to operator-selected toolchain paths. The caller must derive these paths from the worker environment, never agent input.

Types

This section is empty.

Jump to

Keyboard shortcuts

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