Skip to content

feat: ask before configured MCP tools run on every runtime, not only Codex - #208267

Open
kitiyeung wants to merge 3 commits into
openclaw:mainfrom
kitiyeung:feat/mcp-approval-claude-cli
Open

kitiyeung wants to merge 3 commits into
openclaw:mainfrom
kitiyeung:feat/mcp-approval-claude-cli

Conversation

@kitiyeung

@kitiyeung kitiyeung commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Closes #208228
Related: #78308

What Problem This Solves

openclaw mcp configure <server> --approval prompt (stored as mcp.servers.<name>.codex.defaultToolsApprovalMode) asks the operator before a configured MCP tool runs, but only when the Codex harness runs the turn. On every other runtime, such as an embedded agent run on any model provider, or a CLI backend like Claude CLI reaching the tools through the Gateway loopback MCP bridge, a server set to prompt runs its tools with no question asked. An operator who marks a mail or payments server as "ask first" gets no ask on most setups.

User Impact

A server set to prompt or auto now asks before its tools run on every runtime OpenClaw executes MCP tools for. The ask is a normal plugin approval (Allow Once / Deny) on the operator's existing approval routes, such as the Telegram card or Control UI. prompt asks for every tool. auto asks for every tool the server does not mark readOnlyHint: true; no other hint waives the ask. The card names the server and tool and never shows the call's arguments, which can carry credentials. A denial, a timeout, or a missing approval route stops the call, so an unattended run such as a cron job cannot use a prompt or auto server; servers those runs need stay on approve. Servers with no mode, or approve, behave as before. Codex turns are unchanged and are asked once, not twice.

Why This Change Was Made

The mode is resolved once, from the tool's existing MCP metadata, and applied in runBeforeToolCallHook after the before_tool_call hooks. Both entry points pass it there: the before_tool_call wrapper (embedded runs) and the loopback bridge handler (CLI backends). One gate covers every runtime, and hooks keep their order and their ability to block first. The Codex harness already asks through its own interactive approval, so it marks the tools it guards (harnessApproval) and the shared gate skips them. The change reads the existing key rather than adding config. A neutral mcp.servers.<name>.approval key is left for maintainers to decide on. This is the operator-side gate in core; #78308 (a server-requested consent envelope) is complementary and would reuse the same approval route, so its ownership can be settled alongside this one.

Evidence

Every run below is the shipped entry point: openclaw gateway run built from this branch (node dist/index.js), or the 2026.11.10 and 2026.11.12 npm releases for the before side. The approval mode is set with the shipped CLI, openclaw mcp configure mailstub --approval <mode>. An owner DM arrives through a stub Telegram Bot API and asks the agent to call send_mail once on a stdio test MCP server that logs every call it receives. Approval taps are Telegram callback queries on the card's own buttons. The 2026.11.12 upgrade runs use a build of the current head eb8d976; the earlier runs used acb931e, and eb8d976 adds only the test-mock fix, so runtime behavior is the same.

Case Runtime Mode Result
Before (2026.11.10) embedded, local OpenAI-compatible model prompt no card, MCP server got 1 call
After, Deny embedded, same model prompt card shown, 0 calls, agent reports the denial
After, Allow Once embedded, same model prompt card shown, 1 call
After, readOnlyHint: true Claude CLI (loopback bridge) auto no card, 1 call
After, no readOnlyHint, Deny Claude CLI (loopback bridge) auto card shown, 0 calls
Upgrade: latest stable 2026.11.12 run, then this branch on a copy of that state Claude CLI prompt (set by 2026.11.12's mcp configure) stable: no card, 1 call; branch: config valid, starts healthy, card shown, Deny gives 0 calls
Upgrade: 2026.11.10 run, then this branch on a copy of that state Claude CLI prompt (set by 2026.11.10) stable: no card, 1 call; branch: config valid, state migrates, starts healthy, card shown, Deny gives 0 calls
Earlier rounds Claude CLI prompt before: no card, 1 call; Deny: 0 calls; Allow Once: 1 call

No approval card in any run contains the call's arguments (the recipient address never appears in a card's text).

