Skip to content

Ship a tested sandbox runner for Security review proof-of-concept execution #726

Open

Description

@JacobStephens2

From the Oct 11–16 2026 Run retrospective, finding 6. Tracking issue: #721.

The evidence below is historical and attributed to the supplied report (repository snapshot 5504c97); it has not all been independently reproduced. Limited current-checkout checks were made at 53bb9c6. This is filed for maintainer triage, not automatic Pickup.

Requested outcome and validation

Provide a supported sandbox runner, either a script or a thirdshift command, and name it in Security review guidance. Build from the reported working recipe only after retrieving and validating the actual flags from the #707 review logs; the recipe itself is not included in the report. Enforce the Security skill's isolation requirements rather than weakening them to make commands run.

Cover real namespace availability, toolchain/linker access, certificate access when needed, filesystem mounts, resource limits, and actionable failure diagnostics. Share the runner/probe contract with #608 so setup verifies the same environment reviews use. #608 remains the setup/preflight issue; this finding adds the reusable execution path and review behavior.

Clarify that executing target code serves a candidate finding or required reproduction, and need not repeat the implementer's suite when source review produces no candidate. Before starting review, recognize an empty review range or a PR that is already merged/closed; report the actual state rather than recording a completed review or rewriting a terminal PR.

Validation must prove the applicable isolation properties, a representative sandboxed reproduction, a clear unavailable-prerequisite outcome, and the no-candidate/empty-range paths. Existing Security review and confidentiality requirements remain in force.

Original finding, including evidence, proposed fixes, and confidence

6. Security reviews rebuild a bwrap sandbox by trial and error (Factory and Host)

Activity

  1. added
    enhancement
    needs-triage
    on Oct 17, 2026
  2. added
    ready-for-human
    and removed
    needs-triage
    on Nov 10, 2026
  3. JacobStephens2 commented on Nov 12, 2026

    @JacobStephens2
    OwnerAuthor

    This was generated by AI during triage.

    Additional evidence from #1821: ad-hoc tmpfs sandbox + scripts/affected-tests froze a 15 GiB / 0-swap host

    During the Nov 6, 2026 Pickup run on #1821 (1821-20261106T081201-0500~22jciA41s6iGcyqC on codex · gpt-6.1-sol · xhigh), the Security review session froze orchestrate.etadventures.com (15 GiB RAM, 0 B swap), requiring a host reboot and leaving the run died at Security review:

    1. Zero findings and zero code edits, but ran full local validation anyway:
      • By 08:46:12 EST, the Security review session had finished inspecting the 4 changed files in PR Keep repositories visible on Inbox rows without an issue #1823 (fbf60abb), reported "The source review found no introduced security findings", and all GitHub Actions CI checks had already passed.
      • However, combining AGENTS.md ("For final local validation, run scripts/affected-tests <base>") with .agents/skills/thirdshift-security-audit/SKILL.md (Universal execution safety: "Run target-controlled builds, tests, processes, browsers... only inside an OS-enforced sandbox that provides all of these controls... explicit low CPU, memory, process, file-size, disk, and wall-clock limits"), the session tried to run scripts/affected-tests inside a self-built sandbox.
    2. Mounted an 8 GiB tmpfs (in RAM) to enforce a "disk limit" without root:
      • The session wrote a helper script (run.py) and launched it under systemd-run --user --scope --unit=security-1821-validation --property=MemoryMax=6G --property=MemorySwapMax=0 --property=TasksMax=384 --property=CPUQuota=200% ... unshare --user --map-root-user --mount --net --pid --fork:
        subprocess.run(['mount','-t','tmpfs','-o','size=8g,nr_inodes=300000','tmpfs','/mnt'], check=True)
      • It bound /mnt (tmpfs) to /scratch, /repo/target, /repo/.affected-tests, and /dev/shm, then ran:
        cp -a /build-cache/.fingerprint /build-cache/deps /build-cache/build /scratch/target/debug/
        exec /usr/bin/prlimit --cpu=900 --fsize=536870912 --nofile=1024 -- /usr/bin/python3 scripts/affected-tests a7d76bbb399b36cd108365b255b7e589492537cd
    3. Why that locked up the host:
      • cp -a immediately copied 1.85 GiB of target/debug/{.fingerprint,deps,build} into the RAM-backed tmpfs, and scripts/affected-tests then ran cargo build --locked, 153 Playwright Chromium tests, and the full Rust test suite writing into that same tmpfs.
      • On a host with 0 B swap, tmpfs pages and anonymous memory cannot be swapped out. As security-1821-validation.scope's MemoryCurrent climbed (2.42 GB → 2.74 GB → 3.43 GB and rising toward 6 GB alongside ~4.5–5 GiB of existing host processes), the kernel could only evict clean file-backed page cache (binaries, shared libraries, .rlibs), causing severe page-cache thrashing across the machine (systemctl --user show took 97s, per-minute cron runs stalled, and network/DNS calls timed out until the host was rebooted at 08:57:20 EST).

    Implications for #726

    • Supported sandbox runner: Must use disk-backed scratch storage (not a multi-GiB tmpfs mount in RAM where build/test artifacts pin unswappable memory on 0-swap hosts).
    • No-candidate / no-edit rule in security_review_prompt: Explicitly instruct Security review that when source review produces no candidate finding and commits no fix, it must not run scripts/affected-tests or repeat the implementer's test suite.
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

    enhancementready-for-human

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions