본문으로 건너뛰기
Skillpedia
API 및 서버 (백엔드)7.6k · #13136

audit-log

하는 일

이 스킬은 Agent-Native 앱이 앱 데이터의 모든 변경에 대해 남기는 감사 로그를 설명합니다. 변경이 영향을 주는 리소스를 이름 붙이는 방법과, 로그를 더 유용하게 만드는 방법을 보여 줍니다. 변경 기록이 필요한 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓레코드의 활동 피드나 변경 이력이 필요할 때.
  • ✓에이전트가 한 변경과 사람이 한 변경을 구분하고 싶을 때.
  • ✓쓰기뿐 아니라 민감한 데이터의 읽기도 기록해야 할 때.

스킬 링크

https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/audit-log/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/audit-log/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“이 앱에서 각 고객 레코드를 누가 바꿨는지, 그리고 그 변경을 에이전트가 했는지 보여 주실 수 있나요?”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

모든 변경 액션이 이벤트를 자동으로 기록합니다. 대상 리소스의 이름을 지정하면 그 변경이 소유자의 기록에 나타나며, 일부 읽기는 로깅 대상으로 표시할 수 있습니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 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 statusCode 401 or 403 records as status: "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, or a2a) records as agent with the user's email, like the app's own agent (tool); caller names the protocol. Classify a new agent-only caller in AGENT_AUDIT_CALLERS, not in a per-action audit config.
  • Client and approval — keep four facts in four fields. actorEmail is the principal the call runs as, never evidence of approval. caller and actorKind are the execution source. reportedClientName / reportedClientVersion are the MCP client's self-reported clientInfo for that individual tools/call; initialize-only values are not carried forward. oauthClientId is the OAuth client its credential was issued to. approval (agent-chat, a2a-review, mcp-client-accepted or mcp-review) records the authorization signal for that call. agent-chat is a person's approval in agent chat; a2a-review is the owner's approval of a paused A2A call on its review page; mcp-client-accepted means the MCP client accepted its elicitation, and the server cannot verify who responded; mcp-review is 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 — recordActionAudit and recordOrgAdminAuditEvent require an attribution (source, reported client, OAuth client, approval, run and network ids), and only auditAttribution(ctx) makes one; a Nitro route outside any action uses routeAuditAttribution(event). Never copy caller, threadId or the client fields into a hand-built context: a field the copy forgets is stored as null. A call w
자주 묻는 질문

모든 액션에 코드를 추가해야 하나요?

아니요. 변경 액션은 이벤트를 자동으로 기록하며, 로그를 더 유용하게 하는 설정만 추가하면 됩니다.

자격 증명이 로그에 저장되나요?

이 스킬은 프레임워크가 기록하기 전에 자격 증명을 가린다고 설명합니다.

분석 도구와 무엇이 다른가요?

감사 로그는 앱 데이터 변경을 기록하고, 분석은 외부 서비스로 제품 사용량을 추적합니다.

상세 정보

작성자의 원본 설명

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

인기도

GitHub 스타
7.6k
순위
#13136
라이선스
MIT
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