← Back to PRs

#9678: Cross-agent memory read allowlist

by Helmi open 2026-02-05 15:21 View on GitHub →
agents size: M
Closes #9618 ## Summary - Add per-agent memory allowlist (agents.list[].memory.allowReadFrom) for cross-agent reads. - Extend memory_search/memory_get with optional target params and clear tool descriptions. - Return explicit errors for unauthorized targets; self always allowed. - Add tests for default behavior, allowlist, denial, and all merge. ## Notes - Default behavior remains self-only unless allowlist is configured. - "*" grants access to all other agents. - memory_search results include agentId for follow-up memory_get. - memory_search preserves provider/model/fallback metadata even when querying multiple targets (uses the first successful target), for back-compat. - Largely AI-assisted (Claude). Tested locally. <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This PR adds an explicit per-agent allowlist for cross-agent memory reads (`agents.list[].memory.allowReadFrom`), and extends the `memory_search` / `memory_get` tools with optional targeting parameters (`agent`, `agents`, `all`) plus clearer tool descriptions and denial errors. `memory_search` now merges and sorts results across the allowed targets and annotates each hit with `agentId` to support follow-up `memory_get` calls. Config schema/types are updated to accept the new `memory` block under agent entries, and new tests cover default self-only behavior, allowlisted access, denial, and `all=true` merging. <h3>Confidence Score: 4/5</h3> - This PR is close to safe to merge but has a small response-shape regression to address. - Core allowlist enforcement and config plumbing look consistent, and tests exercise the main cross-agent search paths. The main concern is a concrete behavior regression in `memory_search`: multi-target queries omit provider/model/fallback metadata entirely due to a conditional assignment, which could break existing consumers that expect these fields. - src/agents/tools/memory-tool.ts <!-- greptile_other_comments_section --> <sub>(4/5) You can add custom instructions or style guidelines for the agent [here](https://app.greptile.com/review/github)!</sub> <!-- /greptile_comment -->

Most Similar PRs