- ›
AI agent audit logging must answer: who acted, for which end-user, under which policy, with what outcome— across every primitive. - ›
Naïve records every regulated tool call on the tenant user's activity log— cards, email, connections, vault access, approvals. - ›
Logs are a product of the governance gateway— not something you bolt on by printf in the agent loop. - ›Approval events link to the frozen action: pending, approved, denied, and replay result.
- ›Query logs per tenant user for customer support; query across users for operator compliance.
- ›
Combine audit with revoke— one timeline shows what happened before you cut access.
When an agent charges a card, sends email, or connects an app, someone will ask what happened — a customer, your compliance team, or you at 2 a.m. after a runaway loop. Application console.log is not enough. You need an audit trail tied to agent identity, written on every regulated action.
Naïve records gateway-enforced calls on each tenant user's activity log. This post is the operational guide; The Governed Agent Profile explains why audit sits alongside caps, approvals, and revoke.
What gets logged?
| Category | Examples |
|---|---|
| Money | Card issue, fund, charge, refund |
| Comms | Email send, SMS, voice |
| Auth | Connection connect, tool execute |
| Secrets | Vault put, reveal (metadata — not the secret value) |
| Policy | Approval created, approved, denied, replayed |
| Control | Agent profile revoke, session revoke |
Each entry includes who (tenant user + actor type), what (action/primitive), when, and outcome.
Query logs for one customer
const events = await naive.forUser(customerId).logs.query({
limit: 50,
});Use this in support consoles: "show me everything this customer's agent did today."
Tie audit to approvals
When a tool returns pending_approval:
- Log shows the frozen action with
actionin the immediate payload - Human approves via dashboard or API
- Replay outcome appears on the approval record and in subsequent log entries
See how to add human approval for the UI loop.
Audit before revoke
Investigation pattern:
1. forUser(id).logs.query({ limit }) — review last N actions
2. sessions.revoke(id) — cut the agent's session access
3. logs.query again — confirm no new entries after revoke
DIY audit vs gateway audit
| DIY | Gateway (Naïve) |
|---|---|
| Log only what you remember to instrument | Every regulated primitive logged by default |
| Schema drift per integration | Consistent action types |
| Miss MCP/hosted tool paths | Same trail for BYO and hosted runtime |
Where to go next
- Spend caps, approvals, and revocation — control cluster
- Why consolidate agent infra — one log across primitives
- Logs docs — API reference
What should an AI agent audit log capture?+
Where are AI agent actions logged on Naïve?+
Are approval decisions included in the audit trail?+
Can I audit one customer's agent without seeing another's?+
How is audit logging different from application logging?+
How does audit relate to revoke?+
Building the agent-native backend.
A governed agent profile is an AI agent with identity, spend limits, approvals, audit, and instant revoke — enforced on every action. Here's the full lifecycle.
Spend caps, human approvals, and instant revoke for AI agents must be enforced server-side — Naïve's governance gateway applies all three on every call.
An AI agent identity is the governed record an agent acts as — tenant user, Account Kit, resources, and audit trail — not the model or the API key alone.
How to add human approval to an AI agent: gate sensitive actions on your Account Kit, surface pending approvals, and replay on approve. A step-by-step guide.