[feat] CLI-01: capability gate defaults to open + STAR_CAPS env#10
Merged
Conversation
…-18) Per maintainer decision, flip the capability posture: the CLI is OPEN by default (every wired module loadable, including cmd) so scripts just work, and sandboxing is opt-in rather than the default. - New 'open' tier (everything incl. exec) is the default; --caps now accepts open|full|network|safe and an empty value resolves to open. - STAR_CAPS env var sets the default tier for a deployment (an explicit --caps still wins). A deployment locks down with STAR_CAPS=safe. - When the grant is fully open, BuildBox installs NO policy (plain starbox.New) -- exactly the permissive pre-gate behavior, so an unknown -m module errors at the loader again (TestProcess_DirectCode_UnknownModule restored). A restrictive tier/flag still builds NewWithPolicy and gates loading. - An unrecognised --caps value is rejected with a clear error rather than silently falling open, so a typo'd lockdown (e.g. STAR_CAPS=saef) fails loud. The gate machinery, the union classification (web/s3/sqlite = net|fs), and the cmd-gated-alone rule are unchanged -- only the default and the env knob are new. README + flag help updated. Coverage 73.2%; Docker golang:1.22 green.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Default posture → open (opt-in sandboxing), with a
STAR_CAPSenv knobPer maintainer decision, flip the capability model: the CLI is open by
default (every wired module loadable, including
cmd) so scripts just work,and sandboxing is opt-in rather than the default-deny shipped in #8.
What changed
opentier (everything incl. exec) is the default.--capsnowaccepts
open | full | network | safe; an empty value resolves toopen.STAR_CAPSenv var sets the default tier for a whole deployment (anexplicit
--capsstill wins). Lock a deployment down withSTAR_CAPS=safe.BuildBoxinstalls no policy (plainstarbox.New) — exactly the permissive pre-gate behaviour, so an unknown-mmodule errors at the loader again (the characterization test for that isrestored). A restrictive tier/flag still builds
NewWithPolicyand gates.--capsvalue is rejected with a clear error rather thansilently falling open — a typo'd lockdown (
STAR_CAPS=saef) fails loud, not open.Unchanged
The gate machinery, the union classification (
web/s3/sqlite=net|fs),and the
cmd-gated-alone rule all stay — only the default and the env knobare new.
README + flag help updated. Coverage 73.2% (≥ 65); Docker
golang:1.22green.