ai-audit-logging

Capture AI interaction logs with a structured event schema.

4|Updated Apr 27, 2026
One-click install
npx skills add https://github.com/maruakshay/mii-ai-security --skill ai-audit-logging-maruakshay
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ai-audit-logging
Source: https://github.com/maruakshay/mii-ai-security/tree/main/skills/ai-audit-logging
Command: npx skills add https://github.com/maruakshay/mii-ai-security --skill ai-audit-logging-maruakshay

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Audit logging is essential for forensic investigations of AI systems, ensuring that the full sequence of prompts, model responses, tool invocations, and retrievals is captured and protected from tampering. Without a complete audit trail, incidents are untraceable and attackers can obfuscate activity.

Core Features & Use Cases

  • Structured event schema for LLM interactions including timestamp, session_id, user_id, model_id, prompt, response, tool_calls, retrievals, latency, and token counts.
  • Tamper-resistance and retention through append-only storage, separate write/read credentials, and defined retention policies with integrity checks.
  • End-to-end lifecycle coverage from request reception to output delivery, including blocked outputs and safety events for secure incident response.

Quick Start

Add a logging middleware wrapper around every LLM call today to begin capturing essential fields such as timestamp, session_id, prompt and response counts, model_id, and latency.

Frequently Asked Questions about ai-audit-logging

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I capture LLM interactions for forensic auditing and compliance?

Capture LLM interactions for auditing by wrapping every model call in a logging middleware that records timestamps, session IDs, prompts, responses, tool invocations, and token counts into a structured event schema. This ensures full traceability for incident response and regulatory compliance.

What is the best way to prevent tampering with AI audit logs?

Prevent tampering with AI audit logs by using append-only storage with separate write and read credentials. This approach enforces defined retention policies and integrity checks, ensuring historical interaction data remains protected from unauthorized modifications during forensic investigations.

How do I log tool invocations and retrieval events in an AI agent system?

Log tool invocations and retrieval events in an AI agent system by implementing a structured event schema that captures the complete interaction lifecycle. This includes recording model responses, tool calls, retrievals, and safety events from request reception to output delivery.

Does audit logging work for blocked outputs and safety events in chat assistants?

Audit logging works for blocked outputs and safety events in chat assistants by providing end-to-end lifecycle coverage. It captures the full sequence of prompts and model responses, ensuring that blocked content and safety triggers are traceable for secure incident response.

Do I need separate credentials to read and write AI interaction logs?

You need separate credentials to read and write AI interaction logs to ensure tamper-resistant retention. Using distinct write and read permissions enforces append-only storage, preventing unauthorized modifications while maintaining secure access for compliance auditing and forensic investigations.