Skip to content

feat(sessions): enable cross-agent session access by default - #136755

Merged
steipete merged 11 commits into
mainfrom
steipete/xenodochial-morse-c0cd6b
Sep 3, 2026
Merged

steipete merged 11 commits into
mainfrom
steipete/xenodochial-morse-c0cd6b

Conversation

@steipete

@steipete steipete commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Resolves a problem where a multi-agent Gateway could not message or read across agents out of the box. tools.agentToAgent.enabled defaulted to false and tools.sessions.visibility defaulted to agent, so a default configuration's sessions_send to another agent (and cross-agent sessions_list, sessions_history, sessions_search, session_status) ended in a policy denial until operators set two config keys. The docs also never stated that an omitted or empty tools.agentToAgent.allow permits every agent pair, and the schema help described a nonexistent agent_to_agent tool.

Why This Change Was Made

Maintainer decision: one Gateway is one trust boundary, so cross-agent session access is on by default. Both defaults move together because the session decision checker denies cross-agent targets on visibility before it consults the agent-to-agent policy; flipping enabled alone would have been a dark default. The narrowing controls are unchanged and now documented as the way to separate personas with different trust levels: tools.sessions.visibility (agent | tree | self), tools.agentToAgent.allow (requester and target must both match; omitted or empty means every pair; blank-only entries deny), or tools.agentToAgent.enabled: false. The sandbox spawned-only clamp, incognito hiding, and explicit disable are untouched. The narrowed-visibility denial copy no longer tells operators to enable a policy that is already on.

openclaw security audit gains security.trust_model.cross_agent_session_access_default: emitted when two or more agents run on the default Gateway-wide visibility with agent-to-agent enabled and no allow list, info for plain multi-persona setups and warn when an agent is sandboxed, has agent-level tool restrictions, or multi-user ingress signals are present. No new config keys, no schema change, no migration.

User Impact

  • Operators get working agent-to-agent messaging and cross-agent session reads on a fresh install and, on upgrade, on existing configs that never set these two keys. That is a widening default: agents on one Gateway can now see and message each other's sessions, including other users' transcripts, unless narrowed.
  • Personas with different trust levels on one Gateway should set tools.sessions.visibility, tools.agentToAgent.allow, or tools.agentToAgent.enabled: false; the security overview, hardened baseline, config reference, and the new audit finding all point there.
  • The tools.agentToAgent.allow semantics are now documented precisely, including that deleting an agent prunes its id from the list and an emptied list falls back to allow-all.

Config surface: 2 defaults changed (both widened: tools.sessions.visibility agent → all, tools.agentToAgent.enabled false → true); 0 keys added or removed; 1 new audit check id; no doctor migration needed because only defaults moved.

Release-note context: feat, user-facing default change for multi-agent sessions and a new security audit finding; maintainer-directed (@steipete).

Evidence

  • Default-path regressions fail on the pre-change code (policy default, resolver default, real-Gateway sessions_send with no tools key, cross-agent list/history/status with no tools key) and pass now. Narrowed-mode tests state their config explicitly instead of relying on the old defaults.
  • Focused suites, all green after the change: src/plugin-sdk/session-visibility, src/agents/tools/sessions-access|sessions|sessions-list-tool|sessions-tool|sessions-search-tool, src/agents/openclaw-tools.sessions-visibility|sessions|session-status|session-context, src/agents/tool-description-presets, src/agents/agent-tools.deferred-followup-guidance, src/config/schema.help.quality, src/gateway/server.sessions-send, src/gateway/session-companion, src/commands/agents, src/claws/lifecycle-state, extensions/memory-core/src/session-search-visibility*, extensions/qa-lab/src/scenario-catalog, and the four security audit suites (37 tests, 21 new).
  • pnpm check:changed: 57 lanes green on the full tree (typecheck core/core tests/extensions/extension tests, lint core/extensions/scripts, prompt-snapshot drift, import cycles, guards); run with an isolated OPENCLAW_STATE_DIR because the developer host's live state DB is a newer schema than this checkout.
  • pnpm prompt:snapshots:check: 7 fixtures current; the regenerated fixtures differ only in the visibility hedge line plus derived character/token counts and hashes.
  • pnpm docs:check-config-examples: 1215 fences validated.
  • Live CLI: openclaw security audit against an isolated two-agent config (one sandboxed) renders the new finding at warn in both human and --json output with the sandbox signal named.
  • Autoreview: see PR comment.

