# 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.

Web page: https://candor.themethodic.com/patterns/ai-audit-log

## Components

- **Audit log** (`audit-log`, Pro; https://candor.themethodic.com/docs/audit-log.md): Every event, refusals included, filterable by kind.
- **Data retention** (`data-retention`, Pro; https://candor.themethodic.com/docs/data-retention.md): How long each kind of data is kept, and what happens after.
- **Data controls** (`data-controls`, Pro; https://candor.themethodic.com/docs/data-controls.md): Export, delete thread history, delete the account.
- **Data region** (`data-region`, Pro; https://candor.themethodic.com/docs/data-region.md): Where the account's data lives and is processed.

## Install

```bash
npx candor-ui add audit-log data-retention data-controls
```

## Notes

- 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.
