audit-log
What it does
This skill describes the audit log that Agent-Native apps record for every change to app data. It shows how to name the resource a change affects and how to make the log more useful. It is for developers who need a change history.
When to use it
- βWhen you need an activity feed or a history of changes to records.
- βWhen you want to know which changes the agent made and which a person made.
- βWhen you need to log reads of sensitive data as well as writes.
Skill link
https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/audit-log/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βCan you show me who changed each customer record in this app, and whether the agent made the change?β
5 new skills a week. 1 minute to read.
How it works
Every mutating action records an event automatically. You can name the target resource so the change appears in its owner's trail, and you can mark some reads for logging.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Audit Log
Rule
Every mutating action automatically records an audit event β no wiring
needed. The framework captures who/what/when/from-where at the defineAction
seam, redacts credentials, and attributes the change to a human or the agent
(with the agent thread/turn that caused it). You only touch audit config to
make events more useful (declare the target) or to opt a read in / a noisy
write out.
This is distinct from:
- observability β sampled agent-run telemetry (traces, evals), developer-facing.
- tracking β fire-and-forget product analytics to external SaaS.
Audit is complete, durable, locally queryable, and scoped to the data it describes.
Declare the target so it lands in the owner's trail
By default an event is scoped to the actor (you see your own changes and the agent's changes on your behalf). To make a change to a shared resource show up in the owner's audit trail, declare the target:
defineAction({
description: "Delete a recording",
schema: z.object({ id: z.string() }),
audit: {
// type + id label the event; ownerEmail/orgId/visibility scope who can read it.
target: (args, result, meta) => ({
type: "recording",
id: args.id,
// Optional β defaults to the actor. Set when editing someone else's resource.
ownerEmail: result?.ownerEmail,
visibility: "org",
}),
summary: (args) => `Deleted recording ${args.id}`,
},
run: async (args, ctx) => { /* ... */ },
});
target, ownerEmail, visibility, and summary are all optional. The
minimum useful addition is target: () => ({ type, id }).
Defaults and how to override them
- Mutations (anything not GET /
readOnly) are audited automatically. - Read-only actions are skipped. Audit a sensitive read (secret access, bulk
export) with
audit: { onRead: true }. - High-frequency framework actions (app-state sync, context-xray, navigate,
appearance) are skipped by default. Force one on with
audit: { enabled: true }. - Opt a noisy write out with
audit: { enabled: false }. - Skip capturing arguments (large/sensitive payloads) with
audit: { recordInputs: false }. Inputs are credential-redacted regardless. - Refusals β a thrown error with
statusCode401 or 403 records asstatus: "denied", so a refused attempt shows up as an attempt. - Probes β a health or capability probe sends
{ "__probe__": true }as its only argument. If it is rejected it records nothing; if it executes, or carries any other argument, it records like any call. Do not invent another probe shape in a client; the recorder only knows this one. - Outside agents β a call over an agent protocol (
mcp,webmcp, ora2a) records asagentwith the user's email, like the app's own agent (tool);callernames the protocol. Classify a new agent-only caller inAGENT_AUDIT_CALLERS, not in a per-actionauditconfig. - Client and approval β keep four facts in four fields.
actorEmailis the principal the call runs as, never evidence of approval.callerandactorKindare the execution source.reportedClientName/reportedClientVersionare the MCP client's self-reportedclientInfofor that individualtools/call;initialize-only values are not carried forward.oauthClientIdis the OAuth client its credential was issued to.approval(agent-chat,a2a-review,mcp-client-acceptedormcp-review) records the authorization signal for that call.agent-chatis a person's approval in agent chat;a2a-reviewis the owner's approval of a paused A2A call on its review page;mcp-client-acceptedmeans the MCP client accepted its elicitation, and the server cannot verify who responded;mcp-reviewis the signed-in owner's approval of a direct MCP call on its review page. The recorder reads approval from the invocation's execution frame, never from its context. Never infer approval from the email, and never backfill these fields on older rows. - Attribution comes from one helper β
recordActionAuditandrecordOrgAdminAuditEventrequire anattribution(source, reported client, OAuth client, approval, run and network ids), and onlyauditAttribution(ctx)makes one; a Nitro route outside any action usesrouteAuditAttribution(event). Never copycaller,threadIdor the client fields into a hand-built context: a field the copy forgets is stored as null. A call w
FAQ
Do I have to add code for every action?
No. Mutating actions record events automatically, and you only add settings to make the log more useful.
Are credentials stored in the log?
The skill says the framework redacts credentials before recording.
How is this different from analytics?
Audit logs record app data changes, while analytics tracks product usage with outside services.
Details
Original description by the author
Durable, access-scoped, append-only record of who changed what app data, when, and whether it was the agent or a human. Use when adding an activity feed or change history, declaring what a mutating action targets, auditing sensitive reads, or answering "what did the agent change / who edited this".
repo: BuilderIO/agent-native
Popularity
- GitHub stars
- 7.6k
- Ranking position
- #13136
- License
- MIT
- Updated
- 11/2/2026
Comments
- β¦
More skills from this repository
design-exploration
7.6kHelps your agent explore several UI design directions side by side, let you pick one, and then refine the chosen design.
visual-edit
7.6kHelps your agent open a running local app in a visual editor so you can review and edit its real screens together.
turn-into-app
7.6kTurns a workflow, spreadsheet or project into a polished visual app, with populated screens and an agent working behind the controls.
visual-plan
7.6kTurns a plain text plan into an interactive visual plan with diagrams, file maps, code snippets and open questions.
Similar skills
api-connector-builder
280kHas your agent build new API connections following the existing pattern. Use when you need to add one more integration without creating a new way of doing things.
api-design
280kHelps your agent design REST APIs following best practices. It's useful for defining how APIs communicate, how errors are shown, and how to organize data.
backend-patterns
280kHelps your agent with server-side architecture patterns and database optimization. It's useful for building or reviewing code that runs on the server.