Developers increasingly use AI assistants like ChatGPT and GitHub Copilot to debug complex issues. But application logs often contain sensitive data that shouldn't be shared with third-party services.
What's Hiding in Your Logs?
Application logs can contain:
- API keys and tokens: Authentication credentials in headers
- User PII: Email addresses, names, IP addresses
- Infrastructure details: Server names, internal URLs, database strings
- Business logic: Proprietary algorithms, pricing rules
- Customer data: Transaction IDs, payment details
The Developer's Dilemma
When you hit a production bug, you need to:
- Share error context with AI assistants for faster debugging
- Protect sensitive data to maintain security and compliance
- Preserve enough detail for the AI to provide useful guidance
Log Sanitisation Strategy
1. Pre-Sanitisation (Before Logging)
Best Practice: Sanitise at the source
// ❌ Bad: Logging raw data
logger.error('User login failed', { email: user.email, password: rawPassword })
// ✅ Good: Sanitise before logging
logger.error('User login failed', {
userId: hashId(user.id),
reason: 'invalid_credentials'
})2. Runtime Sanitisation (On Demand)
Use Case: When sharing logs with AI tools
Use Redactorr to automatically detect and redact:
- API keys (OpenAI, Stripe, AWS, etc.)
- Email addresses and usernames
- IP addresses and server names
- Database connection strings
- Environment variable values
3. Pattern Detection Examples
API Keys:
Before: Authorization: Bearer sk-abc123...
After: Authorization: Bearer [REDACTED_API_KEY]Email Addresses:
Before: User [email protected] triggered error
After: User [REDACTED_EMAIL] triggered errorIP Addresses:
Before: Request from 192.168.1.100 failed
After: Request from [REDACTED_IP] failedStack Traces:
Before: at /home/deploy/app/secrets/config.js:45
After: at [REDACTED_PATH]/config.js:45DevOps-Specific Patterns
Redactorr detects 240+ DevOps patterns, including:
- AWS Access Keys (IAM credentials)
- Docker secrets and environment variables
- Kubernetes secrets (base64 encoded)
- Database connection strings
- Private keys (RSA, SSH, TLS)
- Git credentials in URLs
- Slack/Discord webhooks
Real-World Workflow
- Copy logs from your monitoring tool (Datadog, Splunk, etc.)
- Open Redactorr at app.redactorr.com and paste your logs
- Auto-detect sensitive data (< 100ms for most logs)
- Review and customise redactions if needed
- Copy sanitised logs and paste into ChatGPT
Result: You get full debugging power without leaking credentials.
Stack Trace Sanitiser Tool
Redactorr includes a dedicated Stack Trace Sanitiser that:
- Preserves error messages and line numbers
- Redacts file paths and environment variables
- Maintains stack structure for debugging
- Handles multiple languages (JavaScript, Python, Java, Go, etc.)
Compliance Benefits
- ✅ Safe to share logs with AI tools
- ✅ No credentials leaked in ChatGPT history
- ✅ Audit trail of what was redacted
- ✅ Supports ISO 27001 and Privacy Act 1988 requirements
Conclusion
Sanitising logs before sharing with AI assistants is essential for security and compliance. With automated detection, you can use AI debugging tools without compromising sensitive data.
Try it now: Paste a stack trace into our demo and see what gets detected.