Skillpedia
واجهات API والخوادم (backend)7.6k · #13136

audit-log

ما الذي تفعله

تصف هذه المهارة سجل التدقيق الذي تسجّله تطبيقات Agent-Native لكل تغيير في بيانات التطبيق. تشرح كيف تسمّي المورد الذي يتأثر بالتغيير، وكيف تجعل السجل أكثر فائدة. وهي مخصصة للمطورين الذين يحتاجون إلى سجل للتغييرات.

متى تستخدمها

  • ✓عندما تحتاج إلى سجل نشاط أو تاريخ للتغييرات على السجلات.
  • ✓عندما تريد معرفة التغييرات التي أجراها الوكيل وتلك التي أجراها شخص.
  • ✓عندما تحتاج إلى تسجيل القراءات الحساسة للبيانات إلى جانب عمليات الكتابة.

رابط المهارة

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

انسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.

طريقة الاستخدام

أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.

رسالة جاهزة للصق

استخدم هذه المهارة لمساعدتي: https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/audit-log/SKILL.md اقرأ ملف SKILL.md في هذا الرابط ونفّذ تعليماته لمهمتي.
تريد أن يجد الذكاء الاصطناعي مهارات مثل هذه بنفسه؟ثبّت خادم Skillpedia MCP المجاني: سطر واحد، ويبحث في 15,000+ مهارة قبل كل مهمة.ثبّته في دقيقة واحدة →

مثال على ما تطلبه من الذكاء الاصطناعي

“هل يمكنك أن تريني من غيّر كل سجل عميل في هذا التطبيق، وهل أجرى الوكيل التغيير؟”

5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.

كيف تعمل

تسجّل كل عملية تعديل حدثاً تلقائياً. يمكنك تسمية المورد المستهدف حتى يظهر التغيير في سجل مالكه، ويمكنك تحديد بعض القراءات لتسجيلها.

المحتوى التقني (ملف 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
آخر تحديث
2‏/11‏/2026

هل هذه المهارة مفيدة؟

0

سجّل الدخول للتصويت.

التعليقات

  • …

المزيد من المهارات من هذا المستودع

مهارات مشابهة