Patterns / Audit log

Audit log UI for AI agents

When agents act in an account, someone will ask who did what. AuditLog shows the account's events. Rows hold ids and codes; names come from a resolve function you pass. An id it can't resolve, like a removed member, shows as the id, never a guess.

Refusals are rows too, with their reason code, and you can filter to them alone. That's often what an auditor wants first.

DataRetention shows how long each kind of data is kept, read-only, from the service's own policy. DataControls holds export, deleting thread history, and deleting the account.

The components

  • Audit logProEvery event, refusals included, filterable by kind.
  • Data retentionProHow long each kind of data is kept, and what happens after.
  • Data controlsProExport, delete thread history, delete the account.
  • Data regionProWhere the account's data lives and is processed.

See it working

Live in the examples: Audit log

Install

With the shadcn CLI

Each component brings in what it depends on. The free ones install as they are; Pro and Premium ones need a licence key.

Good to know

  • The audit-data-controls block (Premium) adds an agent that searches the log and prepares exports. Deleting data or changing retention needs the person's go-ahead and an owner's typed confirmation.