sandbox

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: AGPL-3.0 Imports: 9 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

Overview

Package sandbox runs the agent's converters' work in limited child processes of the agent's own binary (the WebP / AVIF and Markdown converters, ADR-0043): bounded memory, no files, few descriptors, no capabilities, no_new_privs, killed with the agent.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Limit

func Limit(memory int64) error

Limit bounds the child: its writable private memory (RLIMIT_DATA, which Linux counts for anonymous mappings; RLIMIT_AS would also count the address space the Go runtime reserves without using it) to what it already has plus memory plus headroom, no file it could write, at most 16 descriptors, no_new_privs, and no capabilities (the agent may hold CAP_NET_BIND_SERVICE as an ambient capability). A limit the child inherited lower stays as it is: raising a hard limit needs CAP_SYS_RESOURCE.

func SelfCommand

func SelfCommand(exe string) func(ctx context.Context, args []string) *exec.Cmd

SelfCommand returns a converter's Command for exe: the child gets no environment but GOMAXPROCS=1 (one CPU per child; the agent's environment may hold secrets) and dies with the agent.

func SelfExecutable

func SelfExecutable() string

SelfExecutable is the binary children run: this process's own (/proc/self/exe on Linux, so a replaced binary on disk changes nothing until the agent restarts).

Types

This section is empty.

Jump to

Keyboard shortcuts

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