Security-owner acceptance

Directed and accepted by @steipete (maintainer of @openclaw/openclaw-secops, the listed owner of src/security/ and docs/gateway/security/; organization admin) on 2026-09-02 in the maintainer session that produced this PR. Accepted upgrade impact: existing configurations that omit both tools.sessions.visibility and tools.agentToAgent.enabled move from same-agent to Gateway-wide session access, including other agents' and users' transcripts, on upgrade. Accepted mitigations: the documented narrowing controls (tools.sessions.visibility agent/tree/self, tools.agentToAgent.allow, tools.agentToAgent.enabled: false), the updated hardened baseline and security overview, and the new security.trust_model.cross_agent_session_access_default audit finding.

@clawsweeper

clawsweeper Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime security Security documentation docker Docker and sandbox tooling agents Agent runtime and tooling extensions: clickclack labels Sep 2, 2026
@steipete
steipete marked this pull request as ready for review September 2, 2026 23:59
@steipete
steipete requested a review from a team as a code owner September 2, 2026 23:59
@openclaw-barnacle openclaw-barnacle Bot added the maintainer Maintainer-authored PR label Sep 2, 2026
@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: 🦐 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 Sep 3, 2026
@clawsweeper

clawsweeper Bot commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 3, 2026, 1:36 AM ET / 05:36 UTC.

ClawSweeper review

What this changes

This PR changes unconfigured multi-agent gateways to allow cross-agent session reads and sends by default, with audit, documentation, and Gateway QA coverage.

Merge readiness

⛔ Blocked before merge - 6 items remain

The PR remains necessary: current main still defaults to same-agent/default-off access. The implementation uses the canonical session-access guard and has boundary-level QA coverage; the remaining blocker is explicit listed-security-owner acceptance of the intentional upgrade widening.

Priority: P2
Reviewed head: f38b29cb3e3cd0a81c4842668cf44eab9f2b4c9b
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The policy and enforcement are coherent with strong committed boundary coverage, with merge readiness gated on the deliberate security-default decision.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: This maintainer-authored PR includes committed ephemeral-Gateway QA scenarios for the changed allow and denial paths; no contributor proof action is required by this review.
Patch quality 🐚 platinum hermit (4/6) Security review found an item that needs attention.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored PR includes committed ephemeral-Gateway QA scenarios for the changed allow and denial paths; no contributor proof action is required by this review.
Evidence reviewed 8 items Current main still has the old defaults: Fetched main resolves omitted or invalid session visibility to "agent" and enables cross-agent access only when explicitly true, so the requested behavior is not already implemented.
Canonical default policy change: The PR resolves omitted visibility to "all" and treats agent-to-agent access as enabled unless explicitly disabled; omitted or empty allow lists permit every pair while blank entries deny.
Access is checked before session effects: Cross-agent targets pass the configured visibility and agent-pair policy before being allowed; disabled or disallowed pairs return a denial.
Findings None None.
Security Needs attention Widened default session authority: An omitted agent-to-agent policy now permits cross-agent session access when visibility is omitted, changing the authorization reach of existing multi-agent configurations.

How this fits together

Gateway session tools use configuration to decide which agent sessions can be read, searched, inspected, or messaged. The policy is enforced before target-session work begins and is surfaced through the security audit for operators who need narrower trust boundaries.

