Documentation
¶
Overview ¶
Package host is the trivially-isolated sandbox backend: shell commands run directly via os/exec against the host kernel. Useful as the fallback for `tools/shell` until a stricter backend (gVisor / Firecracker / landlock) lands. Honors `allowed_commands`, `working_dir`, `path_dirs`, and the legacy env-restriction flag.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
New builds a Backend from the per-plugin sandbox config block.
Recognised keys (all optional):
allowed_commands: ["git", "npm"] — empty/absent = unrestricted
working_dir: "~/.nexus/work" — passed through ExpandPath at the
caller; this layer takes the
string verbatim.
path_dirs: ["/opt/bin"] — prepended to PATH at exec time.
timeout: "30s" — default per-Exec deadline.
env_restrict: true — clear env to a minimal allowlist.
Types ¶
type Backend ¶
type Backend struct {
// contains filtered or unexported fields
}
Backend implements sandbox.Sandbox for the host process.
func (*Backend) Capabilities ¶
func (b *Backend) Capabilities() sandbox.CapabilitySet
Capabilities reports what the host backend can enforce.
func (*Backend) Exec ¶
func (b *Backend) Exec(ctx context.Context, req sandbox.ExecRequest) (sandbox.ExecResult, error)
Exec dispatches the request. v1 supports KindShell only.
Click to show internal directories.
Click to hide internal directories.