Repository navigation
feat(sessions): enable cross-agent session access by default - #136755
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: blocked before merge. Reviewed September 3, 2026, 1:36 AM ET / 05:36 UTC. ClawSweeper reviewWhat this changesThis 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 Review scores
Verification
How this fits togetherGateway 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]
Decision needed
Why: This is an intentional authorization-default and upgrade-policy choice, not a mechanical correctness question. Before merge
Findings
Agent review detailsSecurityNeeds attention: The patch intentionally widens a session-access authorization default; no separate implementation bypass was found, but listed security-owner acceptance is required. PR surfaceSource +98, Tests +376, Docs +35, Other +377. Total +886 across 44 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest 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. LabelsLabel justifications:
EvidenceSecurity concerns:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (12 earlier review cycles; latest 8 shown)
|
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.
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
🦞👀 Re-review progress:
|
|
Landing preparation for the default cross-agent session access change. Branch commits:
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 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 Earlier CI failure https://github.com/openclaw/openclaw/actions/runs/33699015755 came from an explicit 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 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. |
… 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.
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
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 re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Current head: f38b29cb3e3; exact-head CI run 33718093890 completed successfully. Re-review fixes:
Isolation claims: all seven introduced sentences corrected in ff46d00; 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-3The 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 The three scenario statuses and exact step a2a-default-cross-agent-sendStatus: a2a-disabled-cross-agent-sendStatus: a2a-allowlist-denied-cross-agent-sendStatus: a2a-message-tool-mirror-dedupeStatus: Gateway integration rows (secondary): all four 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. |
|
Security-owner confirmation for the maintainer decision flagged by ClawSweeper. Listed owner of src/security/ and docs/gateway/security/ per CODEOWNERS: @openclaw/openclaw-secops.
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. |
|
Merged via squash.
|
…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.
…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.
…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.
…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.
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.enableddefaulted tofalseandtools.sessions.visibilitydefaulted toagent, so a default configuration'ssessions_sendto another agent (and cross-agentsessions_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 emptytools.agentToAgent.allowpermits every agent pair, and the schema help described a nonexistentagent_to_agenttool.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
enabledalone 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), ortools.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 auditgainssecurity.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,infofor plain multi-persona setups andwarnwhen 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
tools.sessions.visibility,tools.agentToAgent.allow, ortools.agentToAgent.enabled: false; the security overview, hardened baseline, config reference, and the new audit finding all point there.tools.agentToAgent.allowsemantics 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.visibilityagent→all,tools.agentToAgent.enabledfalse→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
sessions_sendwith notoolskey, cross-agent list/history/status with notoolskey) and pass now. Narrowed-mode tests state their config explicitly instead of relying on the old defaults.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 isolatedOPENCLAW_STATE_DIRbecause 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.openclaw security auditagainst an isolated two-agent config (one sandboxed) renders the new finding atwarnin both human and--jsonoutput with the sandbox signal named.Security-owner acceptance
Directed and accepted by @steipete (maintainer of @openclaw/openclaw-secops, the listed owner of
src/security/anddocs/gateway/security/; organization admin) on 2026-09-02 in the maintainer session that produced this PR. Accepted upgrade impact: existing configurations that omit bothtools.sessions.visibilityandtools.agentToAgent.enabledmove from same-agent to Gateway-wide session access, including other agents' and users' transcripts, on upgrade. Accepted mitigations: the documented narrowing controls (tools.sessions.visibilityagent/tree/self,tools.agentToAgent.allow,tools.agentToAgent.enabled: false), the updated hardened baseline and security overview, and the newsecurity.trust_model.cross_agent_session_access_defaultaudit finding.