Repository navigation
Description
Context & Rationale
Executable Verification Criteria landed (#432): execute_criterion_command (src/devops_cli/ai/review/review_environment.py:230-295) runs model-authored commands in the reviewed repo for findings reaching verification.py:1229, confined only by a string allowlist and a process group. Its docstrings promise a "closed read-only allowlist" (:193) and a "bounded subprocess sandbox" (:231), yet the validator accepts reads anywhere (cat /etc/passwd, find /), writes via python3 -c, python3 -m pip install, and pytest, which runs the reviewed branch's code. Separately, container controls are literal SDK kwargs that disagree: sandbox/engine.py:231-235 sets read_only and a noexec tmpfs; docker/sandbox.py:266-270, the runner behind devops docker and devops test, sets neither; commands/sandbox.py:183-188 prints a third hand-typed copy. vibes renders one frozen policy with per-engine argv tests (examples/ephemeral-container-sandbox/sandbox.py:59-76,266-303).
Scope & Deliverables
- Context & Rationale*: Executable Verification Criteria landed (feat(cli): executable verification criteria #432):
execute_criterion_command(src/devops_cli/ai/review/review_environment.py:230-295) runs model-authored commands in the reviewed repo for findings reachingverification.py:1229, confined only by a string allowlist and a process group. Its docstrings promise a "closed read-only allowlist" (:193) and a "bounded subprocess sandbox" (:231), yet the validator accepts reads anywhere (cat /etc/passwd,find /), writes viapython3 -c,python3 -m pip install, andpytest, which runs the reviewed branch's code. Separately, container controls are literal SDK kwargs that disagree:sandbox/engine.py:231-235setsread_onlyand anoexectmpfs;docker/sandbox.py:266-270, the runner behinddevops dockeranddevops test, sets neither;commands/sandbox.py:183-188prints a third hand-typed copy. vibes renders one frozen policy with per-engine argv tests (examples/ephemeral-container-sandbox/sandbox.py:59-76,266-303). - Deliverable*: PR1: adopt bubblewrap behind a narrow
HostSandboxseam and routeexecute_criterion_commandthrough it:--unshare-all --new-session --die-with-parent --clearenvwith an explicit environment,--ro-bindof/usr(pluslib/lib64/binsymlinks) and the repo root,--tmpfs /tmp, no$HOME,$XDG_RUNTIME_DIRor session bus, so keyring,ghanddevopscredentials stay unreachable. Live tests: the child reads the repo, cannot list/homeor write the repo, andconnectto a non-loopback address fails. Addbubblewrapto.devcontainer/Dockerfile(installed today only incidentally) and document it as a host requirement. PR2: a frozen PydanticSandboxPolicyinsandbox/models.pyconsumed by both_build_create_kwargsandHostSandbox, tested for identical security kwargs from both builders; delete the uncalledSandboxNetworkConfig.to_docker_args(models.py:278) and its tests. The drafted Sandbox Enforcement Audit (devops sandbox audit) reads DECLARED from this policy; whichever lands first deletes the dry-run literal. The harnessShellopts in once it has a production caller. - Constraint*: Fail closed with a
CriterionExecutionResulterror, never unconfined, whenbwrapis missing or namespaces are refused.bwrapnetwork is all-or-nothing and Landlock filters TCP ports, not addresses, so criteria get no network and private-range or metadata egress denial stays in the proxy and NetworkPolicy tiers, never reported as host-enforced. Do not portgenerate_bpf_corgenerate_tetragon_policy: BPF LSM is not in this kernel's boot LSM list, and the cluster integration is Falco (k8s/security_stream.py), which detects rather than denies. Denials are not SARIF: they have no source location. Nodocker run/podman runargv renderer: execution stays on the Docker SDK. No maintained Python Landlock binding exists; revisit when one does. - Measured*:
uv run --no-sync pythonovervalidate_criteria_commandacceptedcat /etc/passwd,find / -name '*.pem',python3 -cwithwrite_text, andpython3 -m pip install foo.bwrap --unshare-all --ro-bind /usr ... --ro-bind <ws> /work: repo read succeeds,ls /homeexits 2, write fails read-only, TCP connect errno 101.zcat /proc/config.gz | grep -E '^CONFIG_(BPF_LSM|LSM)=':CONFIG_BPF_LSM=y,CONFIG_LSMwithoutbpf. PyPI JSON forlandlockviaurllib.request: latest 1.0.0.dev5 (pre-release). - Source*: vibes
patterns/kernel-enforced-lsm-sandbox-containment.md,examples/ephemeral-container-sandbox/sandbox.py,examples/ephemeral-container-sandbox/test_sandbox.py,examples/ebpf-lsm-kernel-gate/lsm_gate.py,examples/ebpf-lsm-kernel-gate/README.md,observations/systems/34-ebpf-lsm-kernel-gates-and-dynamic-containment-fuzzing.md
Strategic Alignment
- Milestone:
v0.2.23(devops ai Review Quality, LLM Routing & Multi-Language Validation) - Roadmap Reference:
docs/ROADMAP.md
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
ci: install bubblewrap and python-is-python3 in test job (#592)
feat(sandbox): bubblewrap host confinement for criteria execution (#592…
feat(sandbox): unify container and host isolation with frozen Sandbox…
dan-petty commentedon Sep 27, 2026
Closed by #632, merged into
release/v0.2.23.GitHub only acts on closing keywords when a pull request merges into the default branch, so this was closed by
devops gh issues close-merged.