flowchart LR
  A[Gateway configuration] --> B[Session visibility resolver]
  B --> C[Agent-pair policy]
  C --> D[Session access guard]
  D --> E[Session read and send tools]
  B --> F[Security audit]
  F --> G[Operator remediation guidance]
Loading

Decision needed

Question Recommendation
Do the listed security owners approve changing omitted session-policy keys from same-agent/default-off behavior to Gateway-wide cross-agent transcript and message access? Approve the documented widening: Accept the one-trust-boundary Gateway default with the added audit warning and narrowing controls.

Why: This is an intentional authorization-default and upgrade-policy choice, not a mechanical correctness question.

Before merge

  • Resolve security concern: Widened default session authority - An omitted agent-to-agent policy now permits cross-agent session access when visibility is omitted, changing the authorization reach of existing multi-agent configurations.
  • Resolve merge risk (P1) - Existing multi-agent deployments that omit both settings will change from same-agent/default-off behavior to Gateway-wide cross-agent transcript and message access; that intentional upgrade boundary needs security-owner acceptance.
  • Complete next step (P2) - Obtain a visible review from the listed security owners approving the documented omitted-key upgrade widening before merge.
  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.
  • Review config compatibility - Confirm compatibility and upgrade impact for the changed config or default surface before merge.
  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.

Findings

  • [medium] Widened default session authority — src/plugin-sdk/session-visibility.ts:202
Agent review details

Security

Needs attention: The patch intentionally widens a session-access authorization default; no separate implementation bypass was found, but listed security-owner acceptance is required.

PR surface

Source +98, Tests +376, Docs +35, Other +377. Total +886 across 44 files.

View PR surface stats
Area Files Added Removed Net
Source 9 115 17 +98
Tests 16 448 72 +376
Docs 16 225 190 +35
Config 0 0 0 0
Generated 0 0 0 0
Other 3 377 0 +377
Total 44 1165 279 +886

Review metrics

Metric Value Why it matters
Policy defaults 2 changed, 0 added, 0 removed Omitted session visibility changes from agent to all, and omitted agent-to-agent enablement changes from false to true.
Production vs test LOC production +98, docs +35, tests/QA +753, fixtures net 0 The production growth implements the audit and canonical policy reporting; the larger test/QA change exercises default dispatch and denial boundaries.

Stored data model

Persistent data-model change detected: unknown-data-model-change: src/config/schema.help.runtime.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Record security-owner approval (recommended)
    Obtain a visible review from the listed security owners accepting the omitted-key upgrade behavior before merge.
  2. Pause for a narrower default
    Keep the PR open if maintainers do not want existing unconfigured multi-agent gateways widened automatically.

Technical review

Best possible solution:

Land only after the listed security owners explicitly accept the documented default-widening upgrade contract and its audit/remediation path.

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

Not applicable: this is a deliberate default-policy feature change rather than a reported broken behavior.

Is this the best way to solve the issue?

Yes technically: one canonical guard governs all session operations and the committed Gateway scenarios cover both allowed dispatch and denied no-dispatch outcomes; shipping the broader default remains a security-owner decision.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 401ad5b14b48.

Labels

Label justifications:

  • P2: This is a deliberate, bounded default-policy change requiring normal maintainer review.
  • merge-risk: 🚨 compatibility: Existing configurations that omit the two policy keys receive broader behavior after upgrade.
  • merge-risk: 🚨 security-boundary: The PR intentionally broadens which agents can reach another agent's session data and messaging path.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored PR includes committed ephemeral-Gateway QA scenarios for the changed allow and denial paths; no contributor proof action is required by this review.

Evidence

Security concerns:

  • [medium] Widened default session authority — src/plugin-sdk/session-visibility.ts:202
    An omitted agent-to-agent policy now permits cross-agent session access when visibility is omitted, changing the authorization reach of existing multi-agent configurations.
    Confidence: 0.98

What I checked:

Likely related people:

  • openclaw/openclaw-secops: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Dallin Romney: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

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

  • Record listed-security-owner approval of the documented upgrade behavior.

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 (12 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-03T01:30:07.500Z sha 626d71b :: needs real behavior proof before merge. :: [P2] Describe cross-agent reachability accurately | [P2] Do not say disabling A2A fully isolates agents
  • reviewed 2026-09-03T02:48:14.558Z sha 3eabcf5 :: blocked before merge. :: [P2] Do not promise full isolation when disabling agent-to-agent access
  • reviewed 2026-09-03T03:13:50.202Z sha eb85ccefe7b7a9b34db53cb796c4153db4c05103 :: needs real behavior proof before merge. :: [P2] Do not say disabling A2A isolates agents
  • reviewed 2026-09-03T04:00:19.349Z sha 57a89be :: blocked before merge. :: [P2] Do not describe disabling A2A as agent isolation
  • reviewed 2026-09-03T04:09:59.301Z sha 57a89be :: blocked before merge. :: [P2] Do not promise isolation from disabled agent-to-agent access
  • reviewed 2026-09-03T04:49:07.314Z sha 4052e2e :: blocked before merge. :: none
  • reviewed 2026-09-03T05:03:24.188Z sha 4052e2e :: blocked before merge. :: [P2] Do not present tree visibility as strict separation
  • reviewed 2026-09-03T05:22:48.917Z sha f38b29c :: blocked before merge. :: none

steipete added a commit that referenced this pull request Sep 3, 2026
The audit finding now names which agents can reach other agents
(unsandboxed sessions, or any session when
agents.defaults.sandbox.sessionToolsVisibility is "all"), emits nothing
when every agent is fully sandboxed under the default clamp, and says
sandboxed transcripts stay readable by unsandboxed callers.

Docs qualify the agent-to-agent reference with the requester-owned
native/ACP child exception and correct the security overview's sandbox
wording. Addresses both ClawSweeper rank-up moves on #136755.
@steipete

steipete commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

@clawsweeper

clawsweeper Bot commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

steipete added a commit that referenced this pull request Sep 3, 2026
State in the CLI reference and high-level security audit summary that
fully sandboxed rosters under the default spawn-tree clamp produce no
cross-agent access finding. Disabling that clamp removes the exemption.

Addresses the mechanical ClawSweeper rank-up on #136755 at 3208e19.
@steipete

steipete commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

Landing preparation for the default cross-agent session access change.

Branch commits:

  • b7ce911 — enable cross-agent session access by default.
  • 56da0b5 — audit default cross-agent session access.
  • 018f3cb — drain detached agent-to-agent work between gateway test rows.
  • 1d10bdd — export the new collector from the explicit audit facade mock.
  • 3208e19 — apply both ClawSweeper rank-up moves.
  • 626d71b — document the fully sandboxed audit exemption in the CLI and high-level audit summary.

Green exact-head CI: https://github.com/openclaw/openclaw/actions/runs/33703198765 for 626d71b. The preceding code head 3208e19 also passed: https://github.com/openclaw/openclaw/actions/runs/33702374040.

The lead's local proof is already recorded in the PR body: default-path regressions fail before the change and pass afterward; focused session-policy/tool, gateway, config, memory-search, QA-catalog, and security-audit suites pass; isolated pnpm check:changed passes all 57 lanes; pnpm prompt:snapshots:check confirms 7 current fixtures; pnpm docs:check-config-examples validates 1215 fences; and an isolated live openclaw security audit renders the new finding at warn in both human and --json output. After the rank-up edits, the lead reran the audit suites (including 25 cross-agent audit cases) and isolated pnpm check:changed, all passing. This landing pass also verified git diff --check.

Autoreview: scoped-clean, no accepted findings, run on the pre-commit tree; later changes are the two test-only CI fixes (gateway drain, facade mock export) and the ClawSweeper rank-up commit above.

Earlier CI failure https://github.com/openclaw/openclaw/actions/runs/33697516932 came from detached sessions_send announce/ping-pong work outliving the tool request and polluting the second agentId test row. Commit 018f3cb drains gateway active work per row before releasing test state.

Earlier CI failure https://github.com/openclaw/openclaw/actions/runs/33699015755 came from an explicit vi.mock factory for audit.nondeep.runtime lacking the newly registered collectCrossAgentSessionAccessFindings export. Commit 1d10bdd adds that export to the mock.

Rank-up moves: both applied in 3208e19.

The audit and security overview now distinguish unsandboxed reach from the default sandbox spawn-tree clamp, suppress the finding when every agent is fully sandboxed under that clamp, and explain that sandboxing a target does not hide its transcripts from unsandboxed callers. The agent-to-agent configuration reference now names the requester-owned native/ACP child exception. The widening defaults remain the explicit maintainer decision recorded in the PR body; no config keys, SQLite schema, stored representation, or migration were added or changed.

The additional mechanical rank-up from the review of 3208e19 is applied in 626d71b: the CLI and high-level audit summary now state the fully sandboxed exemption. This later docs-only commit passes git diff --check and the formatter check; it changes no runtime or tests.

The requested re-review is still queued or pending publication. The latest completed review covers the code head; its remaining mechanical documentation move is applied above, and the final head is green. No rank-up moves were skipped.

steipete added a commit that referenced this pull request Sep 3, 2026
… audit

The finding now lists which agents can reach other agents (unclamped sessions that still have a session tool allowed) with their calling context and allowed tools, lists non-reaching agents with the reason, and emits nothing when nobody reaches; help text no longer claims enabled=false isolates agents because requester-owned native/ACP child sessions stay reachable under tree or all visibility; gateway final-effect proof that a disabled policy or restrictive allow list never dispatches to the target. Addresses the ClawSweeper re-review on #136755.
@steipete steipete closed this Sep 3, 2026
@steipete steipete reopened this Sep 3, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Sep 3, 2026
@steipete

steipete commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@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. and removed 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. labels Sep 3, 2026
Strict separation is agent or self; tree still admits requester-owned native subagent and ACP child sessions across agents. Addresses a ClawSweeper rank-up move on #136755.
@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 Sep 3, 2026
@steipete

steipete commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@steipete

steipete commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

Current head: f38b29cb3e3; exact-head CI run 33718093890 completed successfully.
Rank-up moves from the 3/6 review: strict-separation wording corrected in f38b29c; security-owner acceptance recorded in the PR body.

Re-review fixes:

Isolation claims: all seven introduced sentences corrected in ff46d00; enabled: false blocks ordinary cross-agent access while requester-owned native subagent and ACP child sessions stay reachable under tree or all visibility (owner: the decision checker in src/plugin-sdk/session-visibility-internal.ts); strict separation is tools.sessions.visibility or separate gateways.

Gateway final-effect evidence (qa-lab, ephemeral Gateway + mock-openai, two agents)

Exact suite command:

pnpm dev qa suite --provider-mode mock-openai --scenario a2a-default-cross-agent-send --scenario a2a-disabled-cross-agent-send --scenario a2a-allowlist-denied-cross-agent-send --scenario a2a-message-tool-mirror-dedupe --output-dir .artifacts/qa-e2e/a2a-defaults-proof-3

The suite completed with 4 passed, 0 failed, 0 skipped. This is an ephemeral QA Gateway with a mock provider, not an authenticated live-provider run. The default scenario observed the target agent's own model run and a matching sessions.list entry. Both policy denials returned before target work, emitted the user-visible warning, observed zero target model requests through an 8-second quiet window, and left no target session.

The three scenario statuses and exact step details strings from the summary follow; they contain no absolute paths, temporary roots, ports, or hostnames.

a2a-default-cross-agent-send

Status: pass

{"sourceTool":{"sessionKey":"agent:orion:main","message":"qa group visible reply tool check. Use the visible room reply path. exact marker: `QA-A2A-DEFAULT-OK`","timeoutSeconds":0},"toolOutput":"{\n  \"runId\": \"987eaca6-72eb-44b5-819a-a556e591cc1b\",\n  \"status\": \"accepted\",\n  \"sessionKey\": \"agent:orion:main\",\n  \"targetDisposition\": \"queued\",\n  \"delivery\": {\n    \"status\": \"pending\",\n    \"mode\": \"announce\"\n  }\n}","toolResultCorrelated":true,"targetRunPresent":true,"targetRunCursor":4,"targetPromptPresent":true,"sessionsListMatch":"agent:orion:main"}

a2a-disabled-cross-agent-send

Status: pass

{"sourceTool":{"sessionKey":"agent:orion:main","message":"qa group visible reply tool check. Use the visible room reply path. exact marker: `QA-A2A-DISABLED`","timeoutSeconds":0},"toolOutput":"{\n  \"runId\": \"1ca12be6-bbe4-463c-80ba-23fa225b0192\",\n  \"status\": \"forbidden\",\n  \"error\": \"Agent-to-agent messaging is disabled. Set tools.agentToAgent.enabled=true to allow cross-agent sends.\",\n  \"sessionKey\": \"agent:orion:main\"\n}","userVisibleWarning":"⚠️ Session Send failed","toolResultCorrelated":true,"quietWindowMs":8000,"targetRunPresent":false,"targetRequestCount":0,"sessionsListMatch":false,"targetSessionCount":0}

a2a-allowlist-denied-cross-agent-send

Status: pass

{"sourceTool":{"sessionKey":"agent:orion:main","message":"qa group visible reply tool check. Use the visible room reply path. exact marker: `QA-A2A-ALLOWLIST-DENIED`","timeoutSeconds":0},"toolOutput":"{\n  \"runId\": \"c19ab1af-c361-467b-937b-c1212cec8da4\",\n  \"status\": \"forbidden\",\n  \"error\": \"Agent-to-agent messaging denied by tools.agentToAgent.allow.\",\n  \"sessionKey\": \"agent:orion:main\"\n}","userVisibleWarning":"⚠️ Session Send failed","toolResultCorrelated":true,"quietWindowMs":8000,"targetRunPresent":false,"targetRequestCount":0,"sessionsListMatch":false,"targetSessionCount":0}

a2a-message-tool-mirror-dedupe

Status: pass. In this run, the unchanged scenario passed on its automatic retry after the first attempt observed the marker twice under host load (expected exactly one requester-visible A2A marker after duplicate window, saw 2). Its config is explicit and unchanged by this PR; it passed on the first attempt in the two earlier lane runs.

Gateway integration rows (secondary): all four sessions_send agent targeting rows passed in the Vitest gateway suite: default cross-agent access, explicit cross-agent access, disabled agent-to-agent access, and restrictive allow list.

Autoreview: scoped-clean, no accepted findings, run on the complete candidate at 57a89be; the later commits are test, docs, and qa-lab scenario changes only.

Config compatibility: two defaults widened (tools.sessions.visibility agent→all, tools.agentToAgent.enabled false→true), no keys added or removed, no schema or migration change; the flagged 'data-model change' in src/config/schema.help.runtime.ts is help-text only.

@steipete

steipete commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

Security-owner confirmation for the maintainer decision flagged by ClawSweeper.

Listed owner of src/security/ and docs/gateway/security/ per CODEOWNERS: @openclaw/openclaw-secops.

  • orgs/openclaw/teams/openclaw-secops/memberships/steipete: state=active role=maintainer
  • orgs/openclaw/memberships/steipete: state=active role=admin

Confirmed by @steipete on 2026-09-02 in the maintainer session that produced this PR: the omitted-key upgrade behavior is intended. Existing configurations that omit both tools.sessions.visibility and tools.agentToAgent.enabled move from same-agent to Gateway-wide session access on upgrade, including other agents' and users' transcripts, because one Gateway is one trust boundary. Operators who run personas with different trust levels narrow with tools.sessions.visibility (agent or self), tools.agentToAgent.allow, or tools.agentToAgent.enabled: false; the security overview, hardened baseline, config reference, and the new security.trust_model.cross_agent_session_access_default audit finding all point there. No new config keys, no schema or migration change.

@steipete
steipete merged commit 2fffd4e into main Sep 3, 2026
226 checks passed
@steipete
steipete deleted the steipete/xenodochial-morse-c0cd6b branch September 3, 2026 05:39
@steipete

steipete commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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

* feat(sessions): enable cross-agent session access by default

`tools.sessions.visibility` now defaults to `all` and
`tools.agentToAgent.enabled` to `true`; both widen access.
Narrow access via `tools.sessions.visibility` (agent|tree|self),
`tools.agentToAgent.allow`, or `enabled: false`.

Document that an omitted/empty allow list permits every agent pair.
Denial copy for narrowed visibility no longer instructs enabling the
already-on policy. Regenerate prompt-snapshot fixtures for the visibility
hedge. Maintainer-directed.

* feat(security): audit default cross-agent session access

Add `security.trust_model.cross_agent_session_access_default`: `info`
for plain multi-agent defaults, `warn` with sandbox/tool-restriction/
multi-user ingress signals. No new config keys.

* test(gateway): drain detached a2a flow between agentId send rows

The announce/ping-pong flow outlives the sessions_send tool request; the second agentId row picked up the first row's follow-up agent call for agent:orion:main, so each row now waits for gateway active work to drain before releasing its test state.

* test(security): mock the cross-agent access collector in the non-deep facade

The readonly-setup-fallback test mocks audit.nondeep.runtime with an explicit factory; it now exports collectCrossAgentSessionAccessFindings so the registered collector resolves under the mock (CI run 33699015755, checks-node-compact-large-21).

* fix(security): scope the cross-agent audit to unsandboxed sessions

The audit finding now names which agents can reach other agents
(unsandboxed sessions, or any session when
agents.defaults.sandbox.sessionToolsVisibility is "all"), emits nothing
when every agent is fully sandboxed under the default clamp, and says
sandboxed transcripts stay readable by unsandboxed callers.

Docs qualify the agent-to-agent reference with the requester-owned
native/ACP child exception and correct the security overview's sandbox
wording. Addresses both ClawSweeper rank-up moves on openclaw#136755.

* docs(security): qualify the fully sandboxed audit exemption

State in the CLI reference and high-level security audit summary that
fully sandboxed rosters under the default spawn-tree clamp produce no
cross-agent access finding. Disabling that clamp removes the exemption.

Addresses the mechanical ClawSweeper rank-up on openclaw#136755 at 3208e19.

* fix(security): report per-agent session tool reach in the cross-agent audit

The finding now lists which agents can reach other agents (unclamped sessions that still have a session tool allowed) with their calling context and allowed tools, lists non-reaching agents with the reason, and emits nothing when nobody reaches; help text no longer claims enabled=false isolates agents because requester-owned native/ACP child sessions stay reachable under tree or all visibility; gateway final-effect proof that a disabled policy or restrictive allow list never dispatches to the target. Addresses the ClawSweeper re-review on openclaw#136755.

* test(gateway): drain detached a2a flow in an afterEach hook

The in-row drain shared the row's 10s budget and could time out under load, leaking the next row's mock calls; the hook has its own bounded timeout.

* docs: stop describing disabled agent-to-agent access as isolation

enabled: false blocks ordinary cross-agent access, but requester-owned native subagent and ACP child sessions stay reachable under tree or all visibility; every introduced claim now says so and points strict separation to tools.sessions.visibility or separate gateways. Addresses the ClawSweeper P2 on openclaw#136755.

* test(qa-lab): prove default cross-agent send and policy denials end to end

Three mock-openai flow scenarios run a two-agent QA Gateway: default config dispatches sessions_send to agent:orion:main (accepted, target run observed, target main session created); enabled=false and a restrictive allow list return forbidden before any target work. Addresses the ClawSweeper P1 merge risk on openclaw#136755.

* fix(config): stop listing tree visibility as strict separation

Strict separation is agent or self; tree still admits requester-owned native subagent and ACP child sessions across agents. Addresses a ClawSweeper rank-up move on openclaw#136755.
steipete added a commit that referenced this pull request Sep 5, 2026
…inistic

The `sessions_send agent targeting` rows mocked every target turn with the same
reply, so the detached announce tail ran the full five-turn ping-pong after each
row and overran the row budget under host load. Only the first target turn now
returns the awaited reply; later mocked turns answer REPLY_SKIP, which the
announce flow already treats as "stop", so the tail ends after one step.

The a2a-message-tool-mirror-dedupe qa-lab scenario retried a duplicate marker
away on a loaded host. It now runs with retryCount 0 so a duplicate fails the
run, and the assertion message carries a duplicateAttribution snapshot (outbound
ids, timing, reply linkage, projected history rows with mirror flags, mock
requests) so the next occurrence is attributable instead of retried.

Follow-up to #136755. No production code changes.
steipete added a commit that referenced this pull request Sep 5, 2026
…37731)

