Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    Structured Logging Setup with PII Redaction and Trace IDs

    1

    Find passwords, tokens and personal data leaking into logs, add tested redaction, structured JSON with request and trace IDs, and cut noisy log cost. OBSERVABLE / NOISY / LEAKING.

    $5

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    Structured Logging Setup with PII Redaction and Trace IDs

    Structured Logging Setup with PII Redaction and Trace IDs

    Example session with this skill installed

    Audit logging in our Express API (pino → Datadog). Security review next month. Also our Datadog log bill doubled.

    • Read your context and instructions
    • Compiled the structured logging setup

    Logging: api — VERDICT: LEAKING

    Stack: pino 9 + pino-http → Datadog, retention 30 days

    Leaks found

    #SeverityDataWhereMasked sampleFix
    1CriticalBearer tokenslib/http.ts:52 logs axios err whole (includes config.headers)Bearer eyJh…x9Qkserializer logs err.message, status, url only
    2CriticalStripe secret keysame axios errors to the Stripe APIsk_l…T2fArotate key now; then fix 1
    3HighSession cookiespino-http default req.headerssid=s%3A…redact req.headers.cookie, authorization
    4MediumCustomer emails and phonesorders/service.ts:88 logs full userj***@gmail.comlog user.id only

    Sample-log scan (24 h export you provided): 1,912 JWT matches, 37 Stripe live-key matches, 4,420 emails. gitleaks + regex, a sample of each type checked by hand.

    Structure

    CheckBeforeAfter
    JSON in prodyesyes
    request_id on every linehandlers onlyall lines via child logger
    trace_id / span_idnoyes (OTel instrumentation-pino)
    ID in BullMQ jobsnopassed in job data

    Redaction

    11 explicit pino paths, error serializer, Sentry beforeSend scrub. Test logging.redaction.test.ts logs a fake request with all sensitive fields: 0 found in output.

    Noise and cost

    SourceLines/dayActionEst. saving
    /health access logs8.6 Mdrop~41% of volume
    order loop debug in prod2.1 Mlevel → info summary~10%

    Next steps for you

    Rotate the Stripe key first, then ask Datadog to delete logs containing it (or let 30-day retention expire).

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Logs are where secrets go to hide. An axios error logged whole carries the Authorization header. A debug line prints the user object with the email and phone. A request logger stores cookies. All of it lands in a third-party log service for months, readable by everyone with access. Meanwhile the logs that matter are unstructured text with no request ID.

    This skill gives your coding agent a logging procedure and a reference file checked against library docs and the OWASP Logging Cheat Sheet. It:

    • Inventories loggers, formats, destinations, retention and correlation across services and background jobs
    • Scans for leaks in code (whole request, user, config and HTTP-error objects, known sensitive fields, interpolated messages) and in sample logs (secret scanners plus JWT, bearer, email and card patterns)
    • Fixes structure: JSON in production, standard fields, request_id and OpenTelemetry trace_id/span_id on every line, context binding, sane levels, errors logged once
    • Adds redaction with tests: pino redact, structlog processors, slog ReplaceAttr, Rails filter_parameters, Serilog, Logback, plus Sentry beforeSend and OpenTelemetry Collector scrubbing as a second layer
    • Cuts noise and cost: health checks, polling, chatty libraries and per-item loops
    • Returns a verdict: OBSERVABLE, NOISY or LEAKING

    Works with: pino, winston, Python logging and structlog, Rails, Laravel/Monolog, Go slog and zap, Java Logback/Log4j2, .NET Serilog, OpenTelemetry.

    Safety: never prints secrets or personal data it finds (masked samples only), never deletes stored logs, and tells you to rotate any exposed secret before purging.

    Honesty note: redaction is a safety net; the first fix is always to stop logging the sensitive object.

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for DevOps & Cloud.

    Requires read-only access to log providers. Cannot automatically delete or purge existing stored logs. User must provide log samples for analysis.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 28 days ago

    Software
    Python
    Optional
    Gitleaks
    orTruffleHog

    Only for scanning sample logs.

    Permissions

    Network Access
    Read Files
    Environment Variables
    Listed28 days ago

    What's inside

    Frequently Asked Questions

    It finds secrets and personal data in your logging code and sample logs, removes them at the source, adds tested redaction as a safety net, and produces a report you can show in a security review. Keeping secrets and unneeded personal data out of logs supports requirements in frameworks such as SOC 2 and GDPR, but whether you comply is decided by your own controls and auditors.

    The reference file covers pino, winston, Python logging and structlog, Rails, Laravel/Monolog, Go slog and zap, Java Logback/Log4j2 and .NET Serilog, plus Sentry and the OpenTelemetry Collector. Logs can go to any destination (Datadog, CloudWatch, Loki, Elastic, Splunk and others); the skill works on your code and on sample exports you provide.

    No, this skill focuses on hardening your application code and pipeline to prevent future leaks; it will provide specific instructions for your team to manually purge or rotate existing historical logs safely.

    A SKILL.md with the audit procedure and verdict rules, plus a reference file listing what must never be logged, redaction setup for each major logger, OpenTelemetry correlation, error-tracker scrubbing and regexes for scanning sample logs. Your agent produces a leak table with masked samples, code and config changes, redaction tests and a noise and cost table.

    This skill uses a systematic audit of nested object paths and background job propagation, ensuring that sensitive data isn't accidentally leaked through error trackers or sidecar processes that generic prompts often miss.

    New in DevOps & Cloud