Repository navigation
v0.5.1
Controls guaranteed in this release (v0.5.1)
Sandboxed live discovery (Legislator)
generate-policy --live-discovery now executes the target server inside the OS sandbox by default instead of bare on the host:
- The probe runs with a private TMPDIR cwd, no ambient environment inheritance, and no network; fs grants are scoped to the verified image, the interpreter's install prefix (resolved and argv0 spellings, including venv
pyvenv.cfghome bases),node_modulesancestor roots, PATH-resolved helper prefixes,/etc/ssl/**, and a/dev/nullwrite — matching the documented runtime profiles - The probe's syscall surface follows the documented interpreter baselines (
uname,eventfd2,timerfd_*,socketpair, …), so Node'suv_loop_initand CPython startup work under seccomp --unsafe-unsandboxed-discoveryis the documented opt-out (implies--live-discovery, ambient environment);--self-testnever uses it- Carve walks run on the blocking pool under a shared deadline; a timed-out or failed walk refuses the spawn with an
Inconclusiveverdict — discovery never proceeds unguarded - Argument-derived carve roots skip option tokens and expand around reserved secret names (
.env,.ssh,.gnupg,.aws) into per-entry grants with the excluded paths recorded as denied
Pinned workloads / verifier
entrypoint-hashpinned scripts now launch by their real path instead of a snapshot spelling — Node ESM servers with relative imports andnode_modulesancestor walks run under the pin on all three OSes, closing the v0.5.0 limitation. The executable keeps its snapshot exec (memfd/staged/share-mode handle);server.connecteddistinguishesexe_exec=fd|stagedfromentrypoint_exec=path- On the namespaced route init re-reads the pinned object through the held descriptor, re-hashes it against the manifest digest, and bind-mounts the verified bytes over the payload path — the verify→exec window is closed in-namespace, not just narrowed
- fs grants rooted under a masked tree (
/run, and/tmpwhen the resolv.conf bridge needs it) or on filesystems Landlock cannot mediate (WSL drvfs/9p) refuse before spawn with the cause named — dead policy never reaches launch - Windows holds the share-mode pin for the entire session, blocking a payload swap outright
Policy
policy version=3: allow sides compose additively (union) across extends/include/when/profile/server-defaults layers; a block opts back into v2 replacement withreplace=#true.defaults.syscallsgainsdenyentries that deny-wins prune everywhere (aliases share the syscall number — a deniedforkclosesclone); a tool may name multiple profiles; bareallow none=#truerequiresreplace=#true. The spawn execve gate requires a literalexecvegrant. v1/v2 documents keep their semantics, guarded at parse, schema, and validationpolicy resolve --version-diffreports each effective field the rule change moves;checkreplays the load under v3 and reports an informationalmigrationmember (unchanged/fields_differ/simulation_failed) — status, reason_code, and the exit code never move// REVIEWmarkers carry kinds (header,schema-unsupported,blocked-capability,unbound-tool,hash-pin-host,regenerate-on-update,unbound-workload,runtime-seed) with per-kind remediation incheckoutput and in generated draftsgenerate-policyseeds runtime fs/environment defaults for interpreted workloads — interpreter prefix, venv/pyvenv.cfghome validated against a real base install, package trees — plus the interpreter seccomp baseline, markedruntime-seedREVIEWdefaults.environmentnames absent from the parent environment (or holding a dangling absolute path) surface as names-only diagnostics onlaunch.env,server.connected(env_missing=/env_path_missing=), and stderr — never values, never a refusal
Auditor
- The session call tally (per-tool calls and denials) is bounded by entry-count and byte budgets with
truncatedflags; the denial tally counts target-policy denials only. The launch report forwards the tally and correction candidates - The
tools/listverified-set recheck and the child write hold one epoch so the gate cannot flip mid-write; the epoch-held write is bounded (5s) and poisons the stdin writer on timeout — a stalled write can no longer deadlock the session - A 16 MiB shared budget bounds retained
tools/listpage bytes in both the discovery accumulator and the Auditor relay — page/frame caps alone no longer admit unbounded tool definitions tools_list.filterednow recordsoutcome=success(a filtered list is a successful shaped response); blocked verification records are committed instead of dropped- Init-order denials name the offending direction to the peer
tools/callrefusals for unadvertised names stay membership-blind on the wire but audit as authorization denialsjs_bind: TypeScript return-type annotations in arrow heads parse, keyword matching is whole-identifier, dynamicchild_processre-aliases resolve as unresolved,...restimports bind as namespaces — a semicolon-free arrow can no longer steal the next declaration's body; Python tool registrations report output-cap truncation
Audit
- Schema "2.0": every record carries a
session_idunique within the same millisecond;policy.loadedorderssession_idbefore the percent-encodedsourceso byte-budget truncation cannot clip the identifier;secret_overlay=falseis recorded when the overlay is off;allow_replaceable_paths:trueis recorded when the opt-out env is set - SIGUSR1 reopens a live file sink — logrotate coexistence on Unix
- The audit sink pins its parent directory and re-verifies the leaf name still names the opened file before committing durable acknowledgments — entry-swap attacks surface as audit failures
Linux / namespaced
CLONE_NEWPIDis probed at selection andpidnsis reported as measured evidence;/procremount readiness is probed soautono longer selects a route that fails at init- DNS-gate bind races are retried; SCM_RIGHTS cmsg is validated before the fd read; deny-wins is enforced across seccomp layers and an
execvedeny is refused underallow_degraded
Security hardening (fail-closed)
- Trusted policy sources: the root document and every file it reaches (extends/include ancestors,
@fileschemas) must sit on owned, write-restricted, replacement-resistant paths on every launch route — replaceable sources refuse.MCP_WRIT_ALLOW_REPLACEABLE_PATHSis the documented opt-out, is recorded on the launch report, and marks the gateunverifiedinplan - Descendant teardown: a supervised launch refuses without a kernel-enforced teardown path;
setsid/pgid escapees are attributed by a per-launch lineage tag and killed via a pre-kill descendant snapshot plus the subreaper orphan sweep — sibling sessions' children are never signaled; releasing a child handle sweeps its descendants - Guard environment variables (
MCP_WRIT_*) are stripped from workload environments; share roots are bounded by a registry; malformed CNAME/DNAME targets fail closed - Driver/helper resolution is pinned to administrator-owned objects with fail-closed re-verification; handle-pinned reads stay within a canonical root; group-writable components are refused; inode ctime is pinned; exec duplicates use
F_DUPFD_CLOEXEC - Mach-O executable sections are bounded and coalesced; the discovery tmpdir is created exclusively at 0700
- DNS: authority/additional section names are judged against explicit deny rules only — delegation NS/glue outside the allowlist mints no grants but no longer refuses the response; revalidation races and unjudged sections fail closed
- Release authorization: the workflow's
release-gatejob requires the tag commit reachable from the default branch and a pusher holding admin/maintain
CLI
<subcommand> --helpnow shows that subcommand's options instead of the sibling list; stray sibling tokens route to the correct parser
Compatibility / migration
- Audit schema 2.0:
session_idadded to every record;policy.loadedtoken order changed;sourcepercent-encoded — update external log parsers --live-discoveryis sandboxed by default; pass--unsafe-unsandboxed-discoveryto restore ambient execution- Policies reachable through replaceable paths now refuse — CI/shared workspaces need
MCP_WRIT_ALLOW_REPLACEABLE_PATHS=1, which is always reported entrypoint-hashlaunches by real path: on the native POSIX and Windows routes the verify→exec window narrows to the pre-spawn path re-check (Windows additionally holds the share-mode pin); only the namespaced bind-mount closes it entirely- v3 composition is opt-in; v1/v2 semantics are unchanged and
check's migration preview is informational
Validation
release-preflight.sh still gates the tag on six workflows at the exact commit. New coverage: pinned Node entrypoint e2e with an ESM relative import (initialize + tools/list under the pin on all three OSes), env-gap diagnostics, v3 migration preview, cgroup-v2 delegation plus capability probes on hosted runners, and trusted-source DACL fixtures.
Remaining limitations
entrypoint-hash: on POSIX-native and Windows the verify→exec window narrows to the pre-spawn path re-check; only the namespaced bind-mount removes it- v3 migration is preview-only — no
generate-policyoutput switch yet; drafts still emit v2-style documents - The discovery sandbox covers the interpreted runtimes exercised in CI (Node, Python, Go fixture); loaders outside the documented runtime surface may still need
--unsafe-unsandboxed-discovery ebpf-run/macos-proxy-runremain opt-in PoCs;namespaced-runstayspocin the capability matrix- namespaced: names sharing an IP are indistinguishable; DoH via an allowed destination and DoT remain structural limits; link-local v6 is refused; external v6 needs host reachability
- Windows unchanged: no destination pinning under AppContainer,
psecconditional,os.fs=unknownby default - Landlock ABI < 6 → AF_UNIX/signal
not_applied; pathunix=needs ABI ≥ 9 - Kernel-internal denials remain unobservable (
file_denied/process_deniedstay reserved event types) defaults.environmentgaps are diagnosed, not auto-correctedSECURITY.mdis not yet published; the six release workflows run on manual dispatch- TOCTOU between RPC checks and internal server behavior remains a design boundary; SIGKILL can lose the audit tail — use
--audit-sync