fix(codex): enforce native tool policy#82496
Conversation
|
Codex review: found issues before merge. Summary Reproducibility: yes. The PR body gives a concrete Crabbox current-main before path and after-fix live path for Linux, and source inspection shows the current-main Codex native relay lacks the new trusted hook state and approval-policy bridge. Real behavior proof Next step before merge Security Review findings
Review detailsBest possible solution: Keep the security fix direction, add cross-platform Codex session-flags hook-state key coverage or derive the key from Codex-compatible path logic, then rerun focused tests and live proof before maintainer merge. Do we have a high-confidence way to reproduce the issue? Yes. The PR body gives a concrete Crabbox current-main before path and after-fix live path for Linux, and source inspection shows the current-main Codex native relay lacks the new trusted hook state and approval-policy bridge. Is this the best way to solve the issue? No. The approach is the right owner boundary, but it is not complete until the trusted session hook keys work on Windows as well as Unix-like hosts. Full review comments:
Overall correctness: patch is incorrect Security concerns:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 23f73b3ecfd9. |
0224add to
53cfb7e
Compare
53cfb7e to
e3633a3
Compare
* fix(codex): enforce native tool policy * docs: add changelog for codex native policy fix * fix(codex): satisfy native hook relay lint
* fix(codex): enforce native tool policy * docs: add changelog for codex native policy fix * fix(codex): satisfy native hook relay lint
* fix(codex): enforce native tool policy * docs: add changelog for codex native policy fix * fix(codex): satisfy native hook relay lint
* fix(codex): enforce native tool policy * docs: add changelog for codex native policy fix * fix(codex): satisfy native hook relay lint
* fix(codex): enforce native tool policy * docs: add changelog for codex native policy fix * fix(codex): satisfy native hook relay lint
* fix(codex): enforce native tool policy * docs: add changelog for codex native policy fix * fix(codex): satisfy native hook relay lint
* fix(codex): enforce native tool policy * docs: add changelog for codex native policy fix * fix(codex): satisfy native hook relay lint
Summary
before_tool_callpolicy when Codex ran in implicit yolo mode.untrustedonly when allowed, and routes Codex approval requests through OpenClaw policy before prompting.neverapproval policy remain respected.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Real behavior proof (required for external PRs)
before_tool_callpolicy and denied before writing the blocked target file.gpt-5.5, real OpenClaw agent run with a local test plugin registered forbefore_tool_call.node scripts/crabbox-wrapper.mjs run --provider aws --market on-demand --idle-timeout 90m --ttl 180m --timing-json --env-from-profile /private/tmp/openclaw-82372-live-env.sh --allow-env OPENAI_API_KEY,OPENAI_BASE_URL --script .crabbox/tmp/oc82372-e2e.shrun_90168d2aaf64; output includedagent_status=0,hook_log_count=1,target_exists=0,target_size=0, andFIXED: Codex native shell request was intercepted by OpenClaw before_tool_call policy and target file was not created./tmp/oc82372-crabbox-private_key.txttarget was not created.run_a4bce79c6487; the plugin hook was visible buthook_log_count=0andtarget_exists=1.Root Cause (if applicable)
before_tool_callpolicy.Regression Test Plan (if applicable)
extensions/codex/src/app-server/native-hook-relay.test.ts,extensions/codex/src/app-server/run-attempt.test.ts,extensions/codex/src/app-server/approval-bridge.test.ts,extensions/codex/index.test.tsUser-visible / Behavior Changes
Codex plugin users with OpenClaw tool policy hooks now get the same deny/approval behavior for Codex-native app-server tools that they expect for OpenClaw-owned dynamic tools. Explicit Codex app-server policy configuration remains honored.
Diagram (if applicable)
Security Impact (required)
Yes, explain risk + mitigation: Codex-native command approvals now consult OpenClaw policy before proceeding; policy rewrites that cannot be applied to Codex-native execution fail closed.Repro + Verification
Environment
gpt-5.5before_tool_call; model credentials forwarded via private Crabbox env profileSteps
before_tool_callevents containing the private-key target path./tmp/oc82372-crabbox-private_key.txt.Expected
Actual
hook_log_count=1target_exists=0target_size=0Evidence
Human Verification (required)
What you personally verified (not just CI), and how:
untrusted, explicit yolo config, plugin approval-required outcomes, policy param rewrites, raw command vs parsed display command.Compatibility / Migration
Risks and Mitigations