Skip to content

fix: keep exec auto-review bound to exact approvals#103430

Merged
steipete merged 1 commit into
mainfrom
fix/exec-auto-review-hardening
Jul 10, 2026
Merged

fix: keep exec auto-review bound to exact approvals#103430
steipete merged 1 commit into
mainfrom
fix/exec-auto-review-hardening

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Closes #103427

AI-assisted: Codex implementation with independent sub-agent audits and repo-native autoreview.

What Problem This Solves

Fixes an issue where operators using exec auto-review could receive an automatic approval whose resolved executable, completion state, risk classification, cancellation state, or Codex approval correlation did not exactly match the command reaching execution policy.

Why This Change Was Made

Automatic approvals now require a completed low-risk review for a single resolved executable and execute the enforced, path-pinned command. Ambiguous plans, unsupported reviewer results, non-low risk, cancellation, unsafe prompt content, and untrusted Codex reviewer configuration all fail closed to human approval; Codex execve subapprovals retain their unique approval IDs.

User Impact

Exec auto-review remains automatic for clearly resolved low-risk commands. Commands that cannot be bound to an exact executable or exact approval result now ask a human instead of inheriting a permissive fallback, and Codex Guardian applies each subcommand approval independently.

Evidence

  • AWS testbox focused execution/Codex suite: 392 tests passed (run_02efe2986693).
  • AWS testbox complete changed-code gate: passed typecheck, lint, import-cycle, extension, docs, and policy guards (run_161c39fcc526).
  • Rebased docs index validation passed (run_cb3e92431e05).
  • Dependency-aware test:changed cleared thousands of unit/contract/tooling/gateway tests before one unrelated gateway crash-loop timing case stalled under full-shard load; that entire file passed 96/96 in isolation (run_758d43581a0e).
  • Repo-native autoreview found two additional fallback/binding edge cases; both were fixed with regressions. Final local and branch-mode reviews reported no actionable findings.
  • Non-visual change; screenshots do not apply.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation agents Agent runtime and tooling extensions: codex size: L labels Jul 10, 2026
@openclaw-barnacle openclaw-barnacle Bot added the maintainer Maintainer-authored PR label Jul 10, 2026
@steipete
steipete force-pushed the fix/exec-auto-review-hardening branch from 0f8665b to 4983347 Compare July 10, 2026 05:33

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0f8665b851

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +475 to 477
if (decision.decision !== "allow-once" || decision.risk !== "low") {
return undefined;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Require path binding before Codex auto-approval

When tools.exec.mode=auto is used through the Codex app-server bridge, this branch now treats any low-risk allow-once as enough to return approved-once, but buildAppServerExecAutoReviewInput() still delegates to buildExecAutoReviewInputForShellCommand() without supplying resolvedPath or an enforced command. For a bare command such as git status, the reviewer can approve based only on argv while Codex resumes execution using the app-server environment/PATH, bypassing the exact executable binding that the gateway path now enforces; fail closed here unless the input is bound to the executable that Codex will run.

Useful? React with 👍 / 👎.

@steipete
steipete merged commit 9d4fb60 into main Jul 10, 2026
100 checks passed
@steipete
steipete deleted the fix/exec-auto-review-hardening branch July 10, 2026 05:44
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation extensions: codex maintainer Maintainer-authored PR size: L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Exec auto-review can lose exact approval binding

1 participant