config

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAgentProfileMissing = errors.New("agent profile not found; write it, or point [agents.<name>].profile at it")

ErrAgentProfileMissing fires when the nono profile the launched agent runs under is not on disk. There is deliberately no generated fallback: agent-sandbox no longer builds profiles at all, and a default that looked present while granting the wrong thing is the worst failure available.

View Source
var ErrCommandProfileMissing = errors.New("command profile not found; write it, or point command_profile at it")

ErrCommandProfileMissing fires when the nono profile execd runs under is not on disk. There is deliberately no built-in fallback: agent-sandbox does not generate profiles, a static default cannot absorb host differences (/nix/store versus /usr/bin), and a profile that looks present but refuses every command is the worst failure mode available.

View Source
var ErrDeprecatedNetworkKeys = errors.New("sandbox.network.allow_cidrs / allow_hosts are no longer supported; network reach for a command is the command profile's top-level network section")
View Source
var ErrMovedAgentHost = errors.New("sandbox.agent.host is no longer supported: agent-sandbox does not generate nono profiles; write the grants in the profile named by [agents.<name>].profile")
View Source
var ErrMovedAgentSectionToProfile = errors.New("[sandbox] is no longer supported: agent-sandbox does not generate nono profiles; write the grants in the profile named by [agents.<name>].profile")

ErrMovedAgentSectionToProfile fires on [sandbox] and everything under it. The section described host access agent-sandbox turned into a nono profile; nothing generates profiles now, so the grants live in the file named by [agents.<name>].profile, written in nono's own schema.

View Source
var ErrMovedCommandHost = errors.New("sandbox.command.host has moved: a command's host access is now expressed in the command profile, which agent-sandbox does not generate")
View Source
var ErrMovedCommandNetwork = errors.New("sandbox.command.network has moved: network reach for a command is the command profile's top-level network section")
View Source
var ErrMovedCommandTiers = errors.New("sandbox.agent.allow_commands / drop_commands are no longer supported: which commands may run, and which invocations are refused, are now command_policies entries in the command profile")

ErrMovedCommandTiers fires on the two keys that used to decide, per command, whether it ran on the host or in the shell sandbox. That decision is now made entirely by the operator's command profile: a command_policies entry either exists for a command or it does not, and invocation_policy rules refuse specific invocations of it. Neither concept survives as a config key.

View Source
var ErrMovedEnvPassthrough = errors.New("sandbox.command.env_passthrough has moved: env passthrough for a command is the command profile's own concern now")
View Source
var ErrMovedNetworkSection = errors.New("sandbox.network has moved: it only ever configured commands run through execd, so network reach is now the command profile's top-level network section")
View Source
var ErrMovedSharedToAgent = errors.New("sandbox.shared is no longer supported: agent-sandbox does not generate nono profiles; write the grants in the profile named by [agents.<name>].profile")

ErrMovedSharedToAgent fires on [sandbox.shared], which existed only because agent-sandbox used to generate two profiles that both needed some of the same grants. It generates neither now — both are files the operator writes in nono's own schema — so there is nothing left for a shared base to feed.

View Source
var ErrMovedShellToProfile = errors.New("sandbox.shell is no longer supported: the sandbox execd runs commands in is the command profile, which you write")

ErrMovedShellToProfile fires on [sandbox.shell]. The sandbox it used to configure — the one each command run through execd ran in — no longer exists as something agent-sandbox generates; it is the operator-written command profile instead.

View Source
var ErrRemovedAllowExternal = errors.New("sandbox.network.allow_external is no longer supported: network reach for a command is the command profile's top-level network section")
View Source
var ErrRemovedContainerSection = errors.New("sandbox.container is no longer supported: commands now run under nono, not Docker; remove the section")
View Source
var ErrRemovedMCPSection = errors.New("[mcp] is no longer supported: command output is returned inline by the PreToolUse hook, so remove the section")

ErrRemovedMCPSection fires on [mcp] and everything under it. Its one key, command_output_dir, existed because the MCP tool wrote each command's output to files; the hook returns output inline in the tool result, so there is no directory to name.

View Source
var ErrRemovedToolMode = errors.New(`tool_mode is no longer supported: the PreToolUse hook is the only mode, so remove the key`)

ErrRemovedToolMode fires on tool_mode, whatever it is set to. The key used to choose between the PreToolUse hook and an MCP server; the MCP server is gone, so the hook is the only way commands reach execd and there is nothing left to select. Ignoring the key would be worse than refusing it: a config still saying "mcp" would launch a hook-routed session while its author believes Bash is disabled.

Functions

This section is empty.

Types

type AgentConfig added in v0.16.0

type AgentConfig struct {
	Profile string `toml:"profile"`
}

AgentConfig is one launchable agent's configuration. It holds only the nono profile that agent runs under — a file the operator writes in nono's own schema, which agent-sandbox hands to nono without generating, reading, or validating it.

A second field would need care. Load decodes the user config and then the project config into the same map, and a key present in both is replaced wholesale rather than merged field by field, so a project [agents.claude] setting only one field would silently drop the user config's others.

type Config

type Config struct {
	// CommandProfile names the nono profile execd runs under. It
	// is written by the operator in nono's own schema, not generated: every
	// decision about commands — which may run, what each may touch, which
	// invocations are refused — lives there. An empty value means the default
	// name beside this config file.
	CommandProfile string `toml:"command_profile"`
	// Agents maps a launch subcommand's name ("claude") to that agent's
	// configuration. An absent table is not an error: every key has a default.
	Agents map[string]AgentConfig `toml:"agents"`
	// contains filtered or unexported fields
}

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.

func (*Config) AgentProfilePath added in v0.17.0

func (c *Config) AgentProfilePath(agent string) string

AgentProfilePath is the absolute path of the nono profile the named agent runs under. It resolves exactly like CommandProfilePath — one rule for both profiles — so an absent table or empty value means "<agent>-profile.json" beside the project config, and a relative path joins onto that same directory however agent-sandbox was invoked.

func (*Config) CommandProfilePath added in v0.17.0

func (c *Config) CommandProfilePath() string

CommandProfilePath is the absolute path of the nono profile execd runs under.

Jump to

Keyboard shortcuts

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