audit-log
Was er macht
Dieser Skill beschreibt das Änderungsprotokoll, das Agent-Native-Apps für jede Änderung an App-Daten führen. Er zeigt, wie man die betroffene Ressource benennt und das Protokoll nützlicher macht. Er richtet sich an Entwickler, die eine Änderungshistorie brauchen.
Wann du ihn nutzt
- ✓Wenn du einen Aktivitätsverlauf oder eine Historie der Änderungen an Datensätzen brauchst.
- ✓Wenn du wissen willst, welche Änderungen der Agent und welche eine Person vorgenommen hat.
- ✓Wenn du auch das Lesen sensibler Daten protokollieren willst, nicht nur das Schreiben.
Link zum Skill
https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/audit-log/SKILL.mdKopiere ihn und füge ihn in deine KI ein (Claude, ChatGPT oder Cursor) mit der Bitte, den Anweisungen zu folgen.
So nutzt du ihn
Am einfachsten: Kopiere die Nachricht und füge sie in deine KI ein. Sie liest den Skill und folgt den Anweisungen.
Fertige Nachricht zum Einfügen
Für Claude Code, Codex oder Cursor: Führe den Befehl in deinem Projektordner aus, dann wird der Skill installiert.
Lade die SKILL.md herunter und lege sie in den Skills-Ordner deines Agenten.
Beispielanfrage an deine KI
“Kannst du mir zeigen, wer jeden Kundendatensatz in dieser App geändert hat und ob der Agent die Änderung gemacht hat?”
5 neue Skills pro Woche. 1 Minute Lesezeit.
So funktioniert es
Jede verändernde Aktion erzeugt automatisch einen Eintrag. Du kannst die Zielressource benennen, damit die Änderung im Verlauf ihres Eigentümers erscheint, und einige Lesezugriffe zur Protokollierung markieren.
Technischer Inhalt (originale SKILL.md)
Originaltext des Autors, auf Englisch, direkt von 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
Häufige Fragen
Muss ich für jede Aktion Code hinzufügen?
Nein. Verändernde Aktionen werden automatisch protokolliert, du ergänzt nur Einstellungen, um das Protokoll nützlicher zu machen.
Werden Zugangsdaten im Protokoll gespeichert?
Der Skill sagt, das Framework schwärzt Zugangsdaten, bevor sie protokolliert werden.
Worin unterscheidet sich das von Analytics?
Das Änderungsprotokoll erfasst Änderungen an App-Daten, Analytics verfolgt die Nutzung des Produkts über externe Dienste.
Details
Originalbeschreibung des Autors
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
Beliebtheit
- GitHub-Sterne
- 7.6k
- Platz im Ranking
- #13136
- Lizenz
- MIT
- Aktualisiert
- 2.11.2026
Kommentare
- …
Weitere Skills aus diesem Repository
design-exploration
7.6kHilft deinem Agenten, mehrere UI-Design-Richtungen nebeneinander zu erkunden, dich eine auswählen zu lassen und das gewählte Design danach zu verfeinern.
visual-edit
7.6kHilft deinem Agenten, eine laufende lokale App in einem visuellen Editor zu öffnen, damit du ihre echten Bildschirme gemeinsam prüfen und bearbeiten kannst.
turn-into-app
7.6kVerwandelt einen Arbeitsablauf, eine Tabelle oder ein Projekt in eine ausgearbeitete visuelle App mit gefüllten Bildschirmen und einem Agenten im Hintergrund.
visual-plan
7.6kVerwandelt einen einfachen Textplan in einen interaktiven visuellen Plan mit Diagrammen, Dateiübersichten, Code-Ausschnitten und offenen Fragen.
Ähnliche Skills
api-connector-builder
280kLässt deinen Agenten neue API-Anbindungen nach dem bestehenden Muster bauen. Nutze es, wenn du eine weitere Integration ergänzen willst, ohne neue Wege einzuführen.
api-design
280kHilft deinem Agenten, REST-APIs nach Best Practices zu entwerfen. Nützlich für die Kommunikation, die Fehlerausgabe und die Organisation von Daten.
backend-patterns
280kHilft deinem Agenten bei Architekturmustern für die Serverseite und bei der Datenbankoptimierung. Nützlich zum Bauen und Prüfen von Server-Code.