Repository navigation
fix(audit): show authenticated users for Gateway runs - #122484
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
@clawsweeper review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Codex review: needs maintainer review before merge. Reviewed August 12, 2026, 4:10 AM ET / 08:10 UTC. ClawSweeper reviewWhat this changesThe branch preserves authenticated Gateway profile facts for direct agent-run audit admission while keeping ordinary session provenance limited to the live canonical profile ID. Merge readinessKeep open for a named security-owner decision: the patch is a coherent fix for current-main audit attribution, with no concrete correctness finding found. Priority: P2 Review scores
Verification
How this fits togetherGateway authentication produces trusted connection facts that feed direct agent runs and session creation. This patch carries a frozen attribution record to opt-in audit inspection while session ownership continues to read the current canonical profile. flowchart LR
A[Gateway authentication] --> B[Prepared connection facts]
B --> C[Direct agent run]
C --> D[Audit admission]
C --> E[Live session owner]
D --> F[Opt-in audit inspection]
E --> G[Session provenance]
Decision needed
Why: Repository policy requires an explicit decision before changing retained execution-identity fields, and this PR deliberately expands that sensitive audit context. Before merge
Agent review detailsSecurityNone. PR surfaceSource +183, Tests +832, Docs +24. Total +1039 across 14 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the private producer-to-admission handoff, but merge only after the security owner accepts durable-profile attribution and opt-in display-label retention for the trusted Do we have a high-confidence way to reproduce the issue? Yes—source reproducible: current main resolves an authenticated profile but discards it before direct agent-run admission, which then uses generic unknown API ingress; no reviewer-side test was run. Is this the best way to solve the issue? Yes, technically: recording facts at authenticated attach and handing them privately to the existing admission owner is cleaner than downstream inference, subject to explicit approval of the retention boundary. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b8a0fa2e7a94. LabelsLabel justifications:
EvidenceWhat 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 (3 earlier review cycles) |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review |
|
🦞👀 Command router queued. I will update this comment with the next step. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
0a34658 to
5fb1c46
Compare
* fix(audit): show authenticated users for Gateway runs * fix(audit): keep profile labels out of sessions * test(qa): verify session label retention at storage * fix(sessions): preserve canonical profile ownership * test(qa): require full identity inspection proof * docs(agents): preserve execution identity ownership boundary
What Problem This Solves
Direct authenticated Gateway runs previously reached execution-identity admission as generic unknown API ingress even though the authenticated WebSocket boundary had already resolved durable user facts. Session creation and run inspection could therefore disagree.
Why This Change Was Made
Authenticated WebSocket attach now prepares one immutable, process-local ingress record for direct run admission. Session creation continues to read the live trusted canonical profile ID so profile linking cannot orphan ownership. Durable profiles may establish attribution-only person identity; paired devices remain device assurance, and shared credentials or ordinary profileless clients remain unattributed.
Maintainer correction for I1 revision 2: ordinary, default-retained session provenance continues to store only the durable profile actor ID. It does not store the profile display label. The sanitized label remains transient and may be retained only through the existing execution-identity audit when that storage is explicitly enabled.
The existing F1C/F1P admission owner and persistence contract remain unchanged. This adds no protocol, config/default, compatibility, storage, public SDK, authority, represented-subject, account-linking, or enrollment surface.
User Impact
Operators can distinguish profiled, paired-device, trusted-proxy/Tailscale, shared-secret, and missing-profile Gateway runs in
openclaw audit. Profileless paths remain explicitly unattributed. No credential, route, connection, session, or device identifier is promoted to a person, and no new profile display label is retained by default.Evidence
src/gateway/server-methods/session-creation-provenance.test.tsfailed 2/7 because both ordinary and create-on-run session actors persistedlabel.sessions.createbehavior.8195100c46a84753fa57290790ccb47ca51fffc8.b079c6ed-0694-4c81-aec4-7719607a98c6: attribution-only with durable-profile, Tailscale, and device assurance; audit context SHA-256d4a3f669166920cd04f9d98f487efaf78a2a32b43abcf8c34757dc495faaa1e3.49f94034-41dd-4c4f-b0aa-69f4088c0642: unattributed; context SHA-2568ef1a96fa03a605616ecd86b0835b9676742949207b7f036f87ef9c2fc4bee59.createdActor.label; profileless persisted no actor.sessions.liststill projected the current profile display at read time.55c0eedd-d3a6-45f4-9a09-3d85d4f3ef5aand136542f1-8e45-4da1-a9c0-1ff862837024.cd66461acd04562769b91c875d0d735f034e5f1966002fb704ad48ff9dd60a50; scenario summary SHA-256:f91221df8ec1b80e33e7ae1d9fff3951762d50f00b13db675c6eeccd5ac548ce.8195100c46a84753fa57290790ccb47ca51fffc8: clean, TruffleHog clean, no accepted/actionable findings, correctness 0.97.--i1-onlypass mode was removed.tbx_01kztf8cxee0545nhe6jfacbkz; run https://github.com/openclaw/openclaw/actions/runs/31575729817.chat.senditem is dispositioned below as a separate owner/scope follow-up. Its CLI-label and transcript-wording observations are non-blocking presentation clarifications, not changed retention behavior.Evidence Map
agentRPC admission, session creator stampsrc/gateway/server/ws-connection/connect-session.tsauthenticated attachsrc/gateway/local-user-ingress.tsprepares the frozen connection fact onceagentrequest execution captures and transfers the connection principalprepareAgentRunAdmissionvalidates, redacts, bounds, pseudonymizes, and persists the opt-in audit contextOwner Boundary and Best-Fix Judgment
Root cause: authenticated attach resolved profile, device, locality, and auth-method facts, but discarded them before direct run admission. The best audit fix is at that producer boundary: prepare one private immutable record and carry it via lifecycle-owned weak maps to the existing admission owner. Session ownership intentionally remains separate: it follows the live canonical trusted profile ID because profile linking can change that ID after attach. Downstream sender inference, credential-specific branches, a second admission path, or a public protocol field would duplicate policy and widen the privacy surface.
No legacy/public path was retained or added. The generic unknown ingress remains only for callers without the authenticated Gateway fact.
Tagged Behavior and Sibling Analysis
invoker=present,kind=person, attribution-only; session actor persists only the durable profile ID.invoker=unknown.Privacy
Risks and Review Metrics
Named Follow-up Outside I1 Scope
chat.sendcurrently enters the shared auto-reply runner with its existing generic/channel ingress and therefore does not gain this direct-agentattribution. The immutable I1 packet explicitly owns direct run admission and forbids crossing another unplanned owner boundary. This should be evaluated as a separate auto-reply/chat admission follow-up rather than silently folded into this PR.ClawSweeper Rank-up Moves
@openclaw/openclaw-secopsremains requested. The PR remains draft.Release Note
Authenticated Gateway runs now expose durable user attribution in opt-in audit inspection without treating shared credentials or paired devices as people or newly retaining profile display labels in sessions.
AI Assistance
Codex implemented and validated this change from the I1 revision 2 maintainer coordination packet. The PR remains draft for independent owner review.