Skip to content

sandbox: native enforcement degrades silently on a manual 'make build' (no warning anywhere) #1041

Description

@FabioLeitao

Version / branch / commit

main @ f30f550, built manually via go build (not make build-all).

OS and environment

LMDE 7 (gigi) / Linux 6.12 / Go 1.26.6 / amd64

Steps to reproduce

  1. Clone the repo, build with go build -o zero ./cmd/zero (or plain make build) instead of
    make build-all.
  2. Run zero sandbox policy.
  3. Run zero doctor.

Expected behavior

Either the companion zero-linux-sandbox helper is produced by the normal build path too, or the
CLI/TUI actively surfaces that native sandbox enforcement is unavailable — ideally at the start of
a session that will run exec_command/write_file/etc, not only when a user thinks to run
zero doctor explicitly.

Actual behavior

zero sandbox policy reports:

enforcement_level: degraded
backend_native_isolation: false
backend_available: false
downgrade_reason: Linux sandbox helper is not available

bwrap is installed and functional — the missing piece is the zero-linux-sandbox companion
binary (cmd/zero-linux-sandbox/), which is only produced by make build-all, not by
make build/plain go build. Nothing outside of zero doctor (run explicitly) surfaces this —
the TUI and zero exec proceed normally with reduced isolation and no visible indication. A
session can run many tool calls with the native sandbox effectively off and nobody notices.

Root cause detail: selectPlatformBackend (internal/sandbox/manager.go) resolves the helper via
a plain $PATH lookup (lookupExecutable); it does not check the directory next to the running
zero binary (a different lookup path, findLinuxSandboxHelperCommand in
internal/sandbox/linux_helper.go, does check that, but it isn't what backend selection uses).

Relevant logs, screenshots, or error messages

$ zero sandbox policy
mode: enforce
network: deny
backend: unavailable
enforcement_level: degraded
requires_platform_sandbox: true
downgrade_reason: Linux sandbox helper is not available
backend_available: false
backend_native_isolation: false
warning: native process isolation unavailable on linux
warning: shell commands are not wrapped by a native platform sandbox

I have a candidate fix (TUI banner + persistent indicator, structured warning at the start of
zero exec, and producing zero-linux-sandbox from the normal make build target on Linux) on a
personal fork, tested against the full local gate (fmt, vet, full test suite, cross-compiled tests
for darwin/windows, lint, govulncheck — all green) — happy to open a PR against an approved issue
per CONTRIBUTING.md once/if this is triaged as worth fixing.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue-approvedReviewed and approved by the core team; community PRs may implement this issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions