audit-log
Qué hace
Esta skill describe el registro de auditoría que las apps Agent-Native guardan para cada cambio en los datos de la app. Muestra cómo nombrar el recurso que afecta un cambio y cómo hacer el registro más útil. Es para desarrolladores que necesitan un historial de cambios.
Cuándo usarla
- ✓Cuando necesitas un historial de actividad o de cambios en los registros.
- ✓Cuando quieres saber qué cambios hizo el agente y cuáles hizo una persona.
- ✓Cuando necesitas registrar también las lecturas de datos sensibles, además de las escrituras.
Link de la skill
https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/audit-log/SKILL.mdCópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.
Cómo usar
La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.
Mensaje listo para pegar
Para Claude Code, Codex o Cursor: ejecútalo en la carpeta del proyecto y la skill queda instalada.
Descarga el SKILL.md y ponlo en la carpeta de skills de tu agente.
Ejemplo de qué pedirle a la IA
“¿Puedes mostrarme quién cambió cada registro de cliente en esta app, y si el cambio lo hizo el agente?”
5 skills nuevas por semana. 1 minuto de lectura.
Cómo funciona
Cada acción que modifica datos registra un evento automáticamente. Puedes nombrar el recurso de destino para que el cambio aparezca en el historial de su propietario, y marcar algunas lecturas para registrarlas.
Contenido técnico (SKILL.md original)
Texto original del autor, en inglés, directo de 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
Preguntas frecuentes
¿Tengo que añadir código para cada acción?
No. Las acciones que modifican datos registran eventos automáticamente, y solo añades ajustes para que el registro sea más útil.
¿Se guardan las credenciales en el registro?
La skill indica que el framework oculta las credenciales antes de registrarlas.
¿En qué se diferencia de la analítica?
El registro de auditoría guarda los cambios de datos de la app, mientras que la analítica sigue el uso del producto con servicios externos.
Detalles
Descripción original del autor
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
Popularidad
- Estrellas en GitHub
- 7,6 mil
- Posición en el ranking
- #13136
- Licencia
- MIT
- Actualizada
- 2/11/2026
Comentarios
- …
Más skills de este repositorio
design-exploration
7,6 milAyuda a tu agente a explorar varias direcciones de diseño de interfaces una al lado de otra, dejar que elijas una y después afinar el diseño elegido.
visual-edit
7,6 milAyuda a tu agente a abrir una aplicación local en marcha en un editor visual, para que reviséis y editéis juntos sus pantallas reales.
turn-into-app
7,6 milConvierte un flujo de trabajo, una hoja de cálculo o un proyecto en una aplicación visual pulida, con pantallas llenas de datos y un agente que trabaja tras los controles.
visual-plan
7,6 milConvierte un plan escrito en texto plano en un plan visual interactivo, con diagramas, mapas de archivos, fragmentos de código y preguntas abiertas.
Skills parecidas
api-connector-builder
280 milHace que tu agente cree nuevas conexiones de API siguiendo el patrón existente. Úsalo para añadir una integración más sin inventar otra forma de hacer las cosas.
api-design
280 milAyuda a tu agente a diseñar APIs REST según las buenas prácticas. Es útil para definir cómo se comunican las APIs, cómo se muestran los errores y cómo organizar los datos.
backend-patterns
280 milAyuda a tu agente con patrones de arquitectura del lado del servidor y optimización de bases de datos. Es útil para crear o revisar código que se ejecuta en el servidor.