Repository navigation
fix(codex): preserve allowed tools under channel policy - #122282
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
b600911 to
52c6666
Compare
|
Codex review: needs real behavior proof before merge. Reviewed August 12, 2026, 1:15 AM ET / 05:15 UTC. ClawSweeper reviewWhat this changesThis PR adds an audited safe-deny declaration for exact agent harnesses and keeps OpenClaw plan progress visible when Codex native tools are intentionally isolated. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readiness⛔ Blocked until stronger real behavior proof is added - 8 items remain Keep open: the proposed fail-closed shape is plausible, but a required direct audit of the pinned Codex runtime is unavailable and the posted Telegram proof names an earlier head rather than the current one. Priority: P2 Review scores
Verification
How this fits togetherChannel and agent tool policies are prepared by the core harness selector before a Codex app-server run begins. The Codex plugin either retains its native surface for audited OpenClaw-only denies or replaces it with filtered OpenClaw tools and projects plan updates into channel progress. flowchart LR
Policy[Channel tool policy] --> Selector[Harness policy selection]
Selector --> Check{Every deny audited safe?}
Check -->|yes| Native[Codex native tools]
Check -->|no| Filtered[Filtered OpenClaw tools]
Filtered --> Plans[Plan event projection]
Native --> Progress[Channel progress]
Plans --> Progress
Decision needed
Why: The contract deliberately controls when an explicit tool deny does not isolate native capabilities, but the required dependency source is unavailable to this review worker. Before merge
Findings
Agent review detailsSecurityNeeds attention: The safe-deny list is a security boundary and cannot be cleared without the required direct pinned-Codex audit. PR surfaceSource +79, Tests +88, Docs +9, Generated 0. Total +176 across 27 files. View PR surface stats
Review metrics
Mantis proof suggestionTelegram Desktop proof can show that an audited safe deny preserves live checklist updates while restrictive policies still isolate native tools. A maintainer can ask Mantis to capture proof by posting this exact PR comment: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Rebase to current main, audit every safe-deny entry against checked-out @openai/codex 0.147.0 source, and attach redacted proof from the resulting exact head covering both safe-deny retention and native/MCP isolation. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: current main marks any restrictive explicit policy as native-surface restricted, including a deny-only policy. No local runtime execution was performed. Is this the best way to solve the issue? Unclear: the positive safe-deny design is the safer shape, but its correctness depends on an unavailable direct audit of the exact Codex runtime surface. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 00fc1bd12382. LabelsLabel changes:
Label justifications:
EvidenceSecurity concerns:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles)
|
|
To use Codex here, create a Codex account and connect to github. |
52c6666 to
d9a487d
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
d9a487d to
c118a75
Compare
|
Addressed the valid security finding in final rebased head
The PR body now explicitly leaves the public SDK contract decision and live deployed runtime proof to owner verification; no live proof is being inferred from mocked tests. @clawsweeper re-review |
|
🦞👀 Command router queued. I will update this comment with the next step. |
c118a75 to
6a77a04
Compare
|
Current-head maintainer review ( Main regression reproduced through a real Telegram/Codex app-server turn. Same prompt and harness, one config difference:
The gateway recorded the deny removing only Blocking inventory finding: Dependency gate checked directly against the pinned
The positive safe-deny design is the right fail-closed shape. I’ll remove the overlapping control names, rerun focused proof, and attach the after-fix Telegram result. |
|
@clawsweeper re-review |
|
Maintainer decision: approved. The optional public The redacted final-head Telegram verdict JSON is now in the PR body. It records the exact policy, timeline, structured plan revisions, gateway policy observation, and pass claim without account or host identifiers. |
fc3473b to
c8ec3ec
Compare
) Preserve Codex native tools when conversation policies deny only audited OpenClaw capabilities. Fail closed for computer-control denies and retain structured plan progress. Co-authored-by: Ayaan Zaidi <[email protected]> Co-authored-by: Kelaw - Keshav's Agent <[email protected]>
What Problem This Solves
Fixes two related regressions in Codex channel runs with explicit tool policy:
deny: ["tts", "music_generate"]therefore disabled unrelated native tools including plan, shell, file, image, and collaboration tools even though none was denied.update_planreplacement was deferred and successful calls were not projected as structured plan events, so channel progress lost its live checklist.The over-broad isolation started in
409fb7abcaceb2ab2f2b584d393dd38fedb74ac5when explicit channel policy began disabling the whole native Codex surface.What Changed
conversationToolPolicySafeDenyTools, declaring exact known OpenClaw denies that are fully enforced outside the harness-native surface.ttsandmusic_generate; omissions and future tools fail closed.update_planreplacement remains directly model-visible and successful calls reuse the structured plan projector.Review Hardening
The first revision declared native overlaps. ClawSweeper correctly identified that an omitted overlap could fail open. This revision inverts the contract: a harness declares only deny names proven safe to exempt. An omitted or mistakenly unknown name now isolates the native surface, so catalog growth cannot silently weaken policy enforcement.
Security Properties
isKnownCoreToolId.Codex Dependency Contract Checked
The bundled dependency is
@openai/codex0.147.0. I inspected the matchingrust-v0.147.0source atbe6e8eac029b183056b7e4402879f15d2c85f61b:codex-rs/core/src/tools/spec_plan.rs:848-851assembles shell, MCP-resource, utility, and collaboration sources into one registry.codex-rs/core/src/tools/spec_plan.rs:875-1040registers the native shell, plan, request-input, apply-patch, and image capabilities.codex-rs/core/src/tools/spec_plan.rs:1043-1131registers native collaboration capabilities.codex-rs/core/src/tools/hosted_spec.rs:14-45defines the hosted web-search surface.codex-rs/config/src/mcp_types.rs:209-215andcodex-rs/config/src/types.rs:853-879expose per-tool filtering for MCP servers/plugins, not a global arbitrary native-tool deny surface.Therefore OpenClaw must retain full native isolation whenever a policy might overlap Codex-native or unknown capabilities. The positive safe-deny declaration is the fail-closed owner boundary for exact OpenClaw-only denies.
Regression Proof
The new core regression failed before the resolver change:
deny: ["tts", "music_generate"]producedpluginHarnessToolPolicyRestricted: true. It now verifies:tts,music_generate) do not isolate Codex native tools;update_planremains direct and emits a normalized structured plan event when native isolation is required.Evidence
Exact rebased head:
6a77a0414f7check:changedadvanced through its in-scope checks but currentorigin/mainindependently failsplugins:boundary-report:cibecauseplugin-sdk-media-understanding-public-demotionis overdue. The same failure reproduces without this PR; remaining underlying checks were run directly and passed.Remaining Owner Verification
Final-Head Telegram Proof
Exact head:
fc3473b2b09Command shape (secrets and local paths omitted):
run-mock-sut-user-e2e.mjs --backend claude-cli --dm --record ... --output ...withchannels.telegram.direct["*"].tools.deny = ["tts", "music_generate"]and the Codex app-server harness selected.Sent:
Use your update_plan tool to create a plan with exactly two steps: "inspect" then "report". Mark both completed as you go. Then reply with only: PLAN_E2E_DONERecorded SUT timeline: typing at 4.7s; one 26-character draft at 6.0s; edits of the same draft at 7.8s and 9.8s; deletion at 14.3s. Recorded revisions:
Working/▸ inspect/▢ reportWorking/✅ inspect/▸ reportWorking/✅ inspect/✅ reportThe gateway recorded the explicit policy removing only
tts. The deny no longer isolated the unrelated Codex-native planner, and Telegram received the structured native checklist through completion. Evidence files retained outside the repository:events.ndjson,summary.json, andgateway.log.Redacted verdict JSON
{ "head": "fc3473b2b090bc026956b6b91e4557d91b47d955", "scenario": "telegram-dm-codex-app-server-safe-deny", "policy": {"deny": ["tts", "music_generate"]}, "recordingComplete": true, "sutTotals": {"typing": 4, "message": 1, "edit": 2, "delete": 1}, "timeline": [ {"elapsedMs": 6029, "kind": "message", "textLen": 26}, {"elapsedMs": 7805, "kind": "edit", "textLen": 26}, {"elapsedMs": 9818, "kind": "edit", "textLen": 26}, {"elapsedMs": 14325, "kind": "delete"} ], "revisions": [ "Working\n▸ inspect\n▢ report", "Working\n✅ inspect\n▸ report", "Working\n✅ inspect\n✅ report" ], "gatewayPolicyObservation": "explicit deny removed only tts", "verdict": "pass: unrelated Codex-native planning remained enabled and projected as structured Telegram progress" }