Skip to content

fix(web-search): honor sandbox provider trust during search - #191748

Merged
roboclaw-bot merged 2 commits into
mainfrom
loop/contributor-pr-144520
Nov 3, 2026
Merged

roboclaw-bot merged 2 commits into
mainfrom
loop/contributor-pr-144520

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Supersedes #144520, thanks @Finn763.
Related: #144164.

What Problem This Solves

Fixes sandboxed agents executing a configured third-party web-search provider that the existing sandbox trust policy excludes.

User Impact

Sandboxed search permits only bundled or verified official providers, matching web fetch. Existing sandboxed configurations selecting third-party providers must enable or select an eligible provider to restore search; the execution error states that recovery step. Nonsandboxed search keeps its existing behavior.

Why This Change Was Made

Carry the session sandbox flag through both search resolver routes into the existing shared manifest trust filter. The sandbox-only availability hint does not load rejected provider code or mislabel unavailable eligible providers as trust failures.

Production LOC is net +1: the recovery hint is offset by removing obsolete type exclusions, redundant request-field forwarding, and a duplicate inherited authStore field. No second trust policy is added.

Evidence

  • Real-loader red/green on main baseline 5918b1d7bf4bca308322e0c0a7f5b5acb1311d48: both sandboxed cases executed the configured workspace plugin instead of rejecting; six controls passed. With the fix, all eight cases pass. The rejected plugin leaves no module-import, registration, tool-creation, or execution trace. Nonsandboxed and bundled sandboxed controls record all four phases. Existing provider settings remain selected; no config migration or rewrite is involved.
  • All 115 focused tests in eight named files pass on Blacksmith Testbox, including both search resolution routes, fetch/shared resolver siblings, verified-official eligibility, agent tool late binding, and prompt stability. Four shards completed in 58.43 seconds. The new loader regression takes about 0.7 seconds of test execution; cold baseline file wall time was 38.95 seconds including worker compilation. Real-loader proof run.
  • Touched-file formatting and lint pass. PR CI supplies broad build/type/security proof. No live model/Gateway run is claimed; the committed regression exercises real plugin discovery, loading, registration, and provider execution through runWebSearch with isolated state and synthetic search results.
  • Autoreview P0–P2 covered the complete final working tree against 5918b1d7bf4bca308322e0c0a7f5b5acb1311d48. Its only finding was the historical manually assembled registry still in the index; staging the reviewed real-loader replacement resolved it. No other P0–P2 findings were established. The earlier CI test-type failure was that removed fixture's missing source field.
  • The independent allocation funds exactly the 100 added regression lines. Existing runtime tests mock provider selection and cannot detect this trust bypass. The prior CI run reported a test-line ceiling six lines over budget. A clean detached main 31ad71a8addc1d42fbc5478f7e114860f5cbf6c7 replay on the same Testbox independently fails the same checker: Test lines: 6422178; ceiling: 6422172; over by: 6; net delta: +283, comparing that main commit with its parent using the CI-supported immutable-base flags. This existing six-line debt is not funded or hidden by this change.
  • Contributor code was read with gh pr view/diff only; it was never checked out or run. Human credit is deduplicated to @Finn763.

Final CI on 51271bf38f9eea1b114609c1613a6fe88c33fdc6 (run 41599649898) completed: all tests, types, lint, build and security checks pass. Only the existing test-line ceiling fails (6422278 / 6422272, six over, +100 fully funded lines), with its downstream CI gate. Landing uses the native inherited-failure evidence route; failed CI remains recorded.

Pass sandbox context to both web-search provider resolvers so their existing
shared manifest filter rejects untrusted providers before tool creation.
Keep bundled, verified official, and nonsandboxed provider behavior intact.

Supersedes #144520, thanks @Finn763. Related: #144164.

Co-authored-by: finn763 <[email protected]>
@clawsweeper

clawsweeper Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@roboclaw-bot
roboclaw-bot marked this pull request as ready for review November 3, 2026 07:42
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

@clawsweeper review

@clawsweeper

clawsweeper Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 3, 2026
@roboclaw-bot
roboclaw-bot enabled auto-merge (squash) November 3, 2026 07:47
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 3, 2026
@clawsweeper

clawsweeper Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

What this changes

This PR forwards sandbox status through both web-search resolver routes into the existing provider trust filter.

Example: A sandboxed agent searches using the configured workspace provider fixture-search.

  • Before: The workspace provider executes despite the sandbox provider-origin restriction.
  • After: Provider selection rejects it before tool creation.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) A focused and useful policy repair with an actionable rejection defect and insufficient final-effect evidence.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is necessary before merge. See Before merge.
