You're reading docs for Nextly Alpha. APIs may change between releases.

Audit Log

Audit Log

A durable record of who changed what, and when.

The audit log records mutations as they happen: which user, which action, which document, and which fields changed.

Availability

Built inNo plugin required, and not gated behind a paid tier
AdminActivity is surfaced on the dashboard
PermissionReading activity is an admin capability

What a record holds

FieldMeaning
ActorWho made the change
Agent and doorWhich agent acted for that person, if one did, and how the call arrived (see below)
ActionWhat happened — a create, an update, a delete
TargetThe collection and document
Changed fieldsWhich fields differed, computed from the write itself

System writes are not recorded. A mutation made by internal or system context, such as a seed or a migration, produces no activity entry. If you rely on this log, that gap is the thing to know: the absence of an entry does not mean nothing happened.

Recording the changed field list — rather than the whole document — keeps the log useful without turning it into a second copy of your content. Version history is where the full before-and-after lives.

Agents, doors and approvals

When an AI agent acts for a person, the person stays the actor and the record names the agent beside them. The admin's Team activity card reads, for example, "Claude Code, for Sara Malik, approved on phone", and the entry's history "Claude Code, for Sara Malik".

Each activity and audit record can also hold:

FieldMeaning
AgentThe agent's name, such as "Claude Code", and the agent session the call belongs to
DoorHow the call arrived: the command line on the person's own machine (local), the site's command door (command), a chat app (chat-app), the REST API with a key marked as an agent's (rest-key), or a deploy pipeline (deploy)
CredentialThe agent's pass, the chat app's connection or the key, by id
ApprovalThe approval request behind the call, who decided it, where (on a phone, in the browser or in the admin), and whether it was approved or refused. A refused request ran nothing, so its decision belongs on the audit log as a record of its own, written by the approval requests that decide it; the activity log and Team activity list only what ran. A record written before decisions were recorded names none and reads as approved
GrantThe standing "always allow" rule that let the call run without asking
UndoThe agent session that an undo put back
DeploymentThe host and commit of a deploy pipeline, read as "Deployment (Vercel build, commit 3f2a1c9)", or the machine it ran from

Work at the command line on the person's own machine reads "Sara Malik, from the command line".

Records hold ids only: a uuid, a short id of at most 32 letters, digits and hyphens, or a command-line sign-in's or agent pass's own id (ncc_ and 32 lowercase hex digits). A value shaped like a token, a whole API key or a signed value is refused wherever an id belongs, and the rest of the record is still written. A deployment is recorded only on the deployment's own records, never on a record whose actor is a person.

The dashboard's activity read narrows to what agents did:

ParameterShows only
agents=onlyrecords an agent acted on, whichever agent
agentone agent, by its name
forthe agents that acted for one person, by the person's user id
doorone door: local, command, chat-app, rest-key or deploy
sessionone agent session, by its id
GET /api/dashboard/activity?agent=Claude%20Code
GET /api/dashboard/activity?for=<user id>&door=chat-app
GET /api/dashboard/activity?session=<session id>

A value no record could hold (a door there is none of, an id shaped like a credential) is refused rather than answered with nothing.

Records written before these fields existed hold none of them, and read as they always did.

Erasing a person without erasing the record

A deletion request under privacy law asks you to remove a person's data. An audit log exists precisely so records cannot quietly disappear. Those pull in opposite directions.

Nextly resolves it by separating the actor from the act: a person's identifying details can be erased while the entries they produced remain, still counted, still ordered, still showing that a change happened and what it touched. You keep the record and lose the person, which is what both obligations actually require.

An agent that acted for the person keeps its name on those entries, since it names software and not anyone: after the erasure the Team activity card reads "Claude Code, for [deleted user · 1a2b3c4d]", and the entry's history "Claude Code, for someone not recorded".

Signed-in people a plugin defines

A plugin can sign in people who are not staff, such as a shop's customers (see Signed-in people). What such a person does appears in the security audit trail, not in the activity log above: the activity log records staff users only.

A row about such a person names them by kind and id, in fields of their own. It records which kind of caller acted (staff, apiKey, core, anonymous, or the person's kind, such as accounts:account), and it keeps its network address, browser and the plugin's metadata, as it does for a staff user who exists.

When the plugin reports the person deleted, Nextly does the following in one transaction:

  • erases the address and browser on every row the person acted on;
  • erases the plugin's metadata on every plugin row about them;
  • replaces their id with a keyed digest of their kind and id.

It then keeps only that digest and the time, never the id, so every row written about the person afterwards is written already erased. Rows about anyone else stay as they were, a staff user who happens to share the person's id included, and so does the address of a staff member who acted on the person.

The digest's key is a random key Nextly makes once and keeps sealed under NEXTLY_SECRET. After you rotate the secret, keep the old one in NEXTLY_SECRET_PREVIOUS until the app has started once with both: the key is sealed again under the new secret at that boot, and then the old secret can go. If the old secret is dropped before that, the key cannot be read: writes naming a person and deletion reports fail, and each failure is logged.

Retention

Audit entries are pruned on a schedule, so the log holds a useful window rather than growing forever.