Add Audit Logs Automatically

    by Mariusz Wrzeszczynski

    1

    Automatically add secure audit logging to existing applications.

    Secure checkout via Stripe

    0 installsSecurity scanned

    Works with the AI tools you already use

    CClaude CodeCCursorCCodex CLIGGitHub CopilotGGemini CLIVVS CodeWWindsurfMManus+14 more

    See it in action

    You say

    Add audit logging to my Node/Express app. I need to track when admins change user roles or delete accounts. Make sure we don't log any session cookies.

    Your agent does

    Project Detected: Node.js / Express / PostgreSQL / Passport.js

    Audit Logging Added:

    • user.role_changed
    • user.deleted

    Audit Event Structure:

    • Actor: Authenticated Req User
    • Target: Target User ID
    • Metadata: Field changes, timestamp
    • Result: Records success and failure

    Files Modified:

    • src/services/audit.service.js
    • src/models/AuditLog.js
    • src/routes/admin.js

    Commands Executed:

    • npm test src/tests/audit.test.js

    How to Verify: Run npm run migrate then trigger a role change in the admin dashboard. Check the audit_logs table.

    What you get

    Track administrative changes to user roles and permissions.Implement append-only activity history for compliance requirements.Safely log security events while auto-redacting secrets and PII.Generate searchable event trails for database record modifications.

    About this skill

    The problem

    Manual audit logging is error-prone and often leads to security vulnerabilities like leaking PII or credentials in logs. Developers struggle to maintain a consistent, append-only history of sensitive actions across fragmented services and frameworks.

    What it does

    • Detects your project stack, authentication patterns, and database schema to ensure architectural consistency.
    • Creates centralized, append-only audit services and models for tracking actors, targets, and timestamps.
    • Automatically redacts sensitive data such as passwords, tokens, and PII from log payloads.
    • Injects audit hooks into security-sensitive workflows like auth events, role changes, and data deletions.
    • Generates migrations and unit tests to verify that logs are created and protected from unauthorized modification.

    Why this beats prompting it yourself

    This skill enforces a strict security protocol that prevents common DIY mistakes, such as trusting client-side actor IDs or logging raw request bodies. It ensures structured, searchable metadata across your entire application instead of inconsistent string-based logs.

    Use cases

    • Implementing SOC2 or GDPR compliant activity trails for administrative actions.
    • Adding "who changed what" history to critical database records.
    • Tracking failed login attempts and security-sensitive configuration changes.
    • Refactoring scattered print statements into a structured, append-only audit system.

    Known limitations

    Does not provide legal or compliance certification. Local validation depends on available test suites and database access within the environment.

    How to install

    Drop the file into your AI Agent. Works with Claude, Cursor, ChatGPT, and 20+ more.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill passes our trust checks below.

    Security scanned

    Passed our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    30-day refund

    Not a fit? Get your money back

    Trust & safety

    Security scanned

    Verified clean today

    Listedtoday

    Creator

    Mariusz Wrzeszczynski
    Mariusz Wrzeszczynski

    109 skills on Agensi

    Frequently Asked Questions

    Popular in AI Agents & LLM Ops