On upgrade, an existing prompt or auto setting written for Codex now asks on every runtime. That is the intended change and the compatibility risk the merge-risk label names: unattended runs (cron) on such a server stop at the ask, so those servers stay on approve. Whether the Codex-scoped key should carry this is the maintainer decision ClawSweeper raised; a neutral mcp.servers.<name>.approval key is the alternative.

Regression tests, failing on main (583e7ab) and passing on this branch, run with pnpm test <file> --maxWorkers=1 on Node 24:

  • src/gateway/mcp-http.handlers.mcp-approval.test.ts: 5 of 8 fail on main (prompt asks, auto without readOnlyHint asks, including a tool whose other hints say non-destructive and closed-world, deny and no decision do not run the tool); all 8 pass here. The 3 that pass on both (auto read-only, approve, unset) guard that the gate does not over-ask.
  • src/agents/agent-tools.before-tool-call.mcp-approval.test.ts: 2 of 2 fail on main and pass here (embedded run asks once, runs on Allow Once, refused on Deny).

ClawSweeper's finding is fixed in eb8d976: both Gateway mocks now spread the real module through importOriginal and replace only callGatewayTool. pnpm check:test-mock-exports prints Mock factory ratchet OK: 6074 grandfathered factories. (baseline unchanged). oxfmt and oxlint are clean on the changed files. git merge-tree --write-tree upstream/main HEAD is clean.

Live runs (redacted, test data only)
# before-embedded-prompt
openclaw: OpenClaw 2026.11.10 (6ea542f)
runtime: embedded | model: engine/qwen3.6-35b-a3b-64k | mailstub approval: prompt | send_mail readOnlyHint: unset
health after 9s
--- MCP server ran send_mail (1 calls):
{"t":"2026-11-29T14:05:44.651Z","call":{"name":"send_mail","arguments":{"to":"[email protected]","subject":"probe"}}}
--- Telegram messages the bot sent (text, first 160 chars):
sendMessage: <b>Working</b> 🧩 <b>Tool Describe</b>
editMessageText: <b>Working</b> 🧩 <b>Mailstub Send Mail</b> <i>running</i>
editMessageText: <b>Working</b> 🧩 <b>Mailstub Send Mail</b>
sendMessage: The tool call returned successfully — the email was sent (result: <code>SENT</code>).

# after-embedded-prompt-deny
openclaw: OpenClaw 2026.11.10 (acb931e)
runtime: embedded | model: engine/qwen3.6-35b-a3b-64k | mailstub approval: prompt | send_mail readOnlyHint: unset
health after 8s
approval card in Telegram after 71s; owner taps "Deny"
--- MCP server ran send_mail (0 calls):
(nothing)
--- Telegram messages the bot sent (text, first 160 chars):
sendMessage: 🛡️ Plugin approval required Title: Run MCP tool mailstub/send_mail Description: MCP approval mode "prompt" for this server requires an operator decision before  [buttons]
sendMessage: <b>Working</b> 🧩 <b>Mailstub Send Mail</b> <i>running</i>
editMessageText: ✅ Approval resolved here Recorded result: Denied ID: plugin:9036a70d-4b45-4106-b85f-b35224b717d6 Request: Run MCP tool mailstub/send_mail MCP approval mode "pro  [buttons]
editMessageText: ✅ Plugin approval resolved Recorded result: Denied Resolved by: Telegram approval (111222333) ID: plugin:9036a70d-4b45-4106-b85f-b35224b717d6 Request: Run MCP t  [buttons]
editMessageText: <b>Working</b> 🧩 <b>Mailstub Send Mail</b> <i>blocked</i>
sendMessage: The mailstub send_mail call was denied by user policy and did not run.
2026-11-29T13:58:36.852+00:00 [tools] mailstub__send_mail failed: BeforeToolCallFailureError: Denied by user. The tool call did not run.
This denial is final: the approval request is closed. Do not mention /approve or any other approval command to the user.
If the user still wants the action, explain that a new tool call will trigger a fresh approval request.

