-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
sessions_send blocked by visibility guard even when a2a policy allows cross-agent messaging #57447
Copy link
Copy link
Open
BingqingLyu/openclaw
#1665Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.ClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.impact:securitySecurity boundary, credential, authz, sandbox, or sensitive-data risk.Security boundary, credential, authz, sandbox, or sensitive-data risk.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.staleMarked as stale due to inactivityMarked as stale due to inactivity
Description
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.ClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.impact:securitySecurity boundary, credential, authz, sandbox, or sensitive-data risk.Security boundary, credential, authz, sandbox, or sensitive-data risk.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.staleMarked as stale due to inactivityMarked as stale due to inactivity
Type
Fields
Priority
None yet
Problem
When
tools.sessions.visibilityis set totree(the default) andtools.agentToAgent.enabled=truewith appropriateallowpatterns,sessions_sendis still blocked for cross-agent messaging. The visibility guard increateSessionVisibilityGuardrejects all cross-agent access whenvisibility !== "all", regardless of the a2a policy.This forces operators into an all-or-nothing choice:
visibility=all→ send works, but list/history also exposes cross-agent sessions (data leak risk)visibility=tree→ data isolation preserved, but send is blocked despite a2a policy allowing itUse Case
Multi-agent deployments where:
sessionToolsVisibility=spawnedThis is the standard model for platforms hosting multiple tenant agents on a single OpenClaw instance, where a2a policy defines the trust boundary for messaging.
Root Cause
createSessionVisibilityGuard(sessions-access.ts) applies the same visibility check to all actions:Additionally,
restrictToSpawnedinsessions-send-tool.tsaddsspawnedByto label resolution, which prevents resolving cross-agent session targets entirely.Proposal
Let the a2a policy serve as the authorization gate for
sessions_send, independent of the visibility setting that governs list/history/status.Conceptually:
This could be implemented as:
sendwhen a2a policy explicitly allows the target agent, ortree+a2a-sendthat preserves tree isolation for read operations but allows a2a-gated sends, ortools.sessions.sendVisibilitythat defaults toa2awhile keeping the existing visibility for other actionsOption 1 is the simplest and aligns with the existing a2a policy design — the policy already validates requester→target agent pairs, so it provides equivalent or stronger authorization than visibility alone.
Security Analysis
With option 1 (a2a policy gates send):
No new attack surface is introduced — send already requires a2a policy approval, which is a stricter check than visibility=all (which allows everything).
Related
Environment