Patch quality 🦐 gold shrimp (3/6) Security review found an item that needs attention.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Sandboxed agents can execute installed search providers excluded by the existing provider-origin policy.
Reason: The repair restores an existing shared policy, and the maintainer-authored PR explicitly accepts its compatibility cutoff.

Merge readiness

⛔ Blocked before merge - 4 items remain

Keep this PR open: it repairs a current sandbox trust-policy omission, but the new rejection path needs actionable recovery guidance.

Priority: P2
Reviewed head: 4b1188d95c7c03148444a8c9d542010b388bb2fa

Before merge

  • Add real behavior proof - Authority-chain proof required: the supplied runWebSearch regression uses real selection and filtering with a synthetic generation registry and mocked provider factories/execution, bypassing real plugin loading and I/O. Capture the same configured provider rejected for a sandboxed agent before module evaluation, registration, and I/O, plus a nonsandboxed execution control and an eligible sandboxed provider. Include the existing-install upgrade cutoff with settings intact, and redact credentials and non-public endpoints. Earlier proof on the superseded PR does not prove this head. 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.
  • Explain why the configured sandboxed provider was rejected (P2) - With tools.web.search.provider set to an enabled workspace provider such as fixture-search and sandboxed=true, the newly forwarded flag removes that provider and runWebSearch throws only "web_search is disabled or no provider is available." Search was enabled and worked before this change, so the error neither identifies the trust restriction nor tells the user how to recover. Derive the rejection from manifest metadata and point to selecting a bundled or verified official provider; do not resolve the rejected provider without filtering to diagnose it.
  • Resolve security review attention item - The patch restores the intended trust filter, but real-loader rejection before plugin side effects remains unverified.
  • Resolve merge risk - The PR owner must establish that rejected providers cannot reach module evaluation, registration, or I/O through real loader paths.

Findings

  • [P2] Explain why the configured sandboxed provider was rejected — src/web-search/runtime.ts:242

Tests

  • Missing end-to-end proof: Show real-loader rejection before forbidden plugin side effects, eligible-provider execution, and the accepted cutoff after upgrading an existing configured installation.
Agent review details

How this fits together

The web-search runtime receives agent sandbox status and search arguments, resolves eligible plugin providers, and executes the selected provider to return search results.

flowchart TD
  A[Agent web search tool] --> B[Search request context]
  B --> C[Runtime or plugin resolver]
  C --> D[Shared manifest trust filter]
  D --> E[Eligible provider registry]
  E --> F[Provider tool execution]
  F --> G[Search results]
Loading

Technical review

Best possible solution:

Keep the shared-filter repair and explain trust rejection using manifest metadata, with a visible route to select an eligible provider.

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

Current-main source shows agent sandbox status reaching runWebSearch and being dropped before the shared trust predicate; this read-only review ran no target code.

Is this the best way to solve the issue?

Forwarding the existing flag is the smallest complete enforcement repair, but the newly reachable rejection needs recovery guidance without loading rejected plugin code.

Full review comments:

  • [P2] Explain why the configured sandboxed provider was rejected — src/web-search/runtime.ts:242
    With tools.web.search.provider set to an enabled workspace provider such as fixture-search and sandboxed=true, the newly forwarded flag removes that provider and runWebSearch throws only "web_search is disabled or no provider is available." Search was enabled and worked before this change, so the error neither identifies the trust restriction nor tells the user how to recover. Derive the rejection from manifest metadata and point to selecting a bundled or verified official provider; do not resolve the rejected provider without filtering to diagnose it.
    Confidence: 0.97

Overall correctness: patch is incorrect
Overall confidence: 0.95

AGENTS.md: found and applied where relevant.

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

Merge-risk options

Maintainer options:

  1. Verify rejection through real plugin loading (recommended)
    The PR owner should capture allowed and forbidden provider cases through production loading, observing module evaluation, registration, and final I/O.

Provenance checked

  • Request-context preparation keeps the original intent (dd5b70b: Share web-search configuration and provider-load preparation across resolution paths.)
  • Shared resolver parameter types changes intended behavior with a stated reason (22221e8: Consolidate duplicated helper contracts while preserving behavior; the later private-knob cleanup retained the sandbox exclusion.)
  • Lazy provider loading and explicit scope keeps the original intent (perf(web-search): defer bundled provider runtime imports #135073: Avoid importing unrelated bundled runtimes while preserving scoped execution and external-provider fallback.)

Testing

Proof path: in-process harness.

Security

Needs attention: The patch restores the intended trust filter, but real-loader rejection before plugin side effects remains unverified.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit f05fed0 adds src/web-search/runtime.ts:290 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: f05fed04956d; files: src/web-search/runtime.ts)
  • Vincent Koc: Raw commit dd5b70b adds src/web-search/runtime.ts:269 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: dd5b70bcc42c; files: src/web-search/runtime.ts)