# after-embedded-prompt-allow
openclaw: OpenClaw 2026.11.10 (acb931e)
runtime: embedded | model: engine/qwen3.6-35b-a3b-64k | mailstub approval: prompt | send_mail readOnlyHint: unset
health after 7s
approval card in Telegram after 67s; owner taps "Allow
--- MCP server ran send_mail (1 calls):
{"t":"2026-11-29T14:01:15.196Z","call":{"name":"send_mail","arguments":{"to":"[email protected]","subject":"probe"}}}
--- Telegram messages the bot sent (text, first 160 chars):
sendMessage: 🛡️ Plugin approval required Title: Run MCP tool mailstub/send_mail Description: MCP approval mode "prompt" for this server requires an operator decision before  [buttons]
sendMessage: <b>Working</b> 🧩 <b>Mailstub Send Mail</b> <i>running</i>
editMessageText: ✅ Approval resolved here Recorded result: Allowed once ID: plugin:a4f261a4-6eff-47fb-bb7f-420f52f46f57 Request: Run MCP tool mailstub/send_mail MCP approval mod  [buttons]
editMessageText: ✅ Plugin approval resolved Recorded result: Allowed once Resolved by: Telegram approval (111222333) ID: plugin:a4f261a4-6eff-47fb-bb7f-420f52f46f57 Request: Run  [buttons]
editMessageText: <b>Working</b> 🧩 <b>Mailstub Send Mail</b>
sendMessage: The email was successfully sent to <a href="mailto:[email protected]">[email protected]</a> with the subject "probe".

# after-cli-auto-readonly
openclaw: OpenClaw 2026.11.10 (acb931e)
runtime: cli | model: anthropic/claude-haiku-5-5 | mailstub approval: auto | send_mail readOnlyHint: true
health after 9s
--- MCP server ran send_mail (1 calls):
{"t":"2026-11-29T13:49:53.687Z","call":{"name":"send_mail","arguments":{"to":"[email protected]","subject":"probe"}}}
--- Telegram messages the bot sent (text, first 160 chars):
sendMessage: <b>Working</b>
editMessageText: <b>Working</b> 🧩 <b>ToolSearch</b>
editMessageText: <b>Working</b> 🧩 <b>Mailstub Send Mail</b>
sendMessage: The send_mail tool returned <code>SENT</code>. I called it once with <a href="mailto:[email protected]">[email protected]</a> and subject=probe.

# after-cli-auto-deny
openclaw: OpenClaw 2026.11.10 (acb931e)
runtime: cli | model: anthropic/claude-haiku-5-5 | mailstub approval: auto | send_mail readOnlyHint: unset
health after 7s
approval card in Telegram after 11s; owner taps "Deny"
--- MCP server ran send_mail (0 calls):
(nothing)
--- Telegram messages the bot sent (text, first 160 chars):
sendMessage: <b>Working</b>
editMessageText: <b>Working</b> 🧩 <b>ToolSearch</b>
editMessageText: <b>Working</b> 🧩 <b>Mailstub Send Mail</b> <i>running</i>
sendMessage: 🛡️ Plugin approval required Title: Run MCP tool mailstub/send_mail Description: MCP approval mode "auto" for this server requires an operator decision before t  [buttons]
editMessageText: ✅ Approval resolved here Recorded result: Denied ID: plugin:f46e913c-f3c9-482b-be75-b994b33e62c5 Request: Run MCP tool mailstub/send_mail MCP approval mode "aut  [buttons]
editMessageText: ✅ Plugin approval resolved Recorded result: Denied Resolved by: Telegram approval (111222333) ID: plugin:f46e913c-f3c9-482b-be75-b994b33e62c5 Request: Run MCP t  [buttons]
editMessageText: <b>Working</b> 🧩 <b>Mailstub Send Mail</b>
sendMessage: The send_mail call to <a href="mailto:[email protected]">[email protected]</a> with subject "probe" was denied, so nothing was sent. I won't retry it. If you stil

# upgrade12-1-stable (latest stable)
openclaw: OpenClaw 2026.11.12 (d8f98b6)
runtime: cli | model: anthropic/claude-haiku-5-5 | mailstub approval: prompt | send_mail readOnlyHint: unset
health after 9s
--- MCP server ran send_mail (1 calls):
{"t":"2026-11-29T15:08:56.962Z","call":{"name":"send_mail","arguments":{"to":"[email protected]","subject":"probe"}}}
--- Telegram messages the bot sent (text, first 160 chars):
sendMessage: <b>Working</b>
editMessageText: <b>Working</b> 🧩 <b>ToolSearch</b>
editMessageText: <b>Working</b> 🧩 <b>Mailstub Send Mail</b>
sendMessage: The send_mail tool returned <code>SENT</code>. I called it once with <a href="mailto:[email protected]">[email protected]</a> and subject=probe.

# upgrade12-2-fix
# upgrade: fix build on a copy of the state 2026.11.12 wrote (mcp configure mailstub --approval prompt, one session already run)
Config valid: <state>/openclaw.json
openclaw: OpenClaw 2026.11.10 (eb8d976)
runtime: cli | model: anthropic/claude-haiku-5-5 | mailstub approval: prompt | send_mail readOnlyHint: unset
health after 18s
approval card in Telegram after 13s; owner taps "Deny"
--- MCP server ran send_mail (0 calls):
(nothing)
--- Telegram messages the bot sent (text, first 160 chars):
sendMessage: <b>Working</b>
editMessageText: <b>Working</b> 🧩 <b>ToolSearch</b>
editMessageText: <b>Working</b> 🧩 <b>Mailstub Send Mail</b> <i>running</i>
sendMessage: 🛡️ Plugin approval required Title: Run MCP tool mailstub/send_mail Description: MCP approval mode "prompt" for this server requires an operator decision before  [buttons]
editMessageText: ✅ Approval resolved here Recorded result: Denied ID: plugin:87f42d0b-dde8-46d6-912f-0d533295aa83 Request: Run MCP tool mailstub/send_mail MCP approval mode "pro  [buttons]
editMessageText: ✅ Plugin approval resolved Recorded result: Denied Resolved by: Telegram approval (111222333) ID: plugin:87f42d0b-dde8-46d6-912f-0d533295aa83 Request: Run MCP t  [buttons]
editMessageText: <b>Working</b> 🧩 <b>Mailstub Send Mail</b>
sendMessage: The send_mail call was denied, so no email was sent to <a href="mailto:[email protected]">[email protected]</a>. I won't retry it. If you still want the probe sen

# upgrade-1-stable (2026.11.10)
openclaw: OpenClaw 2026.11.10 (6ea542f)
runtime: cli | model: anthropic/claude-haiku-5-5 | mailstub approval: prompt | send_mail readOnlyHint: unset
health after 7s
--- MCP server ran send_mail (1 calls):
{"t":"2026-11-29T14:06:30.149Z","call":{"name":"send_mail","arguments":{"to":"[email protected]","subject":"probe"}}}
--- Telegram messages the bot sent (text, first 160 chars):
sendMessage: <b>Working</b>
editMessageText: <b>Working</b> 🧩 <b>Mailstub Send Mail</b>
sendMessage: The send_mail tool returned <code>SENT</code>. I called it once with <a href="mailto:[email protected]">[email protected]</a> and subject=probe, and got no 

# upgrade-2-fix
# upgrade: fix build on a copy of the state 2026.11.10 wrote (mcp configure mailstub --approval prompt, one session already run)
Config valid: <state>/openclaw.json
openclaw: OpenClaw 2026.11.10 (acb931e)
runtime: cli | model: anthropic/claude-haiku-5-5 | mailstub approval: prompt | send_mail readOnlyHint: unset
health after 15s
approval card in Telegram after 10s; owner taps "Deny"
--- MCP server ran send_mail (0 calls):
(nothing)
--- Telegram messages the bot sent (text, first 160 chars):
sendMessage: <b>Working</b> 🧩 <b>Mailstub Send Mail</b> <i>running</i>
sendMessage: 🛡️ Plugin approval required Title: Run MCP tool mailstub/send_mail Description: MCP approval mode "prompt" for this server requires an operator decision before  [buttons]
editMessageText: ✅ Approval resolved here Recorded result: Denied ID: plugin:46b0774e-2bca-4cf3-bae8-421e032aba81 Request: Run MCP tool mailstub/send_mail MCP approval mode "pro  [buttons]
editMessageText: ✅ Plugin approval resolved Recorded result: Denied Resolved by: Telegram approval (111222333) ID: plugin:46b0774e-2bca-4cf3-bae8-421e032aba81 Request: Run MCP t  [buttons]
editMessageText: <b>Working</b> 🧩 <b>Mailstub Send Mail</b>
sendMessage: The send_mail call didn't run. The approval for it was denied, so I didn't send the probe to <a href="mailto:[email protected]">[email protected]</a>. I won't ret

Regression tests on main and on this branch
# main (583e7ab), src files reverted, tests kept
× |gateway-core| src/gateway/mcp-http.handlers.mcp-approval.test.ts > configured MCP server approval mode on the loopback bridge > mode prompt with {} asks the operator: true
× |gateway-core| src/gateway/mcp-http.handlers.mcp-approval.test.ts > configured MCP server approval mode on the loopback bridge > mode auto with {} asks the operator: true
✓ |gateway-core| src/gateway/mcp-http.handlers.mcp-approval.test.ts > configured MCP server approval mode on the loopback bridge > mode auto with { readOnlyHint: true } asks the operator: false
× |gateway-core| src/gateway/mcp-http.handlers.mcp-approval.test.ts > configured MCP server approval mode on the loopback bridge > mode auto with { destructiveHint: false, …(1) } asks the operator: true
✓ |gateway-core| src/gateway/mcp-http.handlers.mcp-approval.test.ts > configured MCP server approval mode on the loopback bridge > mode approve with {} asks the operator: false
✓ |gateway-core| src/gateway/mcp-http.handlers.mcp-approval.test.ts > configured MCP server approval mode on the loopback bridge > mode undefined with {} asks the operator: false
× |gateway-core| src/gateway/mcp-http.handlers.mcp-approval.test.ts > configured MCP server approval mode on the loopback bridge > does not run the tool when the decision is deny
× |gateway-core| src/gateway/mcp-http.handlers.mcp-approval.test.ts > configured MCP server approval mode on the loopback bridge > does not run the tool when the decision is null
× |agents-core| src/agents/agent-tools.before-tool-call.mcp-approval.test.ts > an embedded run asks before a prompt-mode MCP tool runs (allow-once)
× |agents-core| src/agents/agent-tools.before-tool-call.mcp-approval.test.ts > an embedded run asks before a prompt-mode MCP tool runs (deny)
⎯⎯⎯⎯⎯⎯⎯ Failed Tests 5 ⎯⎯⎯⎯⎯⎯⎯
      Tests  5 failed | 3 passed (8)
⎯⎯⎯⎯⎯⎯⎯ Failed Tests 2 ⎯⎯⎯⎯⎯⎯⎯
      Tests  2 failed (2)

# this branch
 ✓ |gateway-core| src/gateway/mcp-http.handlers.mcp-approval.test.ts > configured MCP server approval mode on the loopback bridge > mode prompt with {} asks the operator: true
 ✓ |gateway-core| src/gateway/mcp-http.handlers.mcp-approval.test.ts > configured MCP server approval mode on the loopback bridge > mode auto with {} asks the operator: true
 ✓ |gateway-core| src/gateway/mcp-http.handlers.mcp-approval.test.ts > configured MCP server approval mode on the loopback bridge > mode auto with { readOnlyHint: true } asks the operator: false
 ✓ |gateway-core| src/gateway/mcp-http.handlers.mcp-approval.test.ts > configured MCP server approval mode on the loopback bridge > mode auto with { destructiveHint: false, …(1) } asks the operator: true
 ✓ |gateway-core| src/gateway/mcp-http.handlers.mcp-approval.test.ts > configured MCP server approval mode on the loopback bridge > mode approve with {} asks the operator: false
 ✓ |gateway-core| src/gateway/mcp-http.handlers.mcp-approval.test.ts > configured MCP server approval mode on the loopback bridge > mode undefined with {} asks the operator: false
 ✓ |gateway-core| src/gateway/mcp-http.handlers.mcp-approval.test.ts > configured MCP server approval mode on the loopback bridge > does not run the tool when the decision is deny
 ✓ |gateway-core| src/gateway/mcp-http.handlers.mcp-approval.test.ts > configured MCP server approval mode on the loopback bridge > does not run the tool when the decision is null
 ✓ |agents-core| src/agents/agent-tools.before-tool-call.mcp-approval.test.ts > an embedded run asks before a prompt-mode MCP tool runs (allow-once)
 ✓ |agents-core| src/agents/agent-tools.before-tool-call.mcp-approval.test.ts > an embedded run asks before a prompt-mode MCP tool runs (deny)
      Tests  8 passed (8)
      Tests  2 passed (2)

