config

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDeprecatedNetworkKeys = errors.New("sandbox.network.allow_cidrs / allow_hosts are no longer supported; use allow_domains")
View Source
var ErrDropRuleMissingPattern = errors.New(`each sandbox.command.drop entry requires a non-empty "pattern"`)
View Source
var ErrEnvPassthroughNonoVar = errors.New(`sandbox.command.env_passthrough must not contain NONO_* variables: they reconfigure the command sandbox itself`)
View Source
var ErrInvalidToolMode = errors.New(`invalid tool_mode (must be "mcp" or "hook")`)
View Source
var ErrMissingMCPCommandOutputDir = errors.New("missing required field: mcp.command_output_dir")
View Source
var ErrRemovedAllowExternal = errors.New("sandbox.network.allow_external is no longer supported: use sandbox.network.allow_domains")
View Source
var ErrRemovedContainerSection = errors.New("sandbox.container is no longer supported: commands now run under nono, not Docker; remove the section")

Functions

This section is empty.

Types

type CommandConfig added in v0.8.0

type CommandConfig struct {
	Allow          []string   `toml:"allow"`
	Drop           []DropRule `toml:"drop"`
	EnvPassthrough []string   `toml:"env_passthrough"`
}

type Config

type Config struct {
	ToolMode string        `toml:"tool_mode"`
	MCP      MCPConfig     `toml:"mcp"`
	Sandbox  SandboxConfig `toml:"sandbox"`
}

func Load

func Load(path string) (*Config, error)

Load composes the optional user-scope config (~/.config/agent-sandbox/config.toml) with the project-scope config at path, then validates the merged result. Scalars: project overrides user. Lists (command.allow, command.drop, command.env_passthrough, network.allow_domains, and the sandbox.host lists): de-duplicated union.

type DropRule added in v0.14.3

type DropRule struct {
	Pattern string `toml:"pattern"`
	Message string `toml:"message"`
}

DropRule is one drop pattern with an optional custom refusal message. Every drop entry is written as a table so the shape is the same with or without a message:

drop = [
  { pattern = "git *" },
  { pattern = "gh *", message = "gh is disabled" },
]

An omitted message leaves Message empty, and the router falls back to the default `dropped: command matches drop pattern "<pattern>"` line.

type HostConfig added in v0.13.0

type HostConfig struct {
	Capabilities []string `toml:"capabilities"`
	Allow        []string `toml:"allow"`
	Read         []string `toml:"read"`
	AllowFile    []string `toml:"allow_file"`
	ReadFile     []string `toml:"read_file"`
	AllowEnv     []string `toml:"allow_env"`
}

HostConfig declares, in nono-agnostic terms, the host-side access the sandboxed agent process gets. Capabilities are named bundles expanded by internal/sandboxhost; the remaining lists are raw grants.

type MCPConfig added in v0.8.0

type MCPConfig struct {
	CommandOutputDir string `toml:"command_output_dir"`
}

type NetworkConfig added in v0.8.0

type NetworkConfig struct {
	AllowDomains []string `toml:"allow_domains"`
}

type SandboxConfig

type SandboxConfig struct {
	Network NetworkConfig `toml:"network"`
	Command CommandConfig `toml:"command"`
	Host    HostConfig    `toml:"host"`
}

Jump to

Keyboard shortcuts

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