Skip to content

Scoped sandbox grants and recovery (#509) - #514

Draft
datacas wants to merge 7 commits into
mainfrom
feat/509-sandbox-grants
Draft

datacas wants to merge 7 commits into
mainfrom
feat/509-sandbox-grants

Conversation

@datacas

@datacas datacas commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

Adds named and parameterized sandbox grants, canonical consent and guarded recovery while preserving existing Docker state access. Resumes the original commit and PR branch; no replacement PR was created.

Diagnosis

The baseline registry exposed only docker_host, so loopback checks and exact home-path/domain requests had no consent path. This feature request's proposed cause matches the source. The fix extends the shared registry, broker and adapters rather than adding a bypass per command. The invariant is that a canonical, user-authorized scope reaches only its intended executor and stage roles, while protected stores and real host limits remain enforced.

A defect reproduction is not applicable. The supplied host spike on Codex CLI 0.170.0 establishes the loopback-only choice and is preserved with its provenance. A fresh local native spike cannot run inside this stage. Related search covered linked work and open/recent items by sandbox/grant terms: #507's Docker state handling is preserved; #508's local-socket follow-up is addressed here; #291's sibling verifier and #457's other consent conversions remain separate scope.

Resulting behavior

  • local_sockets enables loopback TCP on Codex/Linux without adding domains or the all-Unix-sockets option. Claude reports this mapping unavailable.
  • Exact writable home paths and exact IDNA domain sets use canonical identities and cycle/repository/deny answers. Protected stores, their ancestors and symlink aliases are rejected.
  • Writer grants apply to implement/resolve only. Each review role asks for its own separate cycle-only scope.
  • Runtime-observed denial parameters request consent; missing parameters ask for an explicit validated definition first. Agent prose alone cannot supply a trusted parameter or authorization.
  • Resume commands retain the canonical definition so a fresh process reconstructs the same grant before dispatch. Denied/unavailable scopes retain concrete not_verified evidence.

Work units

Unit Behavior Files Tests Verification Rollback
WU-1 Preserve original parameterized registry and writer mappings grants, executors, cycle, stage_permissions, journal, docs test_sandbox_grants Final full suite, package validation and BasedPyright dependent: revert with WU-2/WU-3
WU-2 Loopback consent, observed-denial recovery and separate review scopes grants, environment_recovery, executors, cycle, owning docs and supplied host evidence test_sandbox_grants, test_environment_recovery 17 grant tests and 34 recovery tests pass; native boundary checks remain unverified dependent: revert continuation commits from 5f1c093 through this head together
WU-3 Resume definitions, public question shape and existing Docker compatibility grants, executors, test_permission_lifecycle and question/recovery coverage test_cycle_stage_characterization, test_permission_lifecycle Targeted 6 and 2 tests pass; final full suite passes dependent: included in the WU-2 continuation bundle

Verification — agent-reported

Head: cfe2237a75baa426f8653610d246c988f1f9ef66. The full configured suite passed 2,682 tests in 476.653 seconds, with one skipped. Package validation and BasedPyright pass; default unittest discovery exits 0 and runs zero tests. The focused grant suite passes 17 tests and recovery regressions pass 34.

The conclusion remains not_verified: the two frozen native boundary checks could not execute inside this Codex stage. The supplied host spike is retained as host-reported evidence on the preceding commit, never counted as a locally executed final-head check. AC-1, AC-4 and AC-5 retain these verification obligations; no criterion or required check was removed.

Check Result Criteria Evidence
configured-test pass AC-1, AC-2, AC-3, AC-4, AC-5 exit 0, 2682 tests
package-validation pass AC-6 exit 0
default-unittest pass — exit 0, 0 tests
basedpyright pass — exit 0
sandbox-grants pass AC-2, AC-3, AC-4, AC-5 exit 0, 17 tests
codex-socket-spike unverified AC-1 Not executed: nested Codex unavailable
grant-recovery-boundary unverified AC-4, AC-5 Not executed: nested Codex unavailable
recovery-regression pass AC-4, AC-5 exit 0, 34 tests
Version-2 check identities and evidence
{
  "version": 2,
  "ran": true,
  "conclusion": "not_verified",
  "boundary": "required",
  "checks": [
    {
      "executor": "codex",
      "profile": "deep_coder",
      "context": "project",
      "required": true,
      "provenance": "runtime",
      "reason": "runtime",
      "id": "configured-test",
      "command": "python3 -m unittest discover -s tests",
      "criteria": [
        "AC-1",
        "AC-2",
        "AC-3",
        "AC-4",
        "AC-5"
      ],
      "level": "test",
      "head_sha": "cfe2237a75baa426f8653610d246c988f1f9ef66",
      "result": "pass",
      "evidence": [
        {
          "exit_code": 0,
          "executed": 2682
        }
      ],
      "cause": "",
      "attempts": [
        {
          "command": "python3 -m unittest discover -s tests",
          "result": "fail",
          "evidence": [
            {
              "exit_code": 1,
              "executed": 2682
            }
          ],
          "cause": "Earlier continuation run: Docker-only receipt compatibility and a positional grant-list assertion failed. Both corrected; targeted reruns passed (6 characterization tests and 2 permission lifecycle tests). Final complete rerun passed at this head."
        }
      ]
    },
    {
      "executor": "codex",
      "profile": "deep_coder",
      "context": "project",
      "required": true,
      "provenance": "runtime",
      "reason": "runtime",
      "id": "package-validation",
      "command": "python3 scripts/validate-package.py",
      "criteria": [
        "AC-6"
      ],
      "level": "static",
      "head_sha": "cfe2237a75baa426f8653610d246c988f1f9ef66",
      "result": "pass",
      "evidence": [
        {
          "exit_code": 0,
          "executed": null
        }
      ],
      "cause": "",
      "attempts": []
    },
    {
      "executor": "codex",
      "profile": "deep_coder",
      "context": "project",
      "required": true,
      "provenance": "runtime",
      "reason": "runtime",
      "id": "default-unittest",
      "command": "python3 -m unittest",
      "criteria": [],
      "level": "test",
      "head_sha": "cfe2237a75baa426f8653610d246c988f1f9ef66",
      "result": "pass",
      "evidence": [
        {
          "exit_code": 0,
          "executed": 0
        }
      ],
      "cause": "",
      "attempts": []
    },
    {
      "executor": "codex",
      "profile": "deep_coder",
      "context": "project",
      "required": true,
      "provenance": "runtime",
      "reason": "runtime",
      "id": "basedpyright",
      "command": "basedpyright",
      "criteria": [],
      "level": "static",
      "head_sha": "cfe2237a75baa426f8653610d246c988f1f9ef66",
      "result": "pass",
      "evidence": [
        {
          "exit_code": 0,
          "executed": null
        }
      ],
      "cause": "",
      "attempts": []
    },
    {
      "executor": "codex",
      "profile": "deep_coder",
      "context": "project",
      "required": true,
      "provenance": "runtime",
      "reason": "runtime",
      "id": "sandbox-grants",
      "command": "python3 -m unittest discover -s tests -p test_sandbox_grants.py",
      "criteria": [
        "AC-2",
        "AC-3",
        "AC-4",
        "AC-5"
      ],
      "level": "boundary",
      "head_sha": "cfe2237a75baa426f8653610d246c988f1f9ef66",
      "result": "pass",
      "evidence": [
        {
          "exit_code": 0,
          "executed": 17
        }
      ],
      "cause": "",
      "attempts": [
        {
          "command": "python3 -m unittest discover -s tests -p test_sandbox_grants.py",
          "result": "pass",
          "evidence": [
            {
              "exit_code": 0,
              "executed": 13
            }
          ],
          "cause": "Earlier continuation before additional regression coverage."
        },
        {
          "command": "python3 -m unittest discover -s tests -p test_sandbox_grants.py",
          "result": "fail",
          "evidence": [
            {
              "exit_code": 1,
              "executed": 17
            }
          ],
          "cause": "Quoted-domain denial detection was missing; corrected."
        },
        {
          "command": "python3 -m unittest discover -s tests -p test_sandbox_grants.py",
          "result": "fail",
          "evidence": [
            {
              "exit_code": 1,
              "executed": 17
            }
          ],
          "cause": "Recording-adapter fixture did not dispatch under a read-only workspace policy; fixture corrected to isolate grant filtering from workspace enforcement."
        }
      ]
    },
    {
      "executor": "codex",
      "profile": "deep_coder",
      "context": "sandbox",
      "required": true,
      "provenance": "runtime",
      "reason": "runtime",
      "id": "codex-socket-spike",
      "command": "sha256:d8ada3eac090a7e6e29997d5fe2c40b1ebbbead19ac75c4009244853950a6a60",
      "criteria": [
        "AC-1"
      ],
      "level": "boundary",
      "head_sha": "cfe2237a75baa426f8653610d246c988f1f9ef66",
      "result": "unverified",
      "evidence": [],
      "cause": "Not executed locally: this Codex stage masks /tmp/codex-daemon-1000 with mode 000, so nested Codex cannot start. The supplied host report measured the preceding commit; it is not final-head local verification.",
      "attempts": [
        {
          "command": "rtk proxy ls -ld /tmp/codex-daemon-1000",
          "exit_code": 0,
          "observed": "d--------- (mode 000); metadata only"
        },
        {
          "action": "authorized recovery assessment",
          "observed": "No host-capable execution or escalation is available. Runtime prohibits nested codex sandbox, codex exec and srt here; none was launched and isolation was not disabled."
        }
      ]
    },
    {
      "executor": "codex",
      "profile": "deep_coder",
      "context": "sandbox",
      "required": true,
      "provenance": "runtime",
      "reason": "runtime",
      "id": "grant-recovery-boundary",
      "command": "sha256:01891df0c68a7508f65f9e00af102961c4b966d0466947300646d6247b44c7aa",
      "criteria": [
        "AC-4",
        "AC-5"
      ],
      "level": "boundary",
      "head_sha": "cfe2237a75baa426f8653610d246c988f1f9ef66",
      "result": "unverified",
      "evidence": [],
      "cause": "Not executed at the native sandbox boundary: nested Codex is unavailable in this stage. The 34 executed recovery regression tests exercise the runtime flow with fixture adapters and do not replace this required sandbox check.",
      "attempts": [
        {
          "command": "rtk proxy ls -ld /tmp/codex-daemon-1000",
          "exit_code": 0,
          "observed": "d--------- (mode 000); metadata only"
        },
        {
          "action": "authorized recovery assessment",
          "observed": "No host-capable execution or escalation is available. Runtime prohibits nested codex sandbox, codex exec and srt here; none was launched and isolation was not disabled."
        }
      ]
    },
    {
      "executor": "codex",
      "profile": "deep_coder",
      "context": "project",
      "required": true,
      "provenance": "agent",
      "reason": "exercise observed-denial consent and guarded same-executor recovery",
      "id": "recovery-regression",
      "command": "python3 -m unittest discover -s tests -p test_environment_recovery.py",
      "criteria": [
        "AC-4",
        "AC-5"
      ],
      "level": "test",
      "head_sha": "cfe2237a75baa426f8653610d246c988f1f9ef66",
      "result": "pass",
      "evidence": [
        {
          "exit_code": 0,
          "executed": 34
        }
      ],
      "cause": "",
      "attempts": [
        {
          "command": "python3 -m unittest discover -s tests -p test_environment_recovery.py",
          "result": "fail",
          "evidence": [
            {
              "exit_code": 1,
              "executed": 34
            }
          ],
          "cause": "Agent-only blocker fixture lacked a required recovery attempt; fixture corrected before passing reruns."
        }
      ]
    }
  ]
}

Security review — agent-reported

Ran cc-security-review. No confirmed vulnerability found in the accumulated change.

Reviewed surface: canonical paths/domains and consent identities; protected stores, symlinks and ancestors; trusted denial sources and explicit definitions; writer/reviewer separation; Codex and Claude configuration emission; immutable Claude policy placement; guarded same-executor replay and decision records.

Not reviewed by execution: native enforcement on this final head, because nested Codex is unavailable. The supplied host measurement is attributed separately.

Residual risk: writable tool state persists and can affect later runs. Loopback TCP reaches local services; the host spike establishes that Docker's Unix socket and other AF_UNIX sockets remain closed in that profile. No claim of overall security or approval is made.

Documentation

Visible behavior, configuration and stored fields are documented in docs/host-permissions.md and docs/routing.md. docs/capability-parity-audit.md classifies the boundaries. docs/research/local-sockets-509.md preserves the supplied host measurement separately from current-head local verification. No issue scope, milestone or priority was changed.

Local execution used the stage sandbox and installed Python/BasedPyright, with the same configured commands as CI. CI is separate evidence and has not been counted as local verification. This PR stays draft pending native boundary verification and review.

Code-host checks — read once

Head: cfe2237a75baa426f8653610d246c988f1f9ef66. 0 passed, 0 failed, 2 pending. Parallel CI policy: no wait or polling.

  • Classify the change: pending
  • Skills, manifests, and Bash installer: pending

Run: schema=2; profile=deep_coder; requested=openai/gpt-6.1-sol; effort=medium; resolved=?

Refs #509.

@datacas datacas changed the title WIP: scoped path and domain sandbox grants (#509) Scoped sandbox grants and recovery (#509) Nov 19, 2026
@datacas

datacas commented Nov 19, 2026

Copy link
Copy Markdown
Owner Author

Implementation continuation IMPLEMENTED and uploaded to this existing PR. Confirmed GitHub head cfe2237a75baa426f8653610d246c988f1f9ef66 matches the publication helper's uploaded commit. Preserved the original work and host-evidence document.

Verification — agent-reported

Head: cfe2237a75baa426f8653610d246c988f1f9ef66. The full configured suite passed 2,682 tests in 476.653 seconds, with one skipped. Package validation and BasedPyright pass; default unittest discovery exits 0 and runs zero tests. The focused grant suite passes 17 tests and recovery regressions pass 34.

The conclusion remains not_verified: the two frozen native boundary checks could not execute inside this Codex stage. The supplied host spike is retained as host-reported evidence on the preceding commit, never counted as a locally executed final-head check. AC-1, AC-4 and AC-5 retain these verification obligations; no criterion or required check was removed.

Check Result Criteria Evidence
configured-test pass AC-1, AC-2, AC-3, AC-4, AC-5 exit 0, 2682 tests
package-validation pass AC-6 exit 0
default-unittest pass — exit 0, 0 tests
basedpyright pass — exit 0
sandbox-grants pass AC-2, AC-3, AC-4, AC-5 exit 0, 17 tests
codex-socket-spike unverified AC-1 Not executed: nested Codex unavailable
grant-recovery-boundary unverified AC-4, AC-5 Not executed: nested Codex unavailable
recovery-regression pass AC-4, AC-5 exit 0, 34 tests
Version-2 check identities and evidence
{
  "version": 2,
  "ran": true,
  "conclusion": "not_verified",
  "boundary": "required",
  "checks": [
    {
      "executor": "codex",
      "profile": "deep_coder",
      "context": "project",
      "required": true,
      "provenance": "runtime",
      "reason": "runtime",
      "id": "configured-test",
      "command": "python3 -m unittest discover -s tests",
      "criteria": [
        "AC-1",
        "AC-2",
        "AC-3",
        "AC-4",
        "AC-5"
      ],
      "level": "test",
      "head_sha": "cfe2237a75baa426f8653610d246c988f1f9ef66",
      "result": "pass",
      "evidence": [
        {
          "exit_code": 0,
          "executed": 2682
        }
      ],
      "cause": "",
      "attempts": [
        {
          "command": "python3 -m unittest discover -s tests",
          "result": "fail",
          "evidence": [
            {
              "exit_code": 1,
              "executed": 2682
            }
          ],
          "cause": "Earlier continuation run: Docker-only receipt compatibility and a positional grant-list assertion failed. Both corrected; targeted reruns passed (6 characterization tests and 2 permission lifecycle tests). Final complete rerun passed at this head."
        }
      ]
    },
    {
      "executor": "codex",
      "profile": "deep_coder",
      "context": "project",
      "required": true,
      "provenance": "runtime",
      "reason": "runtime",
      "id": "package-validation",
      "command": "python3 scripts/validate-package.py",
      "criteria": [
        "AC-6"
      ],
      "level": "static",
      "head_sha": "cfe2237a75baa426f8653610d246c988f1f9ef66",
      "result": "pass",
      "evidence": [
        {
          "exit_code": 0,
          "executed": null
        }
      ],
      "cause": "",
      "attempts": []
    },
    {
      "executor": "codex",
      "profile": "deep_coder",
      "context": "project",
      "required": true,
      "provenance": "runtime",
      "reason": "runtime",
      "id": "default-unittest",
      "command": "python3 -m unittest",
      "criteria": [],
      "level": "test",
      "head_sha": "cfe2237a75baa426f8653610d246c988f1f9ef66",
      "result": "pass",
      "evidence": [
        {
          "exit_code": 0,
          "executed": 0
        }
      ],
      "cause": "",
      "attempts": []
    },
    {
      "executor": "codex",
      "profile": "deep_coder",
      "context": "project",
      "required": true,
      "provenance": "runtime",
      "reason": "runtime",
      "id": "basedpyright",
      "command": "basedpyright",
      "criteria": [],
      "level": "static",
      "head_sha": "cfe2237a75baa426f8653610d246c988f1f9ef66",
      "result": "pass",
      "evidence": [
        {
          "exit_code": 0,
          "executed": null
        }
      ],
      "cause": "",
      "attempts": []
    },
    {
      "executor": "codex",
      "profile": "deep_coder",
      "context": "project",
      "required": true,
      "provenance": "runtime",
      "reason": "runtime",
      "id": "sandbox-grants",
      "command": "python3 -m unittest discover -s tests -p test_sandbox_grants.py",
      "criteria": [
        "AC-2",
        "AC-3",
        "AC-4",
        "AC-5"
      ],
      "level": "boundary",
      "head_sha": "cfe2237a75baa426f8653610d246c988f1f9ef66",
      "result": "pass",
      "evidence": [
        {
          "exit_code": 0,
          "executed": 17
        }
      ],
      "cause": "",
      "attempts": [
        {
          "command": "python3 -m unittest discover -s tests -p test_sandbox_grants.py",
          "result": "pass",
          "evidence": [
            {
              "exit_code": 0,
              "executed": 13
            }
          ],
          "cause": "Earlier continuation before additional regression coverage."
        },
        {
          "command": "python3 -m unittest discover -s tests -p test_sandbox_grants.py",
          "result": "fail",
          "evidence": [
            {
              "exit_code": 1,
              "executed": 17
            }
          ],
          "cause": "Quoted-domain denial detection was missing; corrected."
        },
        {
          "command": "python3 -m unittest discover -s tests -p test_sandbox_grants.py",
          "result": "fail",
          "evidence": [
            {
              "exit_code": 1,
              "executed": 17
            }
          ],
          "cause": "Recording-adapter fixture did not dispatch under a read-only workspace policy; fixture corrected to isolate grant filtering from workspace enforcement."
        }
      ]
    },
    {
      "executor": "codex",
      "profile": "deep_coder",
      "context": "sandbox",
      "required": true,
      "provenance": "runtime",
      "reason": "runtime",
      "id": "codex-socket-spike",
      "command": "sha256:d8ada3eac090a7e6e29997d5fe2c40b1ebbbead19ac75c4009244853950a6a60",
      "criteria": [
        "AC-1"
      ],
      "level": "boundary",
      "head_sha": "cfe2237a75baa426f8653610d246c988f1f9ef66",
      "result": "unverified",
      "evidence": [],
      "cause": "Not executed locally: this Codex stage masks /tmp/codex-daemon-1000 with mode 000, so nested Codex cannot start. The supplied host report measured the preceding commit; it is not final-head local verification.",
      "attempts": [
        {
          "command": "rtk proxy ls -ld /tmp/codex-daemon-1000",
          "exit_code": 0,
          "observed": "d--------- (mode 000); metadata only"
        },
        {
          "action": "authorized recovery assessment",
          "observed": "No host-capable execution or escalation is available. Runtime prohibits nested codex sandbox, codex exec and srt here; none was launched and isolation was not disabled."
        }
      ]
    },
    {
      "executor": "codex",
      "profile": "deep_coder",
      "context": "sandbox",
      "required": true,
      "provenance": "runtime",
      "reason": "runtime",
      "id": "grant-recovery-boundary",
      "command": "sha256:01891df0c68a7508f65f9e00af102961c4b966d0466947300646d6247b44c7aa",
      "criteria": [
        "AC-4",
        "AC-5"
      ],
      "level": "boundary",
      "head_sha": "cfe2237a75baa426f8653610d246c988f1f9ef66",
      "result": "unverified",
      "evidence": [],
      "cause": "Not executed at the native sandbox boundary: nested Codex is unavailable in this stage. The 34 executed recovery regression tests exercise the runtime flow with fixture adapters and do not replace this required sandbox check.",
      "attempts": [
        {
          "command": "rtk proxy ls -ld /tmp/codex-daemon-1000",
          "exit_code": 0,
          "observed": "d--------- (mode 000); metadata only"
        },
        {
          "action": "authorized recovery assessment",
          "observed": "No host-capable execution or escalation is available. Runtime prohibits nested codex sandbox, codex exec and srt here; none was launched and isolation was not disabled."
        }
      ]
    },
    {
      "executor": "codex",
      "profile": "deep_coder",
      "context": "project",
      "required": true,
      "provenance": "agent",
      "reason": "exercise observed-denial consent and guarded same-executor recovery",
      "id": "recovery-regression",
      "command": "python3 -m unittest discover -s tests -p test_environment_recovery.py",
      "criteria": [
        "AC-4",
        "AC-5"
      ],
      "level": "test",
      "head_sha": "cfe2237a75baa426f8653610d246c988f1f9ef66",
      "result": "pass",
      "evidence": [
        {
          "exit_code": 0,
          "executed": 34
        }
      ],
      "cause": "",
      "attempts": [
        {
          "command": "python3 -m unittest discover -s tests -p test_environment_recovery.py",
          "result": "fail",
          "evidence": [
            {
              "exit_code": 1,
              "executed": 34
            }
          ],
          "cause": "Agent-only blocker fixture lacked a required recovery attempt; fixture corrected before passing reruns."
        }
      ]
    }
  ]
}

Security review — agent-reported

Ran cc-security-review. No confirmed vulnerability found in the accumulated change.

Reviewed surface: canonical paths/domains and consent identities; protected stores, symlinks and ancestors; trusted denial sources and explicit definitions; writer/reviewer separation; Codex and Claude configuration emission; immutable Claude policy placement; guarded same-executor replay and decision records.

Not reviewed by execution: native enforcement on this final head, because nested Codex is unavailable. The supplied host measurement is attributed separately.

Residual risk: writable tool state persists and can affect later runs. Loopback TCP reaches local services; the host spike establishes that Docker's Unix socket and other AF_UNIX sockets remain closed in that profile. No claim of overall security or approval is made.

Code-host checks — read once

Head: cfe2237a75baa426f8653610d246c988f1f9ef66. 0 passed, 0 failed, 2 pending. Parallel CI policy: no wait or polling.

  • Classify the change: pending
  • Skills, manifests, and Bash installer: pending

Run: schema=2; profile=deep_coder; requested=openai/gpt-6.1-sol; effort=medium; resolved=?

@datacas

datacas commented Nov 19, 2026

Copy link
Copy Markdown
Owner Author

[CCR-20261119-001] · senior_reviewer · anthropic/claude-opus-5-5→? · high · schema:2

Initial review: CHANGES_REQUESTED at cfe2237a75ba. Reviewed the full diff from origin/main (15 files, 1,398 lines). 2 findings, 1 blocks approval.

  • REV-001 (medium, blocks): any command's own output can supply an "observed sandbox denial" path or domain. Fix: take parameters only from a signal the command cannot print, or let the user confirm them. Test: a command that prints the diagnostic must not register an observed source.
  • REV-002 (low): writable bounds accept agent-host config and shell startup paths. Fix: the owner decides whether to protect them or disclose them in the question. Test: a protected-path subtest.

Checks run locally: configured suite passed (2,682 tests; one unrelated flaky test failed on the first run and passed on rerun), plus package validation, default unittest and BasedPyright. Native boundary checks: not_verified. Security audit: ran. CI: 5 passed, 2 failed (reported, not findings).

Findings, verification, security, CI and receipt

Findings

[REV-001] · medium · open · - · blocks:yes — Command output an agent controls is accepted as an observed sandbox denial

Paths: scripts/environment_recovery.py:188, scripts/cycle.py:1260, scripts/grants.py:1089.

codex_sandbox_denials takes the path or domain from function_call_output.output. That field holds the stdout/stderr of the command the agent chose to run. A command such as printf "sandbox denied access to path '<home>/.codex/config.toml'" therefore produces a sandbox_definition. cycle.py:1260 passes that entry to ConsentBroker.observe_sandbox. The broker registers the grant with source: "observed sandbox denial" and skips the explicit-definition question (request_definition).

The user is still asked before any access is granted, and protected stores are still refused. The problem is that the agent picks the parameter while the record and the question present it as runtime-observed. This contradicts the #509 decision "Consent identity": the parameter comes from an observed sandbox denial or validated configuration, never from the agent's statement alone. It also contradicts the guarantee in docs/host-permissions.md: "command operands and agent prose do not establish a parameter". The new tests build the output strings by hand, so none of them covers a command that prints the diagnostic itself.

Fix:

  • Accept a parameter only from a signal the command cannot print, such as a structured Codex sandbox event or exit metadata.
  • Otherwise, offer the parsed value as a suggestion inside the request_definition question so the user confirms the exact target. Use the validated configuration source only after that confirmation.
  • Add a regression test where the denied command is itself printf/echo of the diagnostic.

Evidence: code inspection. An execution repro helper was refused by this stage's write policy ([layer=toolkit_hook], accessory operation), so the reproduction was not executed.

[REV-002] · low · open · - · blocks:no — Writable bounds accept agent-host configuration and shell startup paths

Path: scripts/grants.py:466 (canonical_writable).

The protected list covers credential stores and the toolkit's consent and journal stores. It does not cover:

  • agent-host configuration: ~/.claude/settings.json, ~/.claude/hooks, ~/.codex/config.toml;
  • shell startup files: ~/.bashrc, ~/.profile;
  • ~/.local/bin.

A write grant on any of these lets a stage add hooks, permissions or code that runs outside the sandbox in later sessions. The docs give that same reason ("would let a stage forge authorization") for protecting the consent stores. The #509 bounds ("anywhere under $HOME except credential stores … and their ancestors") allow these paths, and the user approves the exact path, so this is a potential risk, not a confirmed vulnerability. Together with REV-001, an agent can steer the question toward one of them.

Owner decision: add these paths to the protected set, or name the risk explicitly in the question for such paths.

Acceptance criteria and checks (tests.version=2)

Checks were frozen before running. AC-1…AC-6 follow the runtime list order, which matches #509's AC-1, AC-2, AC-2b, AC-3, AC-4 and AC-5.

Check Required Result Criteria Evidence
configured-test python3 -m unittest discover -s tests yes pass AC-2, AC-3, AC-4, AC-5 Final run: exit 0, 2,682 tests, 1 skipped (390.6 s). Run 1: exit 1, one failure in test_run_cycle.RepeatedFindingTests.test_a_survival_found_by_the_last_rereview_reaches_the_closing_row (stats aggregation; file not in this diff). That test passed alone and in its module (285 tests).
package-validation python3 scripts/validate-package.py yes pass AC-6 exit 0, VALID: 16 skills
default-unittest python3 -m unittest yes pass — exit 0, 0 tests
basedpyright yes pass — exit 0, 0 errors
sandbox-grants python3 -m unittest discover -s tests -p test_sandbox_grants.py yes pass AC-2, AC-3, AC-4, AC-5 exit 0, 17 tests
codex-socket-spike yes unverified AC-1 Not run. Only a command hash is published, and nested Codex is unverified from a Claude-hosted stage (docs/routing.md). Host evidence is for the preceding commit only.
grant-recovery-boundary yes unverified AC-4, AC-5 Not run at the native boundary, for the same reason.

Conclusion: not_verified. AC-1 ("the suite passes in that sandbox") stays open at this head. AC-6 (documentation): host-permissions.md, routing.md, capability-parity-audit.md (PA-48…PA-51) and the research pages were inspected and are present.

Security triage and audit

Deterministic rule: no match. The repository declares no security_review.always_when, and no changed path matches the mandatory minimum. Reviewer judgement: the change alters sandbox grants, consent identity and permission tooling. The runtime plan also sets security_required. cc-security-review ran on cfe2237a75baa426f8653610d246c988f1f9ef66.

Confirmed: none beyond REV-001 (a provenance/trust-boundary defect; it grants no access without consent). Potential: REV-002.

Reviewed:

  • canonicalization of paths and domains (lexical and real, symlinks, ancestors and children of protected stores);
  • consent identity hashes, from_entry replay strictness, and the persistence limits on review-scoped grants;
  • writer/reviewer filtering in dispatch and CodexAdapter.argv;
  • TOML key quoting via json.dumps, and shlex in answer_with;
  • placement of the Claude policy directory outside granted paths.

Not reviewed by execution: native Codex/Claude enforcement of the emitted profiles at this head.

Residual risk:

  • network: accepts IP literals and localhost as exact hosts.
  • local_sockets, like docker_host, is not limited to writing roles, so a review of untrusted code can reach local TCP services once it is granted.
  • Writable tool state persists.

CI (parallel policy, read once at cfe2237)

  • PowerShell installer: fail
  • Windows test shard (windows-4): fail
  • Classify the change: pass
  • Skills, manifests, and Bash installer: pass
  • Windows test shard (windows-1): pass
  • Windows test shard (windows-2): pass
  • Windows test shard (windows-3): pass

The cycle's CI gate decides how failed checks are handled. They are not review findings.

Environment: Claude stage sandbox, Linux (WSL2). Configured commands were run exactly as written. Run: schema:2, senior_reviewer, anthropic/claude-opus-5-5→?, effort high.

@datacas

datacas commented Nov 19, 2026

Copy link
Copy Markdown
Owner Author

[CCT-20261119-001] · deep_coder · openai/gpt-6.1-sol→? · high · triaged:cfe2237a75baa426f8653610d246c988f1f9ef66 · schema:2

RESOLVED — pushed 385081ab5f68. Both findings were triaged valid before edits.

  • REV-001: command diagnostics now offer only untrusted target suggestions; explicit definition and permission stay separate. A real child process printing each diagnostic cannot register an observed grant.
  • REV-002: writable questions disclose changes to hooks, permissions and startup code used outside the sandbox later. Sensitive-target subtests pass.
  • CI input: the PowerShell gate failed because Windows shard 4 rejected short HOME aliases. Fixed normalization, replay, fixture paths and escaped-path assertions.
  • Verification: 2,685 tests passed (1 skipped); package validation, default unittest, BasedPyright, 20 grant tests and 34 recovery tests passed. Native Codex checks remain not_verified.
  • CI on 385081ab5f68: 0 passed, 0 failed, 2 pending; read once. Security audit ran; no remaining findings.
Finding records, verification, CI diagnosis and history

[REV-001] · medium · resolved · valid · blocks:yes — Command output an agent controls is accepted as an observed sandbox denial

At the triaged head, command stdout/stderr supplied sandbox_definition and skipped the definition question. The fix removes automatic registration and labels parsed sandbox_suggestion values explicitly untrusted. The user must confirm or replace the exact parameter; only that answer registers validated configuration. Permission is a separate subsequent question.

Changes: scripts/environment_recovery.py, scripts/cycle.py, scripts/grants.py, related tests and owning docs. Regression evidence: actual child commands printing path and domain diagnostics leave operations empty and ask for a definition; confirmation grants no access; the recovery test then asks permission and reruns on the same executor. Protected confirmed targets still fail validation. Fix commit: 385081ab5f6811e8f79955713d68dfc7dadc46b2.

[REV-002] · low · resolved · valid · blocks:no — Writable bounds accept agent-host configuration and shell startup paths

The owner-defined bounds in #509 allow exact non-credential home targets. The fix preserves those bounds and takes the review's disclosure option: every writable question warns, before the path, that persistent writes can alter agent hooks, permissions or shell startup code executed outside the sandbox in later sessions. Tests cover Claude settings/hooks, Codex config, .bashrc, .profile and .local/bin for writing and separate review scopes. Existing protected stores stay refused. Fix commit: 385081ab5f6811e8f79955713d68dfc7dadc46b2.

Supplied CI failure — separate from review findings

Reviewed-head check 135577919439 in workflow 44526687923 is PowerShell installer. Its annotations report exit 1; job metadata identifies its failed step as Require all Windows test shards to pass, with the installer steps skipped. .github/workflows/validate.yml confirms that gate exits 1 when a shard fails.

The upstream same-head Windows test shard (windows-4), job 135569111354, reported 2 failures and 13 errors, all in the new test_sandbox_grants module. Its log shows temporary paths under C:\\Users\\RUNNER~1, while resolved HOME has the long spelling. Comparing a lexical child against resolved HOME incorrectly rejected safe targets, causing direct grant errors and consequential None/empty grant assertions.

The fix accepts lexical or resolved HOME spelling while requiring the resolved target strictly below resolved HOME and checking both protected-store representations. Canonical grants survive consent/replay/dispatch. The temporary HOME fixture is resolved, and TOML path assertions use JSON escaping for Windows. The alias regression covers grant creation, token rebuild, consent, dispatch eligibility and protected-target rejection.

gh run view 44526687923 --repo datacas/code-cycle-toolkit --log-failed and the job-specific retry were blocked by this sandbox's network allowlist at results-receiver.actions.githubusercontent.com. The Windows shard log was recovered through gh api repos/datacas/code-cycle-toolkit/actions/jobs/135569111354/logs --allow-escape-sequences, captured and stripped of terminal escapes. A direct PowerShell job-log request was blocked at productionresultssa7.blob.core.windows.net; its metadata, workflow source and upstream failure establish the gate cause. No infrastructure cause is asserted for the failing tests.

Verification — agent-reported, tests.version=2

Checks were frozen before execution and retain the runtime's identities, owning executor/profile, required flags and AC-n links in the supplied order. Final configured suite: exit 0, 2,685 tests in 405.719 s, OK (skipped=1). Default unittest exits 0 but discovers 0 tests and supplies no coverage. Exploratory runs interrupted while fixing the fixture and CI defects are retained as attempts; they were not completed suites or timeouts.

{
  "version": 2,
  "ran": true,
  "passed": true,
  "conclusion": "not_verified",
  "boundary": "required",
  "checks": [
    {
      "id": "configured-test",
      "command": "python3 -m unittest discover -s tests",
      "executor": "codex",
      "profile": "deep_coder",
      "context": "project",
      "required": true,
      "criteria": [
        "AC-1",
        "AC-2",
        "AC-3",
        "AC-4",
        "AC-5"
      ],
      "level": "test",
      "provenance": "runtime",
      "reason": "runtime",
      "head_sha": "385081ab5f6811e8f79955713d68dfc7dadc46b2",
      "result": "pass",
      "cause": "",
      "attempts": [
        {
          "exit_code": 130,
          "cause": "Interrupted an exploratory run after correcting the new fixture prompt callback."
        },
        {
          "exit_code": 130,
          "cause": "Interrupted an exploratory run when recovered Windows CI logs required a path-normalization fix."
        },
        {
          "exit_code": 130,
          "cause": "Interrupted an exploratory run after the delegated review corrected alias replay; final tree rerun passed."
        }
      ],
      "evidence": [
        {
          "exit_code": 0,
          "executed": 2685
        }
      ]
    },
    {
      "id": "package-validation",
      "command": "python3 scripts/validate-package.py",
      "executor": "codex",
      "profile": "deep_coder",
      "context": "project",
      "required": true,
      "criteria": [
        "AC-6"
      ],
      "level": "static",
      "provenance": "runtime",
      "reason": "runtime",
      "head_sha": "385081ab5f6811e8f79955713d68dfc7dadc46b2",
      "result": "pass",
      "cause": "",
      "attempts": [],
      "evidence": [
        {
          "exit_code": 0,
          "executed": null
        }
      ]
    },
    {
      "id": "default-unittest",
      "command": "python3 -m unittest",
      "executor": "codex",
      "profile": "deep_coder",
      "context": "project",
      "required": true,
      "criteria": [],
      "level": "test",
      "provenance": "runtime",
      "reason": "runtime",
      "head_sha": "385081ab5f6811e8f79955713d68dfc7dadc46b2",
      "result": "pass",
      "cause": "",
      "attempts": [],
      "evidence": [
        {
          "exit_code": 0,
          "executed": 0
        }
      ]
    },
    {
      "id": "basedpyright",
      "command": "basedpyright",
      "executor": "codex",
      "profile": "deep_coder",
      "context": "project",
      "required": true,
      "criteria": [],
      "level": "static",
      "provenance": "runtime",
      "reason": "runtime",
      "head_sha": "385081ab5f6811e8f79955713d68dfc7dadc46b2",
      "result": "pass",
      "cause": "",
      "attempts": [],
      "evidence": [
        {
          "exit_code": 0,
          "executed": null
        }
      ]
    },
    {
      "id": "sandbox-grants",
      "command": "python3 -m unittest discover -s tests -p test_sandbox_grants.py",
      "executor": "codex",
      "profile": "deep_coder",
      "context": "project",
      "required": true,
      "criteria": [
        "AC-2",
        "AC-3",
        "AC-4",
        "AC-5"
      ],
      "level": "boundary",
      "provenance": "runtime",
      "reason": "runtime",
      "head_sha": "385081ab5f6811e8f79955713d68dfc7dadc46b2",
      "result": "pass",
      "cause": "",
      "attempts": [
        {
          "exit_code": 130,
          "cause": "Interrupted the initial run whose fixture returned a path repeatedly to the permission question; corrected the fixture before the passing rerun."
        }
      ],
      "evidence": [
        {
          "exit_code": 0,
          "executed": 20
        }
      ]
    },
    {
      "id": "codex-socket-spike",
      "command": "sha256:d8ada3eac090a7e6e29997d5fe2c40b1ebbbead19ac75c4009244853950a6a60",
      "executor": "codex",
      "profile": "deep_coder",
      "context": "sandbox",
      "required": true,
      "criteria": [
        "AC-1"
      ],
      "level": "boundary",
      "provenance": "runtime",
      "reason": "runtime",
      "head_sha": "385081ab5f6811e8f79955713d68dfc7dadc46b2",
      "result": "unverified",
      "cause": "Known nested Codex limitation: /tmp/codex-daemon-1000 is masked mode 000 (metadata confirmed). The runtime prohibits nested codex sandbox/exec or srt here; escalation is unavailable. The frozen command is supplied only as a hash. Earlier host evidence is not current-head local execution.",
      "attempts": [
        {
          "command": "rtk proxy ls -ld /tmp/codex-daemon-1000",
          "exit_code": 0,
          "observation": "d--------- (mode 000); no nested executor launched"
        }
      ],
      "evidence": []
    },
    {
      "id": "grant-recovery-boundary",
      "command": "sha256:01891df0c68a7508f65f9e00af102961c4b966d0466947300646d6247b44c7aa",
      "executor": "codex",
      "profile": "deep_coder",
      "context": "sandbox",
      "required": true,
      "criteria": [
        "AC-4",
        "AC-5"
      ],
      "level": "boundary",
      "provenance": "runtime",
      "reason": "runtime",
      "head_sha": "385081ab5f6811e8f79955713d68dfc7dadc46b2",
      "result": "unverified",
      "cause": "Known nested Codex limitation: /tmp/codex-daemon-1000 is masked mode 000 (metadata confirmed). The runtime prohibits nested codex sandbox/exec or srt here; escalation is unavailable. The frozen command is supplied only as a hash. Earlier host evidence is not current-head local execution.",
      "attempts": [
        {
          "command": "rtk proxy ls -ld /tmp/codex-daemon-1000",
          "exit_code": 0,
          "observation": "d--------- (mode 000); no nested executor launched"
        }
      ],
      "evidence": []
    },
    {
      "id": "recovery-regression",
      "command": "python3 -m unittest discover -s tests -p test_environment_recovery.py",
      "executor": "codex",
      "profile": "deep_coder",
      "context": "project",
      "required": true,
      "criteria": [
        "AC-4",
        "AC-5"
      ],
      "level": "test",
      "provenance": "agent",
      "reason": "exercise observed-denial consent and guarded same-executor recovery",
      "head_sha": "385081ab5f6811e8f79955713d68dfc7dadc46b2",
      "result": "pass",
      "cause": "",
      "attempts": [],
      "evidence": [
        {
          "exit_code": 0,
          "executed": 34
        }
      ]
    }
  ]
}

AC-1 remains open at the native boundary. Both frozen native checks expose command hashes and cannot run here: a metadata read confirms /tmp/codex-daemon-1000 is mode 000, and the runtime prohibits nested Codex/srt under that mask. No nested executor was launched, no isolation was disabled and earlier host measurements are not counted as current-head local tests.

Local verification used Linux and its installed Python/BasedPyright. The failing Windows log used Python 3.15.2. Native Windows execution and native sandbox enforcement were not available locally; remote CI remains separate. Dependency preparation reported prepared, with no failed/incomplete setup item.

Post-change review and security

Delegated cc-code-review reviewed the complete fix delta from trusted review head cfe2237a75baa426f8653610d246c988f1f9ef66. It is an ancestor of the uploaded head; no accumulated-diff fallback was needed. A fixture callback loop and alias replay defect found during iteration were fixed, regression-tested and reinspected. No remaining findings.

cc-security-review ran: security_audit_ran=true. Trigger: runtime security_required and the sandbox/consent trust boundary. No changed path matches the deterministic mandatory minimum. Reviewed command-output provenance, explicit definition vs authorization, protected paths and aliases, writer/reviewer separation, canonical replay and disclosure ordering. No confirmed remaining vulnerability. Approved writable targets can still alter future host execution; this risk is disclosed. Native sandbox enforcement remains unaudited by execution.

Owning documentation was updated in docs/host-permissions.md, docs/routing.md and docs/capability-parity-audit.md. The issue's behavior was already documented there and this fix updates it in the same commit. No README entry point changed.

Pushed-head checks — one read, parallel policy

Head: 385081ab5f6811e8f79955713d68dfc7dadc46b2. 0 passed, 0 failed, 2 pending.

  • Classify the change: pending
  • Skills, manifests, and Bash installer: pending

No wait, polling or in-stage CI fix round. GitHub confirmed that PR #514's head equals the uploaded commit. The working tree is clean.

Previous review run and stage receipts

Both historical comments were provider-authenticated as datacas, a configured trusted author. No review threads exist. The review run line is preserved; dispositions were frozen before this attempt's first edit.

[CCR-20261119-001] · senior_reviewer · anthropic/claude-opus-5-5→? · high · schema:2

@datacas

datacas commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner Author

[CCR-20261119-003] · senior_reviewer · anthropic/claude-opus-5-5→? · high · schema:2

Rereview: REVIEW_PASSED_AWAITING_CI at 385081ab5f68 (head unchanged since CCR-20261119-002). The full diff from origin/main (15 files, 1,470 lines) was rereviewed again. 1 new non-blocking finding.

  • REV-003 (low, new): the writable bound protects the journal only at ~/.config/code-cycle-toolkit. When CODE_CYCLE_HOME or XDG_CONFIG_HOME moves the journal elsewhere under HOME, that location is not protected. Fix: add telemetry.default_database_path().parent to the protected stores. Test: a subtest that sets the override.

2 unchanged findings (REV-001, REV-002 resolved). Local checks: the configured suite passed (2,685 tests). Package validation, default unittest, BasedPyright, sandbox-grants (20) and recovery-regression (34) also pass. The 2 native boundary checks are still not_verified, so this is not APPROVED. Security audit: ran, nothing confirmed. CI: 7/7 passed.

Findings, verification, security, CI and history

Findings

[REV-001] · medium · resolved · valid · blocks:yes — Command output an agent controls is accepted as an observed sandbox denial

No change since CCR-20261119-002. codex_sandbox_denials emits only sandbox_suggestion. request_definition asks for the exact target and records the answer as validated configuration; request() then asks permission separately. Verified again by execution at 385081a: test_command_printing_a_diagnostic_cannot_register_an_observed_source (a real child process prints both diagnostics; no operation or grant is registered) and test_confirmed_parameter_grant_reruns_on_the_same_executor pass.

[REV-002] · low · resolved · valid · blocks:no — Writable bounds accept agent-host configuration and shell startup paths

No change since CCR-20261119-002. Every writable question starts with the persistent host-execution risk, for both writer and review scopes. Verified again by execution: test_writable_consent_discloses_host_execution_risk_for_sensitive_targets passes.

[REV-003] · low · open · - · blocks:no — The journal store is protected only at its default location

Path: scripts/grants.py:597 (canonical_writable).

The protected list hard-codes ~/.config/code-cycle and ~/.config/code-cycle-toolkit. It adds the configured consent file through default_store_path(), which follows CODE_CYCLE_CONSENT_FILE and XDG_CONFIG_HOME. The journal has no matching entry. telemetry.default_database_path() (scripts/telemetry.py:1135) places it under $CODE_CYCLE_HOME, or under $XDG_CONFIG_HOME/code-cycle-toolkit. When either variable points inside HOME (for example XDG_CONFIG_HOME=~/.xdg), a writable grant on that directory passes validation. docs/host-permissions.md says the journal stores are protected "because writing them would let a stage forge authorization".

Impact is limited. grants.py never reads the journal to authorize anything; consent comes from the consent store, which stays protected. The user must also approve the exact path. What a stage could forge is the decision and resume history the runtime and cycle_journal.py permissions report.

Fix: add telemetry.default_database_path().parent (and its resolved form) to stores. Test: a test_protected_paths_and_ancestors_never_reach_consent subtest with XDG_CONFIG_HOME and CODE_CYCLE_HOME set under HOME.

Evidence: code inspection. An execution repro (python3 -c … with XDG_CONFIG_HOME set) was refused by this stage's command table ([layer=toolkit_hook], accessory operation), so the reproduction was not executed.

Full rereview of the accumulated diff

The head did not move, but the whole diff was read again. Beyond REV-003, no new defect:

  • dispatch drops writable:/network: tokens for non-writers. A review token reaches only its exact role, and every parameter is canonicalized before the policy is built. CodexAdapter.argv applies the same writer/review filter on direct calls.
  • Claude writable settings are emitted only for WRITING_ROLES or the matching sandbox_grant_role. The policy directory is chosen outside every writable root.
  • from_entry replays only the exact schema 1/2 field sets. Review-role definitions never read the repository store and reject persistent.
  • local_sockets adds network-on without domains or the Unix-socket option. Claude returns UNSUPPORTED with a not_verified note.

Acceptance criteria and checks (tests.version=2, agent-reported)

Checks were frozen before running, with the runtime's identities and owning executor/profile. This stage ran on Claude (senior_reviewer).

Check Required Result Criteria Evidence at 385081a
configured-test python3 -m unittest discover -s tests yes pass AC-1…AC-5 exit 0, 2,685 tests, OK (skipped=1), 1,041.8 s. The run passed the 10-minute foreground window; the host moved it to the background, where it finished, and its exit status was captured.
package-validation python3 scripts/validate-package.py yes pass AC-6 exit 0, VALID: 16 skills (7 cycle, 9 supporting)
default-unittest python3 -m unittest yes pass — exit 0, 0 tests
basedpyright yes pass — exit 0, 0 errors, 0 warnings
sandbox-grants yes pass AC-2…AC-5 exit 0, 20 tests
recovery-regression yes pass AC-4, AC-5 exit 0, 34 tests
codex-socket-spike yes unverified AC-1 Not run. Only a command hash was supplied, and nested Codex from a Claude stage is unsupported (docs/routing.md). No recovery is available.
grant-recovery-boundary yes unverified AC-4, AC-5 Not run, for the same reason.

Conclusion: not_verified. AC-1, AC-4 and AC-5 keep their native-boundary obligations open. AC-6: the owning docs were updated.

Security (cc-security-review ran on 385081a)

Trigger: runtime security_required, plus the sandbox/consent trust boundary. No changed path matches the mandatory minimum. Confirmed vulnerabilities: none. Potential: REV-003.

Reviewed: provenance of command-output targets; canonical_writable (HOME aliases, protected stores, ancestors and children, symlinks); sandbox_grant/sandbox_token revalidation and from_entry replay; writer/review role filtering in granted, dispatch and CodexAdapter.argv; TOML quoting via json.dumps; shlex in answer_with; the suggestion hint's injection surface; and the placement of the Claude policy directory.

Not reviewed by execution: native Codex/Claude enforcement of the emitted profiles at this head.

Residual risk (unchanged):

  • the legacy source observed sandbox denial is still accepted on replay, but no code produces it;
  • one sentence in host-permissions.md still uses the old observed-denial wording;
  • approved writable targets can change future host execution (disclosed);
  • local_sockets reaches local TCP services and, like docker_host, is not limited to writing roles.

CI (parallel policy, read once at 385081a)

All 7 passed: Classify the change, Skills/manifests/Bash installer, Windows shards 1–4, PowerShell installer. The status stays REVIEW_PASSED_AWAITING_CI because the frozen required checks codex-socket-spike and grant-recovery-boundary are unverified. The cycle's gate decides.

History

[CCR-20261119-001] · senior_reviewer · anthropic/claude-opus-5-5→? · high · schema:2

[CCT-20261119-001] · deep_coder · openai/gpt-6.1-sol→? · high · triaged:cfe2237a75baa426f8653610d246c988f1f9ef66 · schema:2

[CCR-20261119-002] · senior_reviewer · anthropic/claude-opus-5-5→? · high · schema:2

Environment: Claude stage sandbox, Linux (WSL2). Configured commands were run as written. Comment authors read: datacas (trusted). No review threads.

@datacas

datacas commented Nov 19, 2026

Copy link
Copy Markdown
Owner Author

[CCR-20261119-004] · senior_reviewer · anthropic/claude-opus-5-5→? · high · schema:2

Rereview: REVIEW_PASSED_AWAITING_CI at 385081ab5f68 (head unchanged since CCR-20261119-003). The full diff from origin/main (15 files, 1,470 lines) was read again. No new finding and no finding changed state.

3 unchanged findings: REV-001 and REV-002 resolved; REV-003 (low, blocks:no) still open, since no commit touched canonical_writable. Local checks: the configured suite passed (2,685 tests). Package validation, default unittest, BasedPyright, sandbox-grants (20) and recovery-regression (34) also pass. The 2 native boundary checks are still not_verified, so this is not APPROVED. Security audit: ran, nothing confirmed. CI: 7/7 passed.

Findings, verification, security, CI and history

Findings

[REV-001] · medium · resolved · valid · blocks:yes — Command output an agent controls is accepted as an observed sandbox denial

No change. Verified again by execution at 385081a: test_command_printing_a_diagnostic_cannot_register_an_observed_source and test_confirmed_parameter_grant_reruns_on_the_same_executor pass. codex_sandbox_denials emits only sandbox_suggestion, and request_definition records a user-confirmed target as validated configuration before request() asks permission.

[REV-002] · low · resolved · valid · blocks:no — Writable bounds accept agent-host configuration and shell startup paths

No change. Verified again by execution: test_writable_consent_discloses_host_execution_risk_for_sensitive_targets passes.

[REV-003] · low · open · - · blocks:no — The journal store is protected only at its default location

Path: scripts/grants.py:484 (canonical_writable; earlier rounds cited diff line 597). Still reproducible by inspection at the same head: grants.py has no reference to telemetry.default_database_path(), so a journal moved by CODE_CYCLE_HOME or XDG_CONFIG_HOME to a location under HOME is not a protected store. The impact stays limited: the consent store remains protected, and the user must approve the exact path. Fix: add telemetry.default_database_path().parent (and its resolved form) to stores. Test: a subtest with those variables set under HOME.

Full rereview of the accumulated diff

Re-read in full; no new defect:

  • dispatch drops writable:/network: tokens for non-writers. A review token reaches only its exact role, and every parameter is canonicalized again before the policy is built. CodexAdapter.argv applies the same filter on direct calls, and the filesystem rule always exists before granted paths are appended.
  • Claude writable settings are emitted only for WRITING_ROLES or the matching sandbox_grant_role. The policy directory is chosen outside every writable root.
  • from_entry replays only the exact schema 1/2 field sets; review definitions skip the repository store and reject persistent.
  • local_sockets adds network-on without domains or the Unix-socket option. Non-Codex executors drop it with a not_verified note.

Acceptance criteria and checks (tests.version=2, agent-reported)

Frozen with the runtime identities and owning executor/profile. This stage ran on Claude (senior_reviewer).

Check Required Result Criteria Evidence at 385081a
configured-test python3 -m unittest discover -s tests yes pass AC-1…AC-5 exit 0, 2,685 tests, OK (skipped=1), 864.2 s. It ran longer than the 10-minute foreground window, so the host moved it to the background, where it finished; its exit status was captured.
package-validation python3 scripts/validate-package.py yes pass AC-6 exit 0, VALID: 16 skills (7 cycle, 9 supporting)
default-unittest python3 -m unittest yes pass — exit 0, 0 tests
basedpyright yes pass — exit 0, 0 errors, 0 warnings, 0 notes
sandbox-grants yes pass AC-2…AC-5 exit 0, 20 tests
recovery-regression yes pass AC-4, AC-5 exit 0, 34 tests
codex-socket-spike yes unverified AC-1 Not run. The runtime supplied only a command hash, so no command can be executed; the check's owning context is the Codex sandbox, and nested Codex from a Claude stage is unverified (docs/routing.md). No recovery is available.
grant-recovery-boundary yes unverified AC-4, AC-5 Not run, for the same reason.

Conclusion: not_verified. AC-1, AC-4 and AC-5 keep their native-boundary obligations open.

Security (cc-security-review ran on 385081a)

Trigger: runtime security_required, plus the sandbox/consent trust boundary. No changed path matches the mandatory minimum. Confirmed vulnerabilities: none. Potential: REV-003.

Reviewed: provenance of command-output targets and the untrusted-suggestion hint; canonical_writable (HOME aliases, .., symlinks, protected stores in both directions); sandbox_grant/sandbox_token revalidation and from_entry replay; role filtering in granted, request, dispatch and CodexAdapter.argv; TOML quoting via json.dumps; shlex.quote in answer_with; Claude policy directory placement.

Not reviewed by execution: native Codex/Claude enforcement of the emitted profiles.

Residual risk (unchanged): legacy source observed sandbox denial still replays but nothing produces it; approved writable targets can change future host execution (disclosed); local_sockets and docker_host are not limited to writing roles; canonical_domains accepts numeric hosts such as 127.0.0.1 or localhost as exact domains, which only the user can approve.

CI (parallel policy, read once at 385081a)

All 7 passed: Classify the change, Skills/manifests/Bash installer, Windows shards 1–4, PowerShell installer. The status stays REVIEW_PASSED_AWAITING_CI because the frozen required checks codex-socket-spike and grant-recovery-boundary are unverified. The cycle's gate decides.

History

[CCR-20261119-001] · senior_reviewer · anthropic/claude-opus-5-5→? · high · schema:2

[CCT-20261119-001] · deep_coder · openai/gpt-6.1-sol→? · high · triaged:cfe2237a75baa426f8653610d246c988f1f9ef66 · schema:2

[CCR-20261119-002] · senior_reviewer · anthropic/claude-opus-5-5→? · high · schema:2

[CCR-20261119-003] · senior_reviewer · anthropic/claude-opus-5-5→? · high · schema:2

Environment: Claude stage sandbox, Linux (WSL2). Configured commands were run as written. Comment authors read: datacas (trusted). No review threads.

@datacas

datacas commented Nov 19, 2026

Copy link
Copy Markdown
Owner Author

[CCR-20261119-005] · senior_reviewer · anthropic/claude-opus-5-5→? · high · schema:2

Rereview: REVIEW_PASSED_AWAITING_CI at 385081ab5f68. The head has not moved since CCR-20261119-004. I read the full diff from origin/main again (15 files, 1,470 lines). There are no new findings, and no finding changed state.

3 findings are unchanged: REV-001 and REV-002 are resolved. REV-003 (low, blocks:no) is still open because no commit changed canonical_writable. Local checks passed: the configured suite (2,685 tests), package validation, default unittest, BasedPyright, sandbox-grants (20 tests) and recovery-regression (34 tests). The 2 native boundary checks are still not_verified, so this is not APPROVED. The security audit ran and confirmed no vulnerability. CI: 7/7 passed.

Findings, verification, security, CI and history

Findings

[REV-001] · medium · resolved · valid · blocks:yes — Command output an agent controls is accepted as an observed sandbox denial

No change. Verified again by execution at 385081a. The sandbox-grants suite passes, including test_command_printing_a_diagnostic_cannot_register_an_observed_source. The recovery-regression suite passes, including test_confirmed_parameter_grant_reruns_on_the_same_executor.

[REV-002] · low · resolved · valid · blocks:no — Writable bounds accept agent-host configuration and shell startup paths

No change. Verified again by execution: test_writable_consent_discloses_host_execution_risk_for_sensitive_targets passes.

[REV-003] · low · open · - · blocks:no — The journal store is protected only at its default location

Path: scripts/grants.py:484 (canonical_writable).

Still reproducible by inspection at the same head. git grep default_database_path -- scripts/grants.py finds nothing. telemetry.default_database_path() (scripts/telemetry.py:1135) follows CODE_CYCLE_HOME and XDG_CONFIG_HOME. When either variable points to a location under HOME, the relocated journal is not a protected store. The impact stays limited: the consent store remains protected, and the user must approve the exact path.

Fix: add telemetry.default_database_path().parent and its resolved form to stores. Test: a subtest with those variables set under HOME.

Full rereview of the accumulated diff

I read the whole diff again and found no new defect:

  • dispatch drops writable: and network: tokens for stages that do not write. A review token reaches only its own exact role, and every parameter is canonicalized again before the policy is built. CodexAdapter.argv applies the same writer/review filter when it is called directly.
  • Claude writable settings are emitted only for WRITING_ROLES or for the role in sandbox_grant_role. The policy directory is chosen outside every writable root.
  • from_entry replays only the exact schema 1 and schema 2 field sets. Review definitions skip the repository store and reject persistent.
  • local_sockets turns the network on without adding domains or the Unix-socket option. Executors other than Codex drop it with a not_verified note.

Acceptance criteria and checks (tests.version=2, agent-reported)

The checks were frozen before running, with the runtime's identities and owning executor/profile. This stage ran on Claude (senior_reviewer).

Check Required Result Criteria Evidence at 385081a
configured-test python3 -m unittest discover -s tests yes pass AC-1…AC-5 exit 0, 2,685 tests, OK (skipped=1), 416.6 s
package-validation python3 scripts/validate-package.py yes pass AC-6 exit 0, VALID: 16 skills (7 cycle, 9 supporting)
default-unittest python3 -m unittest yes pass — exit 0, 0 tests
basedpyright yes pass — exit 0, 0 errors, 0 warnings, 0 notes
sandbox-grants yes pass AC-2…AC-5 exit 0, 20 tests
recovery-regression yes pass AC-4, AC-5 exit 0, 34 tests
codex-socket-spike yes unverified AC-1 Not run. The runtime supplied only a command hash, so there is no command to run. The check belongs to the Codex sandbox context, and running Codex nested inside a Claude stage is unsupported (docs/routing.md). No recovery is available.
grant-recovery-boundary yes unverified AC-4, AC-5 Not run, for the same reason.

Conclusion: not_verified. AC-1, AC-4 and AC-5 keep their native-boundary obligations open. AC-6 is covered by package validation, and the docs pages that own this behaviour were updated.

Security (cc-security-review ran on 385081a)

Trigger: the runtime set security_required, and the change crosses the sandbox and consent trust boundary. No changed path matches the mandatory minimum. Confirmed vulnerabilities: none. Potential risk: REV-003.

Reviewed:

  • where command-output targets come from, and how the untrusted suggestion hint is built (json.dumps, ensure_ascii, cut to 160 characters);
  • canonical_writable: HOME aliases, .., symlinks, and protected stores checked in both directions;
  • sandbox_grant and sandbox_token revalidation at dispatch, and from_entry replay;
  • role filtering in granted, request, dispatch and CodexAdapter.argv;
  • TOML quoting of paths with json.dumps, and the domain regex;
  • shlex.quote in answer_with;
  • where the Claude policy directory is placed.

Not reviewed by execution: whether native Codex and Claude actually enforce the emitted profiles.

Residual risk:

  • the legacy source observed sandbox denial still replays, but nothing produces it any more;
  • an approved writable target can change how the host runs in later sessions (this is disclosed to the user);
  • local_sockets and docker_host are not limited to writing roles;
  • canonical_domains accepts numeric hosts such as 127.0.0.1 as exact domains, which only the user can approve.

CI (parallel policy, read once at 385081a)

All 7 checks passed: Classify the change; Skills, manifests, and Bash installer; Windows test shards 1–4; PowerShell installer. The status stays REVIEW_PASSED_AWAITING_CI because the frozen required checks codex-socket-spike and grant-recovery-boundary are unverified. The cycle's gate decides.

History

[CCR-20261119-001] · senior_reviewer · anthropic/claude-opus-5-5→? · high · schema:2

[CCT-20261119-001] · deep_coder · openai/gpt-6.1-sol→? · high · triaged:cfe2237a75baa426f8653610d246c988f1f9ef66 · schema:2

[CCR-20261119-002] · senior_reviewer · anthropic/claude-opus-5-5→? · high · schema:2

[CCR-20261119-003] · senior_reviewer · anthropic/claude-opus-5-5→? · high · schema:2

[CCR-20261119-004] · senior_reviewer · anthropic/claude-opus-5-5→? · high · schema:2

Environment: Claude stage sandbox, Linux (WSL2). The configured commands were run as written. Comment authors read: datacas (trusted). There are no review threads.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant