Skip to content

fix(memory-wiki): sandboxed sub-agents could read other agents' bridged memory through shared vault wiki reads - #111463

Merged
obviyus merged 1 commit into
openclaw:mainfrom
yetval:fix/memory-wiki-bridge-page-agent-scope
Jul 29, 2026
Merged

obviyus merged 1 commit into
openclaw:mainfrom
yetval:fix/memory-wiki-bridge-page-agent-scope

Conversation

@yetval

@yetval yetval commented Jul 19, 2026 •

Copy link
Copy Markdown
Contributor

Closes #103087

What Problem This Solves

Fixes an issue where a sandboxed sub-agent belonging to one agent identity could read another agent's bridge-compiled memory content through wiki_get, wiki_search, and the memory_get/memory_search corpus fallback. With bridge.enabled: true, every agent's memory-root, daily-note, dream-report, and event-log artifacts are compiled into the one shared global vault, and the wiki-corpus read path returned any matching vault page with no check of the caller's agentId, agentSessionKey, or sandboxed flag, even though the sessions-corpus branch in the same file already blocks the equivalent cross-agent read.

#103349 added the opt-in vault.scope: "agent" isolation and filtered bridge sync by ownership, but as noted on the issue the default global vault query path remained caller-unfiltered, so the reported disclosure is still live on current main.

Why This Change Was Made

The fix reuses the ownership model #103349 established instead of adding new configuration: bridge pages already carry bridgeAgentIds frontmatter written by bridge sync (extensions/memory-wiki/src/bridge.ts:231), so WikiPageSummary now surfaces that field and the wiki-corpus branch of getMemoryWikiPage and searchWikiCorpus filters pages through one visibility gate.

The gate is deliberately limited to sandboxed callers and fails closed on bridge-compiled pages. A page counts as bridge-compiled when its sourceType is memory-bridge or memory-bridge-events, or when it carries any bridgeAgentIds entry. A sandboxed caller with a resolved agent identity reads its own bridge pages and every ordinary wiki page, but not another agent's bridge pages and not a bridge page whose ownership metadata is absent or empty. A sandboxed caller with no resolvable agent reads no bridge page at all. Ordinary non-sandboxed callers retain the documented vault.scope: "global" behavior, including cross-agent bridge reads. Ownership comparison is case-insensitive, matching the existing agent-id comparisons in this file.

The gate lives in query.ts rather than in any caller, so it covers every wiki-corpus read surface at once. createWikiCorpusSupplement already forwards agentId, agentSessionKey, and sandboxed into searchMemoryWiki and getMemoryWikiPage, and Memory Core already forwards ctx.sandboxed from the plugin tool context through resolveMemoryToolOptions (extensions/memory-core/index.ts:160) into searchMemoryCorpusSupplements and getMemoryCorpusSupplementResult, so the registered memory_search/memory_get corpus fallback picks up the same visibility rule with no change outside extensions/memory-wiki. The regression now drives that registered route through the real memory-core plugin registration rather than calling the supplement directly.

Note: open PR #105098 also touches searchWikiCorpus (deadline threading in the supplement fallback). The concerns are independent, but whichever lands second will need a trivial rebase of the searchWikiCorpus signature.

User Impact

Sandboxed sub-agents using the default shared vault with the memory bridge can no longer read another agent's bridged memory content, and can no longer read bridge pages that carry no ownership metadata. Normal non-sandboxed agent calls keep the documented global-vault sharing contract, including cross-agent bridge reads and unowned bridge reads. Single-agent setups see no behavior change: the agent owns its bridge pages, because every bridged workspace resolves at least one agent id (resolveMemoryDreamingWorkspaces), and ordinary wiki pages remain readable.

No stored data shape changes. bridgeAgentIds is the only ownership key bridge sync has ever written, from the bridge feature's first commit fbbe2a1675 (2026-04-05) onward, so there is no earlier on-disk frontmatter shape to migrate and no doctor migration is required. Vaults whose bridge pages predate an ownership-reporting memory provider are covered by the fail-closed rule above rather than by a rewrite.

Evidence

Driver: the real wiki_get and wiki_search agent tools from extensions/memory-wiki/src/tool.ts, built by createWikiGetTool/createWikiSearchTool exactly as index.ts registers them, plus the real memory_get and memory_search tools obtained from the actual memory-core plugin registration (memoryCorePlugin.register(...), then the registered tool factory invoked with a plugin tool context carrying agentId, sessionKey, and sandboxed), with the wiki supplement installed through the real registerMemoryCorpusSupplement registry that Memory Core reads. All four surfaces run against one real on-disk vault created by the production resolveMemoryWikiConfig plus initializeMemoryWikiVault. Nothing is stubbed on the read path; the only difference between the two runs is query.ts plus markdown.ts.

Vault contents are synthetic fixture pages written in the exact shape bridge.ts produces: one bridge page owned by agent secondary (frontmatter bridgeAgentIds: ["secondary"]) and one bridge page with no ownership metadata, standing in for a vault whose bridge pages were compiled from a memory provider that does not report agent ids. No private vault content or real vault path appears below; the sentinel strings and sources/... paths are fixture data from a temporary vault.

Validation on head d1be22cbbf:

  • node scripts/run-vitest.mjs run extensions/memory-wiki/src/query.test.ts extensions/memory-wiki/src/corpus-supplement.visibility.test.ts extensions/memory-wiki/src/claim-health.test.ts extensions/memory-wiki/src/agent-vault-isolation.test.ts extensions/memory-wiki/src/corpus-supplement.test.ts: 5 files, 64 tests passed.
  • node scripts/run-vitest.mjs run extensions/memory-core/src/tools.test.ts: 1 file, 44 tests passed.
  • node scripts/run-tsgo.mjs -p tsconfig.extensions.json: clean.
  • node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.extensions.test.json: clean.
  • node scripts/run-oxlint.mjs over the changed files: clean.
  • oxfmt --check over the changed files: clean.
  • git diff --check: clean.

Real behavior proof

Behavior addressed: a sandboxed sub-agent of one agent could read another agent's bridge-compiled memory, and any sandboxed sub-agent could read bridge pages carrying no ownership metadata, through the shared global vault read surfaces.
Real environment tested: the registered wiki_get, wiki_search, memory_get, and memory_search agent tools driven against one real on-disk global vault, run on pristine main and on this branch with identical inputs and identical vault contents.
Exact steps or command run after this patch: three callers issue the same four calls against the same vault for each of two bridged pages: a sandboxed sub-agent of main, a sandboxed sub-agent of secondary (the owner of the first page), and a normal non-sandboxed main session.
Evidence after fix:

# BEFORE (pristine main f8cc39ce62)
--- sandboxed sub-agent of main reads secondary's bridged page
wiki_get -> # Secondary Daily Note 2026-07-09 | SECRET-SENTINEL: secondary agent private plan. | ## Related
wiki_search -> 1. Secondary Daily Note 2026-07-09 (wiki/source) | Path: sources/secondary-daily-note-2026-07-09.md | Snippet: SECRET-SENTINEL: secondary agent private plan.
registered memory_get -> {"path":"sources/secondary-daily-note-2026-07-09.md","text":"SECRET-SENTINEL: secondary agent private plan."}
registered memory_search -> [{"path":"sources/secondary-daily-note-2026-07-09.md","snippet":"SECRET-SENTINEL: secondary agent private plan."}]

--- sandboxed sub-agent of secondary (the owner) reads secondary's bridged page
wiki_get -> # Secondary Daily Note 2026-07-09 | SECRET-SENTINEL: secondary agent private plan. | ## Related
wiki_search -> 1. Secondary Daily Note 2026-07-09 (wiki/source) | Path: sources/secondary-daily-note-2026-07-09.md | Snippet: SECRET-SENTINEL: secondary agent private plan.
registered memory_get -> {"path":"sources/secondary-daily-note-2026-07-09.md","text":"SECRET-SENTINEL: secondary agent private plan."}
registered memory_search -> [{"path":"sources/secondary-daily-note-2026-07-09.md","snippet":"SECRET-SENTINEL: secondary agent private plan."}]

--- normal non-sandboxed main session reads secondary's bridged page
wiki_get -> # Secondary Daily Note 2026-07-09 | SECRET-SENTINEL: secondary agent private plan. | ## Related
wiki_search -> 1. Secondary Daily Note 2026-07-09 (wiki/source) | Path: sources/secondary-daily-note-2026-07-09.md | Snippet: SECRET-SENTINEL: secondary agent private plan.
registered memory_get -> {"path":"sources/secondary-daily-note-2026-07-09.md","text":"SECRET-SENTINEL: secondary agent private plan."}
registered memory_search -> [{"path":"sources/secondary-daily-note-2026-07-09.md","snippet":"SECRET-SENTINEL: secondary agent private plan."}]

--- sandboxed sub-agent of main reads bridged page with no ownership metadata
wiki_get -> # Unowned Bridge Note 2026-07-09 | SECRET-SENTINEL: bridge page with no ownership metadata. | ## Related
wiki_search -> 1. Unowned Bridge Note 2026-07-09 (wiki/source) | Path: sources/unowned-bridge-note-2026-07-09.md | Snippet: SECRET-SENTINEL: bridge page with no ownership metadata.
registered memory_get -> {"path":"sources/unowned-bridge-note-2026-07-09.md","text":"SECRET-SENTINEL: bridge page with no ownership metadata."}
registered memory_search -> [{"path":"sources/unowned-bridge-note-2026-07-09.md","snippet":"SECRET-SENTINEL: bridge page with no ownership metadata."}]

--- normal non-sandboxed main session reads bridged page with no ownership metadata
wiki_get -> # Unowned Bridge Note 2026-07-09 | SECRET-SENTINEL: bridge page with no ownership metadata. | ## Related
wiki_search -> 1. Unowned Bridge Note 2026-07-09 (wiki/source) | Path: sources/unowned-bridge-note-2026-07-09.md | Snippet: SECRET-SENTINEL: bridge page with no ownership metadata.
registered memory_get -> {"path":"sources/unowned-bridge-note-2026-07-09.md","text":"SECRET-SENTINEL: bridge page with no ownership metadata."}
registered memory_search -> [{"path":"sources/unowned-bridge-note-2026-07-09.md","snippet":"SECRET-SENTINEL: bridge page with no ownership metadata."}]

# AFTER (this patch, identical inputs, head d1be22cbbf)
--- sandboxed sub-agent of main reads secondary's bridged page
wiki_get -> Wiki page not found: sources/secondary-daily-note-2026-07-09.md
wiki_search -> No wiki or memory results.
registered memory_get -> {"path":"sources/secondary-daily-note-2026-07-09.md","text":"","disabled":true,"error":"wiki corpus result not found"}
registered memory_search -> []

--- sandboxed sub-agent of secondary (the owner) reads secondary's bridged page
wiki_get -> # Secondary Daily Note 2026-07-09 | SECRET-SENTINEL: secondary agent private plan. | ## Related
wiki_search -> 1. Secondary Daily Note 2026-07-09 (wiki/source) | Path: sources/secondary-daily-note-2026-07-09.md | Snippet: SECRET-SENTINEL: secondary agent private plan.
registered memory_get -> {"path":"sources/secondary-daily-note-2026-07-09.md","text":"SECRET-SENTINEL: secondary agent private plan."}
registered memory_search -> [{"path":"sources/secondary-daily-note-2026-07-09.md","snippet":"SECRET-SENTINEL: secondary agent private plan."}]

--- normal non-sandboxed main session reads secondary's bridged page
wiki_get -> # Secondary Daily Note 2026-07-09 | SECRET-SENTINEL: secondary agent private plan. | ## Related
wiki_search -> 1. Secondary Daily Note 2026-07-09 (wiki/source) | Path: sources/secondary-daily-note-2026-07-09.md | Snippet: SECRET-SENTINEL: secondary agent private plan.
registered memory_get -> {"path":"sources/secondary-daily-note-2026-07-09.md","text":"SECRET-SENTINEL: secondary agent private plan."}
registered memory_search -> [{"path":"sources/secondary-daily-note-2026-07-09.md","snippet":"SECRET-SENTINEL: secondary agent private plan."}]

--- sandboxed sub-agent of main reads bridged page with no ownership metadata
wiki_get -> Wiki page not found: sources/unowned-bridge-note-2026-07-09.md
wiki_search -> No wiki or memory results.
registered memory_get -> {"path":"sources/unowned-bridge-note-2026-07-09.md","text":"","disabled":true,"error":"wiki corpus result not found"}
registered memory_search -> []

--- normal non-sandboxed main session reads bridged page with no ownership metadata
wiki_get -> # Unowned Bridge Note 2026-07-09 | SECRET-SENTINEL: bridge page with no ownership metadata. | ## Related
wiki_search -> 1. Unowned Bridge Note 2026-07-09 (wiki/source) | Path: sources/unowned-bridge-note-2026-07-09.md | Snippet: SECRET-SENTINEL: bridge page with no ownership metadata.
registered memory_get -> {"path":"sources/unowned-bridge-note-2026-07-09.md","text":"SECRET-SENTINEL: bridge page with no ownership metadata."}
registered memory_search -> [{"path":"sources/unowned-bridge-note-2026-07-09.md","snippet":"SECRET-SENTINEL: bridge page with no ownership metadata."}]

Observed result after fix: on all four read surfaces, including the registered Memory Core fallback, the sandboxed foreign caller went from full disclosure to denial, and the sandboxed caller of an unowned bridged page went from full disclosure to denial, while the owner's sandboxed reads and every non-sandboxed read stayed byte-identical across the two runs.
What was not tested: a full gateway run with a live bridge.enabled sync cycle writing the pages through syncMemoryWikiBridgeSources (the vault pages were written directly in the exact shape bridge sync produces), and vault.scope: "agent" deployments, which bypass the shared vault entirely and are unaffected.

Review responses

  • Registered Memory Core fallback context: the prior review read this as missing propagation. Sandbox context already reaches the filter in production: extensions/memory-core/index.ts:160 copies ctx.sandboxed into the tool options, extensions/memory-core/src/tools.ts forwards it into searchMemoryCorpusSupplements and getSupplementMemoryReadResult, and extensions/memory-core/src/tools.shared.ts hands it to every registered supplement. The gap was proof, not code, so the regression and the run above now drive the registered memory_get and memory_search tools built by the real memory-core plugin registration with sandboxed: true on the tool context, instead of calling the supplement directly.
  • Legacy agentIds bridge frontmatter: no such key exists. bridge.ts has written bridgeAgentIds since the bridge feature landed in fbbe2a1675; agentIds appears only as a TypeScript parameter name inside bridge.ts and as a field on the in-memory MemoryPluginPublicArtifact, never in page frontmatter. The real residual risk the review points at is a bridge page whose ownership list is empty, which happens when a memory capability plugin omits agentIds on its public artifacts, a case filterMemoryWikiBridgeArtifacts explicitly tolerates in global scope. That case is now fixed rather than migrated: bridge-compiled pages fail closed for sandboxed callers when ownership cannot be proven, covered by the second bridged page in the run above and by a new regression.
  • Non-sandboxed global sharing and upgrade behavior: covered by the unchanged non-sandboxed rows in the run above and by regressions asserting that a non-sandboxed main session still reads secondary's bridge page through both the direct wiki tools and the registered fallback.
  • Stored data model: nothing is persisted or reshaped by this patch. It only reads existing frontmatter, so there is no migration to confirm.

@yetval
yetval marked this pull request as ready for review July 19, 2026 15:17
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P0 Emergency: data loss, security bypass, crash loop, or unusable core runtime. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Jul 19, 2026
@clawsweeper

clawsweeper Bot commented Jul 19, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 29, 2026, 7:28 PM ET / 23:28 UTC.

ClawSweeper review

What this changes

The PR prevents sandboxed sub-agents from reading foreign or ownership-unknown bridge-compiled Memory Wiki pages through wiki_get, wiki_search, and Memory Core corpus fallback, without changing non-sandboxed global-vault reads.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

Keep this PR open for landing. Current main still has an unfiltered shared-vault wiki-corpus read path for sandboxed callers, while this branch adds one narrow ownership gate across direct wiki tools and the Memory Core fallback; no concrete correctness defect was found in the reviewed patch. GitHub currently reports the branch as cleanly mergeable but behind main, with several exact-head checks still running. Likely related people: steipete (feature introducer, medium confidence) and obviyus (recent reviewer and branch-rebase contributor, medium confidence).

Priority: P0
Reviewed head: 4f3158432bb7b4c0c5955403db72e3dbea0fb807

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A focused, well-proven security repair with no actionable patch defect found; it needs only base and required-check refresh before landing.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The PR body provides before/after output from real registered wiki and Memory Core tools against an on-disk vault, including allowed owner and non-sandboxed control cases; fixture content is synthetic and redacted.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The PR body provides before/after output from real registered wiki and Memory Core tools against an on-disk vault, including allowed owner and non-sandboxed control cases; fixture content is synthetic and redacted.
Evidence reviewed 6 items Current-main gap: The maintainer review identifies searchWikiCorpus and getMemoryWikiPage on current main as reading queryable vault pages without consulting caller ownership, while the sibling sessions-corpus path already enforces visibility.
Central patch boundary: The PR adds createWikiPageVisibilityFilter, applies it to wiki-corpus search and page lookup, and keeps the predicate permissive unless the caller is explicitly sandboxed.
Ownership metadata contract: The patch exposes bridge ownership from page frontmatter through WikiPageSummary, allowing the query boundary to distinguish bridge-compiled pages from ordinary shared wiki pages without adding configuration or stored-data migration.
Findings None None.
Security None None.

How this fits together

Memory Wiki compiles per-agent memory artifacts into a vault that direct wiki tools and Memory Core fallback tools can search and retrieve. The query layer receives caller identity and sandbox state, filters readable pages, then returns results to the requesting agent.

flowchart LR
  A[Memory bridge artifacts] --> B[Shared Memory Wiki vault]
  C[Agent identity and sandbox state] --> D[Query visibility gate]
  B --> D
  D --> E[wiki_get and wiki_search]
  D --> F[Memory Core corpus fallback]
  E --> G[Agent tool result]
  F --> G
Loading

Before merge

  • Resolve merge risk (P1) - The branch is reported cleanly mergeable but behind current main; refresh the rebase and exact-head checks before landing, especially because the open deadline-work PR also touches searchWikiCorpus.
  • Resolve merge risk (P1) - Sandboxed callers with legacy bridge pages that lack ownership metadata will lose access by design; the documented recovery is to resync with ownership-reporting artifacts, use the non-sandboxed parent, or use agent-scoped vaults.
  • Complete next step (P2) - No mechanical repair remains: complete the normal rebase and exact-head validation path, then use the existing reviewer-approved landing decision.
Agent review details

Security

None.

PR surface

Source +40, Tests +421. Total +461 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 2 43 3 +40
Tests 3 421 0 +421
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 464 3 +461

Review metrics

None.

Stored data model

Persistent data-model change detected: serialized state: extensions/memory-wiki/src/corpus-supplement.visibility.test.ts, serialized state: extensions/memory-wiki/src/query.test.ts, unknown-data-model-change: extensions/memory-wiki/src/corpus-supplement.visibility.test.ts, unknown-data-model-change: extensions/memory-wiki/src/query.test.ts, unknown-data-model-change: extensions/memory-wiki/src/query.ts, vector/embedding metadata: extensions/memory-wiki/src/corpus-supplement.visibility.test.ts, and 3 more. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #103087
Summary: This PR is the active candidate fix for the reported sandboxed cross-agent bridge-memory disclosure; the deadline work overlaps only at a query function and addresses a distinct failure mode.

Members:

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

Merge-risk options

Maintainer options:

  1. Refresh and land the scoped fix (recommended)
    Rebase onto current main, confirm the focused visibility regression and required exact-head checks, then merge the existing narrow query-layer filter.
  2. Accept legacy sandbox read access
    Retain access to ownership-unknown bridge pages for sandboxed callers, accepting that it leaves an unprovable cross-agent disclosure boundary open.

Technical review

Best possible solution:

Land a single query-layer ownership check for bridge-compiled pages after rebasing onto current main, retaining the documented global-vault behavior for non-sandboxed callers and failing closed only where sandboxed ownership cannot be proven.

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

Yes, from source and supplied real-vault proof: current main's wiki-corpus reads do not apply caller ownership, and the same synthetic bridge-page scenario is exercised through direct and registered fallback tools. This review did not independently execute the reproduction because the read-only runner could not launch local inspection commands.

Is this the best way to solve the issue?

Yes. A shared query-layer visibility predicate is the narrowest maintainable solution because it covers both direct wiki reads and Memory Core corpus fallback without duplicating caller-specific access policy.

AGENTS.md: unclear because the file could not be read completely.

Codex review notes: model internal, reasoning high; reviewed against 342826b90440.

Labels

Label justifications:

  • P0: A sandboxed sub-agent can otherwise retrieve full bridged-memory page bodies belonging to another configured agent.
  • merge-risk: 🚨 compatibility: The intentional fail-closed policy makes ownership-unknown bridge pages unreadable to existing sandboxed callers in global vaults.
  • merge-risk: 🚨 security-boundary: The patch changes the authorization boundary for bridged memory content based on sandbox status and effective agent identity.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body provides before/after output from real registered wiki and Memory Core tools against an on-disk vault, including allowed owner and non-sandboxed control cases; fixture content is synthetic and redacted.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body provides before/after output from real registered wiki and Memory Core tools against an on-disk vault, including allowed owner and non-sandboxed control cases; fixture content is synthetic and redacted.

Evidence

What I checked:

  • Current-main gap: The maintainer review identifies searchWikiCorpus and getMemoryWikiPage on current main as reading queryable vault pages without consulting caller ownership, while the sibling sessions-corpus path already enforces visibility. (extensions/memory-wiki/src/query.ts:1358, 342826b90440)
  • Central patch boundary: The PR adds createWikiPageVisibilityFilter, applies it to wiki-corpus search and page lookup, and keeps the predicate permissive unless the caller is explicitly sandboxed. (extensions/memory-wiki/src/query.ts:917, 4f3158432bb7)
  • Ownership metadata contract: The patch exposes bridge ownership from page frontmatter through WikiPageSummary, allowing the query boundary to distinguish bridge-compiled pages from ordinary shared wiki pages without adding configuration or stored-data migration. (extensions/memory-wiki/src/markdown.ts:109, 4f3158432bb7)
  • End-to-end regression coverage: The added visibility test drives direct wiki tools plus registered Memory Core fallback tools against a real on-disk vault, covering foreign-owner denial, owner access, unowned bridge-page denial for sandboxed callers, and non-sandboxed global-vault access. (extensions/memory-wiki/src/corpus-supplement.visibility.test.ts:1, 4f3158432bb7)
  • Feature provenance: The related agent-vault isolation work introduced the bridge ownership model and the vault.scope: "agent" option; this PR addresses the remaining global-vault read-side gap rather than introducing a parallel isolation mechanism. (extensions/memory-wiki/src/bridge.ts:231, 98b8c8c4ae29)
  • Maintainer decision and proof: The assigned reviewer confirmed the current-main hole, chose fail-closed behavior for ownership-unknown bridge pages, and reports a revert-based regression check plus the Memory Wiki suite on the rebased head. (4f3158432bb7)

Likely related people:

  • steipete: Authored the merged agent-vault isolation work that established bridge-page ownership metadata and the related Memory Wiki isolation model. (role: feature introducer; confidence: medium; commits: 98b8c8c4ae29; files: extensions/memory-wiki/src/bridge.ts, extensions/memory-wiki/src/query.ts)
  • obviyus: Assigned reviewer who rebased the current head and documented the intended fail-closed security boundary after reviewing the affected query paths and sibling surfaces. (role: recent reviewer and branch-rebase contributor; confidence: medium; commits: 4f3158432bb7; files: extensions/memory-wiki/src/query.ts, extensions/memory-wiki/src/corpus-supplement.visibility.test.ts)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (9 earlier review cycles; latest 8 shown)
  • reviewed 2026-07-19T17:31:10.554Z sha b610e01dfcc8ef91af8159b17170a29c16bcfd52 :: needs changes before merge. :: [P1] Thread sandbox context through the corpus supplement
  • reviewed 2026-07-19T17:47:43.493Z sha 3d3a9bacfc0ea22f7f0ce4891192099c5400b3ba :: needs maintainer review before merge. :: none
  • reviewed 2026-07-27T16:36:46.706Z sha 9b947db5d9d1c071f78befe5dbb76bb38b959fb0 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-27T16:47:32.447Z sha 9b947db5d9d1c071f78befe5dbb76bb38b959fb0 :: needs real behavior proof before merge. :: [P1] Forward sandbox context through the Memory Wiki supplement
  • reviewed 2026-07-27T18:38:03.373Z sha ec3c67b14d341d731fe1f3844856ea75ff85739b :: needs real behavior proof before merge. :: [P1] Forward sandbox context through the Memory Core fallback
  • reviewed 2026-07-27T18:47:38.175Z sha ec3c67b14d341d731fe1f3844856ea75ff85739b :: needs real behavior proof before merge. :: [P1] Forward sandbox context through the registered Memory Core fallback | [P1] Protect bridge pages written with legacy ownership metadata
  • reviewed 2026-07-27T19:53:01.068Z sha d1be22cbbf0cccccc494d466afef166c2cdbd452 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-27T23:49:12.365Z sha 8740e8166539e6d908922fe77a868a3f012ee297 :: needs maintainer review before merge. :: none

@yetval
yetval force-pushed the fix/memory-wiki-bridge-page-agent-scope branch from ebb1ef1 to f38a07d Compare July 19, 2026 17:18
@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jul 19, 2026
@yetval
yetval force-pushed the fix/memory-wiki-bridge-page-agent-scope branch from f38a07d to b610e01 Compare July 19, 2026 17:25
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. and removed rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jul 19, 2026
@yetval
yetval force-pushed the fix/memory-wiki-bridge-page-agent-scope branch from b610e01 to 3d3a9ba Compare July 19, 2026 17:42
@openclaw-barnacle openclaw-barnacle Bot added the extensions: memory-core Extension: memory-core label Jul 19, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jul 19, 2026
@yetval
yetval force-pushed the fix/memory-wiki-bridge-page-agent-scope branch from 3d3a9ba to 9b947db Compare July 27, 2026 16:31
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Jul 27, 2026
@clawsweeper clawsweeper Bot added status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jul 27, 2026
@yetval
yetval force-pushed the fix/memory-wiki-bridge-page-agent-scope branch from 9b947db to ec3c67b Compare July 27, 2026 18:32
@openclaw-barnacle openclaw-barnacle Bot removed the extensions: memory-core Extension: memory-core label Jul 27, 2026
@yetval
yetval force-pushed the fix/memory-wiki-bridge-page-agent-scope branch from ec3c67b to 770640f Compare July 27, 2026 19:44
@yetval
yetval force-pushed the fix/memory-wiki-bridge-page-agent-scope branch from 770640f to d1be22c Compare July 27, 2026 19:45
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed 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. labels Jul 27, 2026
@obviyus obviyus self-assigned this Jul 27, 2026
@obviyus
obviyus force-pushed the fix/memory-wiki-bridge-page-agent-scope branch from d1be22c to 8740e81 Compare July 27, 2026 23:44
@yetval

yetval commented Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

@obviyus Hey, Since the PR is passing checks can this be merged??

Sandboxed sub-agents could read another agent's bridge-compiled memory through the shared global vault via wiki_get, wiki_search, and the memory_get/memory_search corpus fallback. The wiki-corpus read path now filters pages through one visibility gate that fails closed for bridge-compiled pages a sandboxed caller does not own, including bridge pages that carry no ownership metadata.
@obviyus
obviyus force-pushed the fix/memory-wiki-bridge-page-agent-scope branch from 8740e81 to 4f31584 Compare July 29, 2026 23:24
@obviyus

obviyus commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Maintainer review + rebase. Head is now 4f3158432bb, rebased onto current main (was ~1100 commits behind). Thanks @yetval — the diagnosis and the fix boundary are both right.

Confirmed the hole on current main

I read the read path rather than taking the report on faith:

  • searchWikiCorpus (extensions/memory-wiki/src/query.ts:1358-1385 on main) reads every queryable page and filters only by search score. No ownership consulted.
  • getMemoryWikiPage resolves lookups over readQueryableWikiPages(...) with the same absence of an ownership check.
  • shouldEnforceSessionVisibility already exists in that same file and is applied at three sites for session visibility — but never to bridge-page ownership. That asymmetry is the bug, and it is why this reads as an oversight rather than a design decision.
  • All four entry points reach it: wiki_search, wiki_get, and the memory_search / memory_get corpus fallbacks through createWikiCorpusSupplement. The caller context (agentId, agentSessionKey, sandboxed) was already plumbed correctly, so the only missing piece was the filter itself.

Severity framing: this is config-path, not stock default — it needs memory-wiki plus bridge.enabled plus a multi-agent global vault plus sandboxed sub-agents. But once the bridge is on, it is live on the default vault.scope: "global", and what leaks is full page bodies of another agent's memory root, daily notes, dream reports, and event journals. P0 is the right label.

Product decision: fail closed on ownership-unknown

The open question was whether a sandboxed caller should be denied bridge pages whose ownership cannot be resolved. Fail closed, as written.

This is not a toss-up: it is the same rule this repo already applies to ownership questions on security boundaries — unknown ownership fails closed, proven-safe surfaces stay open. The filter here is correctly narrow about who pays for that:

  • Non-sandboxed agents, gateway, and CLI are entirely unaffected — createWikiPageVisibilityFilter returns () => true unless sandboxed === true.
  • Sandboxed callers keep every ordinary wiki page and every bridge page they own.
  • Sandboxed callers lose foreign bridge pages (the vulnerability) and ownership-unknown bridge pages (the policy call).

The second bucket is real, not hypothetical: bridge.ts:75-77 deliberately accepts legacy providers that omit agentIds, defaulting to [], so pages with unresolvable ownership exist in the wild. Accepting that a sandboxed sub-agent can no longer read those is the correct trade — we cannot prove they are safe to serve, and the alternative leaves a full-body cross-agent read open for every provider that never set agentIds.

Recovery for anyone affected, none of which needs a migration (frontmatter shape is unchanged; only read policy moved): re-sync the bridge from a provider that populates agentIds, do the reads from the non-sandboxed parent, or move to vault.scope: "agent" for path-level isolation.

Sibling surfaces

Checked, and this is not a one-sided fix: the memory-core store, memory-lancedb, and session transcript reads are already agent/session-scoped. The unfiltered wiki corpus was the only surface with this class of gap.

Validation on the rebased head

Landing once CI is green on this head.

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

Labels

extensions: memory-wiki 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. P0 Emergency: data loss, security bypass, crash loop, or unusable core runtime. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

memory-wiki vault-page reads have zero agent/session scoping, letting a sandboxed sub-agent read another agent's bridged memory content

2 participants