* test(sessions): make cross-agent send rows and mirror scenario deterministic

The `sessions_send agent targeting` rows mocked every target turn with the same
reply, so the detached announce tail ran the full five-turn ping-pong after each
row and overran the row budget under host load. Only the first target turn now
returns the awaited reply; later mocked turns answer REPLY_SKIP, which the
announce flow already treats as "stop", so the tail ends after one step.

The a2a-message-tool-mirror-dedupe qa-lab scenario retried a duplicate marker
away on a loaded host. It now runs with retryCount 0 so a duplicate fails the
run, and the assertion message carries a duplicateAttribution snapshot (outbound
ids, timing, reply linkage, projected history rows with mirror flags, mock
requests) so the next occurrence is attributable instead of retried.

Follow-up to #136755. No production code changes.

* test(gateway): end the detached A2A tail in cross-agent send rows

Answer the detached reply and announce steps with the file's existing
REPLY_SKIP/ANNOUNCE_SKIP idiom so each agent-targeting row settles after
the single turn it asserts on. Drops the QA scenario changes superseded
by #137923.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 6, 2026
…enclaw#137731)

* test(sessions): make cross-agent send rows and mirror scenario deterministic

The `sessions_send agent targeting` rows mocked every target turn with the same
reply, so the detached announce tail ran the full five-turn ping-pong after each
row and overran the row budget under host load. Only the first target turn now
returns the awaited reply; later mocked turns answer REPLY_SKIP, which the
announce flow already treats as "stop", so the tail ends after one step.

The a2a-message-tool-mirror-dedupe qa-lab scenario retried a duplicate marker
away on a loaded host. It now runs with retryCount 0 so a duplicate fails the
run, and the assertion message carries a duplicateAttribution snapshot (outbound
ids, timing, reply linkage, projected history rows with mirror flags, mock
requests) so the next occurrence is attributable instead of retried.

Follow-up to openclaw#136755. No production code changes.

* test(gateway): end the detached A2A tail in cross-agent send rows

Answer the detached reply and announce steps with the file's existing
REPLY_SKIP/ANNOUNCE_SKIP idiom so each agent-targeting row settles after
the single turn it asserts on. Drops the QA scenario changes superseded
by openclaw#137923.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docker Docker and sandbox tooling docs Improvements or additions to documentation extensions: clickclack extensions: qa-lab gateway Gateway runtime maintainer Maintainer-authored PR 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: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. security Security documentation size: XL 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.

1 participant