Documentation
¶
Overview ¶
Package sandboxhost is the single source of truth for host-access capabilities. It expands a config.HostConfig for a launch agent into a nono profile (what the host process may touch) and the coordinated Claude permission-deny rules (what the agent's own file tools may not read). The nono-specific JSON rendering lives here; nothing about nono leaks into the user-facing config.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Resolved ¶
type Resolved struct {
DenyRules []string
// contains filtered or unexported fields
}
Resolved is the outcome of expanding a HostConfig: the nono profile to write and the deduped Claude permission-deny rules to inject via --settings.
func Resolve ¶
Resolve expands cfg.Sandbox.Host for the given launch agent. All output lists are sorted and de-duplicated so the result is deterministic.
func ResolveCommand ¶ added in v0.15.0
ResolveCommand builds the profile for a single brokered command: the working directory read+write, the non-credential capabilities from cfg.Sandbox.Host, the env allowlist from cfg.Sandbox.Command.EnvPassthrough, and the fixed developer network profile plus cfg.Sandbox.Network.AllowDomains.
It deliberately does not reuse Resolve: the command sandbox is a different policy, not a variation of the agent's, and sharing the expansion would make it easy to leak a credential grant into it by accident.
func (*Resolved) EnvAllowVars ¶ added in v0.15.0
EnvAllowVars returns the profile's environment allow_vars patterns.
The command broker uses it to build the nono supervisor's own environment: it forwards exactly those of the launcher's variables that this list already permits inside the sandbox. Sharing the list keeps the two in step — in particular baselineEnv and the capability allowVars (the mise capability's "MISE*" / "__MISE*") are declared in exactly one place, this package, rather than being restated by the broker where they could silently drift.
Entries are patterns, not plain names; see broker's envAllowlist for the supported syntax.
func (*Resolved) ProfileJSON ¶
ProfileJSON marshals the resolved nono profile.
func (*Resolved) WriteProfile ¶
WriteProfile marshals the profile to a 0600 temp file and returns its path plus a cleanup func that removes it. The file is read by nono itself on the host before the sandbox applies, so callers do NOT grant --read-file for it.