audit-log
O que ela faz
Esta skill descreve o log de auditoria que os aplicativos Agent-Native registram para cada mudança nos dados do app. Mostra como nomear o recurso afetado por uma mudança e como tornar o log mais útil. É para desenvolvedores que precisam de um histórico de alterações.
Quando usar
- ✓Quando você precisa de um feed de atividades ou de um histórico de alterações em registros.
- ✓Quando você quer saber quais alterações foram feitas pelo agente e quais foram feitas por uma pessoa.
- ✓Quando você precisa registrar leituras de dados sensíveis, além das gravações.
Link da skill
https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/audit-log/SKILL.mdCopie e cole na sua IA (Claude, ChatGPT ou Cursor) pedindo para seguir as instruções.
Como usar
O jeito mais fácil: copie a mensagem e cole na sua IA. Ela lê a skill e segue as instruções.
Mensagem pronta para colar
Para Claude Code, Codex ou Cursor: rode na pasta do projeto e a skill fica instalada.
Baixe o SKILL.md e coloque na pasta de skills do seu agente.
Exemplo do que pedir para a IA
“Pode me mostrar quem alterou cada registro de cliente neste aplicativo, e se foi o agente que fez a mudança?”
5 skills novas por semana. 1 minuto de leitura.
Como funciona
Toda action que altera dados registra um evento automaticamente. Você pode nomear o recurso alvo para que a mudança apareça no histórico do seu dono, e pode marcar algumas leituras para registro.
Conteúdo técnico (SKILL.md original)
Texto original do autor, em inglês, direto do 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
Perguntas frequentes
Preciso acrescentar código para cada action?
Não. Actions que alteram dados registram eventos automaticamente, e você só acrescenta configurações para tornar o log mais útil.
As credenciais são guardadas no log?
A skill diz que o framework oculta as credenciais antes de registrar.
Qual é a diferença para analytics?
Logs de auditoria registram alterações nos dados do app, enquanto analytics acompanha o uso do produto com serviços externos.
Detalhes
Descrição original do 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
Popularidade
- Estrelas no GitHub
- 7,6 mil
- Posição no ranking
- #13136
- Licença
- MIT
- Atualizada em
- 02/11/2026
Comentários
- …
Mais skills deste repositório
design-exploration
7,6 milAjuda seu agente a explorar várias direções de design de interface lado a lado, deixar você escolher uma e depois refinar o design escolhido.
visual-edit
7,6 milAjuda seu agente a abrir um aplicativo local em execução em um editor visual, para que você possa revisar e editar as telas reais juntos.
turn-into-app
7,6 milTransforma um fluxo de trabalho, uma planilha ou um projeto em um aplicativo visual bem acabado, com telas preenchidas e um agente trabalhando por trás dos controles.
visual-plan
7,6 milTransforma um plano em texto simples em um plano visual interativo, com diagramas, mapas de arquivos, trechos de código e perguntas em aberto.
Skills parecidas
api-connector-builder
280 milFaz seu agente construir novas conexões com APIs seguindo o padrão já existente. Use quando precisar adicionar mais uma integração sem criar um novo jeito de fazer.
api-design
280 milAjuda seu agente a projetar APIs REST seguindo as melhores práticas. É útil para definir como as APIs se comunicam, como os erros são mostrados e como organizar os dados.
backend-patterns
280 milAjuda seu agente com padrões de arquitetura do lado do servidor e otimização de banco de dados. É útil para construir ou revisar o código que roda no servidor.