host

package
v0.32.1 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: MIT Imports: 10 Imported by: 0

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

func New(cfg map[string]any) (sandbox.Sandbox, error)

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) Close

func (b *Backend) Close() error

Close is a no-op for the host backend.

func (*Backend) Exec

Exec dispatches the request. v1 supports KindShell only.

Jump to

Keyboard shortcuts

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