Gaps

  • Codex single approval has no live run. OpenClaw's Codex harness accepts only the openai or codex provider with an OpenAI login, and this environment has none: a Codex-runtime agent on another provider is refused (Requested agent harness "codex" does not support <provider>/<model> (provider is not one of: codex, openai)). The change on that path is narrow: in applyConfiguredMcpApproval (src/agents/agent-bundle-mcp-harness.ts) the harness keeps its existing approval and only marks the tool harnessApproval, which resolveConfiguredMcpToolApproval reads to skip the shared gate. The existing Codex configured-MCP and bundle MCP harness suites pass on this branch (424 neighbouring tests at acb931e; the new head changes only the two test mocks). A maintainer run on a signed-in Codex harness would close this gap.
  • No live run of an unattended (cron) turn; the stop when no approval route exists is shown by the deny and no-decision tests.
  • The embedded runs use one local OpenAI-compatible model; other hosted providers take the same before_tool_call wrapper but were not run.
  • The approval shows server and tool, not the arguments. auto offers Allow Once / Deny only, with no Allow Always or stored grants. The Codex harness keeps its own existing auto rule; only the shared gate is stricter.
  • Linux only, in a cloud container. No macOS or Windows run.

The per-server approval mode that `openclaw mcp configure <server> --approval`
writes was enforced only by the Codex harness. Embedded runs on other
providers and CLI backends using the loopback MCP bridge, such as Claude
CLI, ran prompt-mode tools without asking.

Resolve the mode once in the before_tool_call policy so both the embedded
wrapper and the loopback bridge ask with a plugin approval (Allow Once or
Deny) after hooks. The Codex harness marks the tools it already guards so
they are not asked twice.
Other annotation hints no longer waive the ask. Document that the
approval never shows call arguments and that unattended runs with no
approval route stop the call.
@clawsweeper

clawsweeper Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime agents Agent runtime and tooling size: M labels Nov 29, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. impact:auth-provider Auth, provider routing, model choice, or SecretRef resolution may break. impact:ux-friction User-facing flow adds avoidable confusion or support burden without fully blocking progress. labels Nov 29, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Nov 29, 2026
@clawsweeper

clawsweeper Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

What this changes

This PR applies explicit configured-MCP approval modes to embedded agents and CLI bridges while retaining Codex's existing approval owner.

Example: Configure mailstub with --approval prompt, then ask an embedded agent to call send_mail.

  • Before: The MCP server receives the call without an approval prompt.
  • After: An Allow Once/Deny request appears, and Deny prevents the server call.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The focused patch has no definite code findings and now includes latest-stable upgrade evidence, but required proof remains incomplete and product direction is unresolved.
Proof confidence 🦪 silver shellfish (2/6) Real behavior proof is necessary before merge. See Before merge.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Feature · Worth it: Needs a maintainer decision · Fix scope: Complete
User problem: Operators cannot configure one ask-before-running policy for MCP tools across embedded agents, Codex, and CLI backends.
Reason: The capability has concrete user value, but the documented Codex-only contract and existing plugin approval extension leave core ownership and compatibility to an area owner.

Merge readiness

⛔ Blocked before merge - 1 item remains

Keep open: this PR provides a coherent cross-runtime approval capability, but extending a documented Codex-only setting still needs a maintainer decision.

Reviewed head: eb8d976623fc18ce74bd0f9d687b9dff164d0e51
Owner decision: Required. See Decision needed.

Decision needed

  • Question: Should codex.defaultToolsApprovalMode also govern embedded and CLI-bridge calls, including stopping unattended jobs and using different auto/grant semantics outside Codex?
  • Recommendation: Approve the existing-setting expansion: Accept the documented behavior change for configured prompt/auto servers, including unattended-call blocking and Allow Once/Deny outside Codex, and align the CLI reference with that decision.
  • Why: The existing contract explicitly scopes this setting to Codex, and no owner approval of this expansion appears in the PR or linked discussions.

