Skip to content

OAuth slice 6: audit provenance — record which application acted, alongside the human #800

Description

@mforce

Slice 6 of #788. Depends on #795. It can land in parallel with the screen slices.

Make the audit log show when an assistant took an action, rather than a person typing it.

The shape

ActorUserId and ActorEmail stay the human. That is a requirement, not a style choice. AGENTS.md #500 states that ICurrentUser is "an authorization input, not a label", and FlockScopeGuard reads its roles. The person authorized the action and remains the actor.

What this adds is provenance, the application that acted.

Why first-class columns rather than DetailsJson

AuditEvent already has a DetailsJson column, and using it would be cheaper. It was rejected because:

  • Provenance is not a detail. It is who acted, which belongs beside the actor fields.
  • It must be filterable. "Show me everything assistants did last month" is the question this exists to answer, and a JSON blob is not indexable for it.

The slice therefore adds two new columns on AuditEvents (application id and display name), a migration, and regenerated docs/schema/ in the same PR (#417).

Care needed

AuditEvents is the table this repo is most careful about. #508 gave it a monotonic Sequence ordering key, and #505 deliberately decided not to time-partition it. Read both before altering it. Adding columns is compatible with each, but the change must not disturb the ordering guarantees.

Surfacing

The existing audit UI should show the application. Today a row shows only the person's name even when an assistant acted, so an Owner reviewing history cannot tell a human typo from an assistant misfiring. This slice closes that gap.

Related

#272 (GDPR). This new dimension inherits the existing ActorEmail tension between erasure and pseudonymisation, because AuditEvent stores immutable snapshots and offers no way to change them.

Done when

An action performed through an assistant records both the human and the application, the audit UI shows it, and a user can filter on it.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:apiAPI/endpoint layerarea:frontendReact/Vite web clientepic-788OAuth 2.1 authorization server for MCP (#788)priority:tier3Real product weight, real costsize:MA day or two; migration or a multi-state UIsliceThin vertical work item

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions