config

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 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_external (bool)")
View Source
var ErrInvalidToolMode = errors.New(`invalid tool_mode (must be "mcp" or "hook")`)
View Source
var ErrMissingContainerBuildContext = errors.New("missing required field: sandbox.container.build_context")
View Source
var ErrMissingContainerDockerfile = errors.New("missing required field: sandbox.container.dockerfile")
View Source
var ErrMissingContainerImage = errors.New("missing required field: sandbox.container.image")
View Source
var ErrMissingGithubMCPSecret = errors.New("missing required field: claude.github_mcp.secret (required when enabled)")
View Source
var ErrMissingMCPCommandOutputDir = errors.New("missing required field: mcp.command_output_dir")

Functions

This section is empty.

Types

type ClaudeConfig

type ClaudeConfig struct {
	GithubMCP GithubMCPConfig `toml:"github_mcp"`
}

type CommandConfig added in v0.8.0

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

type Config

type Config struct {
	ToolMode string        `toml:"tool_mode"`
	MCP      MCPConfig     `toml:"mcp"`
	Claude   ClaudeConfig  `toml:"claude"`
	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, container.env_passthrough, and the sandbox.host lists): de-duplicated union.

type ContainerConfig

type ContainerConfig struct {
	BuildContext    string   `toml:"build_context"`
	Dockerfile      string   `toml:"dockerfile"`
	Image           string   `toml:"image"`
	ExternalNetwork string   `toml:"external_network"`
	EnvPassthrough  []string `toml:"env_passthrough"`
}

type GithubMCPConfig added in v0.13.0

type GithubMCPConfig struct {
	Enabled bool   `toml:"enabled"`
	Secret  string `toml:"secret"`
}

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 {
	AllowExternal bool `toml:"allow_external"`
}

type SandboxConfig

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

Jump to

Keyboard shortcuts

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