Before merge

  • Add real behavior proof - Gateway logs exercise the changed embedded wrapper and CLI bridge against a real stdio MCP server, including Allow Once/Deny and the latest-stable state-copy upgrade; the previously requested live Codex single-approval scenario remains explicitly unexecuted. After adding proof, update the PR body, then request a new review with @clawsweeper re-review. The PR author or someone with repository write access can request it.

Findings

None.

Tests

  • Missing end-to-end proof: Provide a signed-in Codex dynamic-MCP trace showing exactly one approval decision and one execution through the harness-owned path; redact credentials, IPs, phone numbers, and non-public endpoints.
Agent review details

How this fits together

Configured MCP tools carry server policy into agent execution; the shared before-tool-call pipeline obtains an operator decision before dispatching calls to the MCP server.

flowchart TD
  A[Configured MCP metadata] --> B[Embedded tool wrapper]
  A --> C[CLI loopback bridge]
  B --> D[Before tool call policy]
  C --> D
  D --> E[Plugin approval routing]
  E --> F[MCP server execution]
  A --> G[Codex approval owner]
  G --> F
Loading

Technical review

Best possible solution:

Use one maintainer-approved configured-MCP policy with existing approval routing while preserving Codex's approval ownership.

Do we have a high-confidence way to reproduce the issue?

Current-main materialization and execution paths establish the runtime difference, supported by contributor-supplied released-Gateway traces; no target code was executed during this read-only review.

Is this the best way to solve the issue?

Reusing the shared policy pipeline and approval transport is a focused implementation, but widening the stored setting and choosing different auto semantics require an explicit product decision.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against e36ee79bf2df.

Provenance checked

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Youssef Hemimy: Raw commit 1e37a56 adds src/agents/agent-bundle-mcp-harness.ts:93 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 1e37a56c7528; files: src/agents/agent-bundle-mcp-harness.ts)

PR surface

Source +80, Tests +182, Docs +10. Total +272 across 10 files. Added test files: 2.

View PR surface stats
Area Files Added Removed Net
Source 6 84 4 +80
Tests 2 182 0 +182
Docs 2 10 0 +10
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 10 276 4 +272

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

No label changes.

Label justifications:

  • merge-risk: 🚨 compatibility: Existing Codex-scoped prompt/auto settings gain enforcement on other runtimes, so previously successful unattended MCP calls can stop after upgrade.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Supply the outstanding Codex dynamic-MCP single-approval trace.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (3 earlier review cycles)
  • reviewed 2026-11-29T11:45:10.208Z sha acb931e :: needs real behavior proof before merge. :: [P2] [P2] Preserve real exports in both new Gateway mocks
  • reviewed 2026-11-29T14:30:25.312Z sha eb8d976 :: needs real behavior proof before merge. :: none
  • reviewed 2026-11-29T14:48:52.580Z sha eb8d976 :: needs real behavior proof before merge. :: none

Reviewed November 29, 2026, 11:20 AM ET / 16:20 UTC (Revision 4).

@clawsweeper

clawsweeper Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀

Re-review progress:

@kitiyeung

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀

Re-review progress:

@kitiyeung

Copy link
Copy Markdown
Contributor Author

Second proof round for ClawSweeper's review of eb8d976, now in the PR body's Evidence section:

  • Upgrade from the latest stable, live: 2026.11.12 writes --approval prompt and runs one turn, and the tool runs with no card. This branch then starts on a copy of that state. The config is valid and the Gateway comes up healthy. It asks, and Deny leaves the MCP server with 0 calls.
  • Codex single approval: this can't run live here. The Codex harness accepts only the openai/codex provider with an OpenAI login, and this environment has none. The body names the gap, the exact code path, and the suites that cover it. A run on a signed-in Codex harness would close it.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀

Re-review progress:

This branch has not been deployed

No deployments
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 gateway Gateway runtime impact:auth-provider Auth, provider routing, model choice, or SecretRef resolution may break. impact:ux-friction User-facing flow adds avoidable confusion or support burden without fully blocking progress. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: M status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Honour per-server MCP tool approval on every runtime and provider, not only Codex

1 participant