# Log Redaction Audit

> Recursive secret redaction and security audit framework for preventing credential leakage in application logs.

Log Redaction Audit is a paid AI agent skill on Agensi by Khristian Kopachelli, in Security. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: $12 (one-time purchase)
- Creator: [Khristian Kopachelli](https://www.agensi.io/creators/khristian-kopachelli)
- Category: [Security](https://www.agensi.io/skills/security)
- Version: 1.0
- Last updated: 2026-11-29
- Security: scan passed (2026-11-29); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/log-redaction-audit
- Tags: security, llm-ops, typescript, logging, compliance

## About this skill

Secrets leak into logs constantly through thrown errors, request headers, or debug prints of config objects. This skill provides a systematic audit framework and implementation guide for intercepting credentials before they reach your log store. It focuses on a two-layer defense: intelligent key-based tokenization and high-precision pattern matching for known secret formats.

### What it does
- **Secret detection** identifies PEM blocks, JWTs, Bearer tokens, and specific provider keys (AWS, Stripe, GitHub, OpenAI) in free text.
- **Recursive redaction** masks sensitive keys like `sessionKey`, `api_key`, and `Authorization` at any nesting depth in JSON objects.
- **Error scrubbing** cleans stack traces and error properties to prevent request data echoes from appearing in logs.
- **Pathological input protection** uses `maxDepth` and `maxNodes` guards to prevent hanging on circular or massive data structures.
- **Customizable masking** allows for domain-specific `extraKeys`, regex patterns, and allowlists to reduce false positives.

### How it works
1. **Source analysis** involves grepping the codebase for logging calls situated near environment variables, auth headers, and config objects.
2. **Implementation audit** checks that redaction is applied at the transport boundary rather than inconsistently across call sites.
3. **Secret simulation** tests the pipeline by feeding it realistic JWT, PEM, and provider-specific key shapes to verify masking.
4. **Refinement** adds domain-specific terms to `extraKeys` for exotic credential names like `internalApiToken`.

### Frameworks & tools
This skill utilizes the `redact-log` pattern and is designed for TypeScript/JavaScript environments. It integrates with standard logging libraries via wrappers and provides regex patterns for CLI auditing using `grep`.

### Why this beats prompting it yourself
Generic prompts often miss the nuances of error object serialization and nested JSON structures. This skill uses a proven two-layer model that tokenizes keys to avoid "over-redacting" similar words while ensuring free-text patterns catch high-entropy strings like PEM blocks that key-matching alone misses.

### Use cases
- Auditing a PR that introduces new logging to ensure no credentials leak.
- Preparing compliance evidence for SOC2 or GDPR by demonstrating log sanitization.
- Implementing a centralized log wrapper to scrub errors before they hit Sentry or Datadog.
- Scanning legacy codebases for `console.log` calls that output raw request headers.

### Known limitations
Redaction is best-effort pattern matching and not a mathematical proof of security. Exotic credential names like `cred2` require manual configuration via `extraKeyPatterns` to be caught.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Log Redaction Audit skill from Agensi" and describe your task.
3. Buy it on the listing or let your agent ask you first; your agent then loads it from Agensi when it needs it. Every paid skill has a money-back guarantee: https://www.agensi.io/docs/money-back-guarantee

## Frequently asked questions

### What specific problem does the Log Redaction Audit skill solve for my application?

This skill solves the 'leaky log' problem by providing a systematic framework to identify and mask credentials, JWTs, and sensitive JSON keys before they are stored in external services like Datadog or Sentry.

### Which programming languages and frameworks are compatible with this audit framework?

The skill is optimized for TypeScript and JavaScript environments, providing specific logic for handling nested JSON objects and error serialization common in these ecosystems.

### What components are included in the purchase of this skill?

You receive a comprehensive audit guide, a suite of high-precision regex patterns for secret detection, recursive redaction logic for nested data, and a simulation set for testing your pipeline's effectiveness.

### Can I customize the redaction logic to catch proprietary or non-standard credential names?

While it includes deep support for standard keys like 'api_key' or 'Authorization,' you can easily extend the protection by adding domain-specific terms to the 'extraKeys' configuration or providing custom regex patterns.

### Does the redaction process impact application performance when handling large logs?

Yes, the framework includes built-in 'maxDepth' and 'maxNodes' guards specifically designed to prevent performance bottlenecks or hangs when processing circular references or large data structures.

### How does this skill help with security compliance audits like SOC2?

The framework facilitates compliance evidence for SOC2 and GDPR by establishing a verifiable, two-layer defense that demonstrates proactive measures to prevent PII and credential leakage.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
