Agent skill · Security

agent-audit-logging

Implement comprehensive audit logging and reporting for multi-agent systems. Covers event capture, structured logging, traceability, compliance reporting, forensic analysis, and real-time monitoring dashboards for agent actions and decisions.

Cosmic Stack3,294★ · 2 repos on radarProfile →
claude-codeMIT
Install
npx skills add cosmicstack-labs/mercury-agent-skills --skill agent-audit-logging --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 1
SKILL.md size: 22 KB
Bundled scripts: none
Version: 1.0.0
Declared author: cosmicstack-labs
Path: categories/ai-ml/agent-audit-logging/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 364
Language: JavaScript
Read our review of the source →

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

Review
written from the skill's own SKILL.md · Aug 5, 2026

What it does

Implements comprehensive audit logging and reporting for multi-agent systems. Covers event capture, structured logging, traceability chains, compliance reporting, forensic analysis, and real-time monitoring dashboards for agent actions and decisions.

How it works

  • Defines a structured AuditEvent schema with event types (invocation, reasoning, tool_call, tool_result, decision, llm_response, error, handoff, human_intervention, token_usage) and fields for identity, context, traceability, and metadata.
  • Builds an AuditLogger that buffers events and flushes to storage in batches; provides methods to log specific event types (log_invocation, log_tool_call, log_decision, log_error).
  • Establishes a TraceabilityChain to fetch and timeline events by trace_id, and to build a graph of events for visualization.
  • Implements a ComplianceReporter with methods to generate reports (summary, tool_usage, error_analysis, compliance_check) from stored events, including calculations like total_events, error rates, tool usage, and suggested actions.
  • Provides a real-time AuditDashboard that reports recent activity from the in-memory buffer, including counts, activity by agent, and recent errors.

When to use it

Use when you need end-to-end observability and accountability for agent actions in production multi-agent systems, including debugging, compliance auditing, billing/tracking, and forensic analysis. Trigger reporting during periodic audits or on-demand for incident reviews. Real-time dashboard is intended for live monitoring.

What it can touch

  • Storage backend for batch_write and query interfaces (via storage_backend in AuditLogger and storage in TraceabilityChain, ComplianceReporter).
  • Internal in-memory buffer for recent events accessed by AuditDashboard.
  • No external tool calls beyond the declared tools in the skill (claude-code) are invoked by the agent through this framework.

Caveats

  • The skill defines a data model and methods but relies on an external storage backend implementation for persistence and querying.
  • The step-by-step code samples assume asynchronous execution (async/await) and Python types; real integration requires compatible runtime and libraries (e.g., asyncio, threading, statistics).
  • Some helper imports (e.g., Counter, defaultdict, datetime, threading, asyncio) are implied but not explicitly listed in the snippet; ensure they are available in the actual implementation.
From the SKILL.md

# Agent Audit Log Reporting ## Overview When agents make decisions, take actions, and spend money, every step must be traceable. Audit logs answer questions like: "What did the agent do?", "Why did it do that?", "Who asked for it?", and "Can we prove it followed the rules?" This skill covers event sourcing, structured logging, traceability chains, compliance reporting, and forensic analysis for production multi-agent systems. --- ## Core Concepts ### Why Audit Logging Matters | Need | Without Audit | With Audit | |------|--------------|------------| | **Debugging** | "The agent did something wrong, but what?" | Full replay of decisions | | **Compliance** | No evidence of rule following | Verifiable compliance trail | | **Billing** | "Why did we spend $5K today?" | Per-task cost attribution | | **Security** | Can't detect injection or abuse | Pattern detection on logs | | **Improvement** | Guess what went wrong | Data-driven optimization | | **Accountability** | "Was this the agent or the user?" | Clear provenance | ### What to Log | Event | Details | Priority | |-------|---------|----------| | **Invocation** | Task received, agent, timestamp | Required | | **Reasoning** | Agent's c

What's inside
Steps it walks through
  1. Overview
  2. Core Concepts
  3. Why Audit Logging Matters
  4. What to Log
  5. Step-by-Step Implementation
  6. Step 1: Define the Audit Event Schema
  7. Step 2: Build the Audit Logger
  8. Step 3: Traceability Chain
  9. Step 4: Compliance Reports
  10. Step 5: Real-Time Audit Dashboard
  11. Step 6: Audit Log Storage & Retention
  12. Audit Report Templates
  13. Daily Audit Summary
  14. Incident Forensics Report
More from mercury-agent-skills
All skills →
About this skill
What does the agent-audit-logging skill do?

Implement comprehensive audit logging and reporting for multi-agent systems. Covers event capture, structured logging, traceability, compliance reporting, forensic analysis, and real-time monitoring dashboards for agent actions and decisions.

How do I install it?

Run `npx skills add cosmicstack-labs/mercury-agent-skills --skill agent-audit-logging --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From cosmicstack-labs/mercury-agent-skills, a repository with 364 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going