PR surface

Source -2, Tests +88, Other +1. Total +87 across 5 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 3 8 10 -2
Tests 1 88 0 +88
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 1 0 +1
Total 5 97 10 +87

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #144164
Summary: The issue and both PRs address the same dropped sandbox-status handoff.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Labels

Label changes:

  • add P2: The existing policy omission requires an installed and enabled provider; no general sandbox escape is established.
  • add merge-risk: 🚨 compatibility: Sandboxed configurations selecting third-party providers intentionally stop searching; the maintainer-authored PR accepts that cutoff.
  • add merge-risk: 🚨 security-boundary: The change controls which plugin code sandboxed agents may invoke, and real-loader final-effect coverage remains unproven.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦐 gold shrimp.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Label justifications:

  • P2: The existing policy omission requires an installed and enabled provider; no general sandbox escape is established.
  • merge-risk: 🚨 compatibility: Sandboxed configurations selecting third-party providers intentionally stop searching; the maintainer-authored PR accepts that cutoff.
  • merge-risk: 🚨 security-boundary: The change controls which plugin code sandboxed agents may invoke, and real-loader final-effect coverage remains unproven.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦐 gold shrimp.
  • 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.

  • Add final-effect proof for a sandboxed agent selecting a forbidden workspace provider, with allowed-provider controls through real plugin loading.

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.

Reviewed November 3, 2026, 2:46 AM ET / 07:46 UTC.

@roboclaw-bot
roboclaw-bot disabled auto-merge November 3, 2026 07:49
Exercise an on-disk provider through manifest discovery and the real loader,
checking import, registration, tool creation, and execution side effects.
Replace the manually assembled registration fixture that failed typecheck.
Give sandboxed callers an actionable provider requirement without loading
rejected code or attributing every availability failure to trust policy.

Co-authored-by: finn763 <[email protected]>
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

The reviewed head is replaced by a real-loader regression: an on-disk workspace provider is selected from unchanged existing config and records module import, registration, tool creation, and execution. Both sandboxed routes execute on main (red); with this head they reject with no trace file, while all six nonsandboxed/bundled controls execute. All 115 focused tests and touched-file formatting/lint pass on Blacksmith Testbox. The sandbox-only error now gives the eligible-provider recovery step without loading rejected code or claiming that every unavailable provider failed trust. PR body and proof are current.

@clawsweeper

clawsweeper Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 3, 2026
@roboclaw-bot
roboclaw-bot merged commit 3e3935a into main Nov 3, 2026
151 of 154 checks passed
@roboclaw-bot
roboclaw-bot deleted the loop/contributor-pr-144520 branch November 3, 2026 08:07
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 4, 2026
…#191748)

Sandboxed web search dropped its session sandbox flag before resolving a provider, allowing configured untrusted workspace or external providers to execute. Carry that flag through both resolver routes into the existing shared manifest trust filter used by web fetch. Bundled, verified official, and nonsandboxed behavior stay intact.

Give sandboxed callers an actionable availability hint without loading rejected provider code for diagnostics. Remove obsolete type exclusions, redundant request forwarding, and a duplicate inherited authStore field; production LOC is net +1.

The 100-line regression allocation protects the real plugin-loader boundary. On main, two sandboxed rejection cases execute the workspace plugin unexpectedly; the fix passes both and all six controls, with no import, registration, tool creation, or execution trace for rejected code. All 115 focused tests and touched-file format/lint pass on Blacksmith Testbox. The final working tree received P0-P2 autoreview; its only index-only fixture finding was resolved by staging the reviewed replacement.

Final CI passes tests, types, lint, builds and security. Its only failure is the existing shared test-line ceiling, six lines over budget, independently reproduced on clean main f77ae72. Own 100-line regression growth is exactly funded. Landing uses the native inherited-failure evidence route without relabeling failed CI.

Supersedes openclaw#144520, thanks @Finn763. Related: openclaw#144164.

Co-authored-by: finn763 <[email protected]>
tideclaw-bot pushed a commit that referenced this pull request Nov 6, 2026
Sandboxed web search dropped its session sandbox flag before resolving a provider, allowing configured untrusted workspace or external providers to execute. Carry that flag through both resolver routes into the existing shared manifest trust filter used by web fetch. Bundled, verified official, and nonsandboxed behavior stay intact.

Give sandboxed callers an actionable availability hint without loading rejected provider code for diagnostics. Remove obsolete type exclusions, redundant request forwarding, and a duplicate inherited authStore field; production LOC is net +1.

The 100-line regression allocation protects the real plugin-loader boundary. On main, two sandboxed rejection cases execute the workspace plugin unexpectedly; the fix passes both and all six controls, with no import, registration, tool creation, or execution trace for rejected code. All 115 focused tests and touched-file format/lint pass on Blacksmith Testbox. The final working tree received P0-P2 autoreview; its only index-only fixture finding was resolved by staging the reviewed replacement.

Final CI passes tests, types, lint, builds and security. Its only failure is the existing shared test-line ceiling, six lines over budget, independently reproduced on clean main 31ad71a. Own 100-line regression growth is exactly funded. Landing uses the native inherited-failure evidence route without relabeling failed CI.

Supersedes #144520, thanks @Finn763. Related: #144164.

Co-authored-by: finn763 <[email protected]>

Backport-source: 3e3935a
Backport-scope: Propagate sandboxed through request context and provider resolution plus C1 preparation and synchronous availability entrypoints. Preserve C1 authStore parameter and existing official-provider trust predicate; no blanket plugin trust change.

Adapted production backport for release/2026.11.2. Upstream validation descriptions refer to source history; candidate regression coverage and remote qualification are tracked separately.

Co-authored-by: RomneyDa <[email protected]>
RomneyDa added a commit that referenced this pull request Nov 17, 2026
Sandboxed web search dropped its session sandbox flag before resolving a provider, allowing configured untrusted workspace or external providers to execute. Carry that flag through both resolver routes into the existing shared manifest trust filter used by web fetch. Bundled, verified official, and nonsandboxed behavior stay intact.

Give sandboxed callers an actionable availability hint without loading rejected provider code for diagnostics. Remove obsolete type exclusions, redundant request forwarding, and a duplicate inherited authStore field; production LOC is net +1.

The 100-line regression allocation protects the real plugin-loader boundary. On main, two sandboxed rejection cases execute the workspace plugin unexpectedly; the fix passes both and all six controls, with no import, registration, tool creation, or execution trace for rejected code. All 115 focused tests and touched-file format/lint pass on Blacksmith Testbox. The final working tree received P0-P2 autoreview; its only index-only fixture finding was resolved by staging the reviewed replacement.

Final CI passes tests, types, lint, builds and security. Its only failure is the existing shared test-line ceiling, six lines over budget, independently reproduced on clean main 31ad71a. Own 100-line regression growth is exactly funded. Landing uses the native inherited-failure evidence route without relabeling failed CI.

Supersedes #144520, thanks @Finn763. Related: #144164.

Co-authored-by: finn763 <[email protected]>
(cherry picked from commit 3e3935a)

Release adaptation (OpenClaw 2026.11.6):
- Cherry-picked onto parent candidate 82f1197 after the scoped #189423 backport. No production or regression-test adaptation required; preserved release's existing tool-result-error import.
- Existing manifest trust filtering and explicit empty scopes remain the sole selection authority; sandboxed is now carried through context and both existing selection routes. No new trust owner, configuration, or permissions.
- Companion audit pinned at bd692e9: e333f7e (#197657) removes the allocation after main's ratchet reset, not applicable here; retain source's 100-line allocation. a30ec5d (#177228) changes native-research/account-pinning execution, not a prerequisite for sandbox selection and excluded. No later PR mentions. Existing shared trust filter/empty-scope refusal is present-equivalent. Other heuristic runtime-name references do not consume the changed contract.

Release validation (local isolated worktree):
- Before this pick, source's real-plugin-loader regression: 2 failed / 6 passed. Both sandboxed workspace cases executed rejected code through runtime preference true and false.
- After this pick: 95 passed across 7 runtime/owner suites, including all 8 regression cases and shared empty-scope cases. Additional tool, provider-error, fetch-provider and setup consumers pass (counts recorded in lane report).
- Changed-TypeScript type-aware lint: 4 files clean using supported core config. Changed-file formatting and git diff --check clean. Manual self-review/pr-simplify: direct propagation into existing owner, no duplicate policy; 3 production files, net +1 line.
- No real model/Gateway end-to-end run or broad gates in this lane; parent owns final release qualification. Upstream claims above describe source validation, not release qualification. One attempted suite was absent on this release and was corrected before running; not a product failure.

Co-authored-by: RomneyDa <[email protected]>
(cherry picked from commit 3be9be1ddaa4a19d3672994f03bf580fcf20b6c3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: S 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.

1 participant