How to share logs with ChatGPT or Claude safely
Updated
Pasting a stack trace into ChatGPT, Claude, Gemini or Copilot is one of the fastest ways to debug. But a log is a record of your system at work, and it carries the keys to that system and details about the people using it.
The good news: an AI doesn’t need any of that to help you.
What to remove
Secrets, which give access to your systems:
- API keys and tokens (cloud, payment, AI, Git hosting, chat tools)
- passwords, including the ones inside database URLs such as
postgres://user:password@host Authorizationheaders, session cookies and JWTs- private key blocks (
-----BEGIN PRIVATE KEY-----)
Personal data, which belongs to your customers and colleagues:
- emails, phone numbers and names
- IP addresses, which can count as personal data under the GDPR
- card numbers, national ID and tax numbers (such as the Philippine TIN and SSS numbers)
- usernames in file paths such as
/home/mariaorC:\Users\maria
Internal details you may not want to share:
- internal hostnames such as
db-primary.corpor*.svc.cluster.local - private IP ranges, account IDs and customer or order IDs
What to keep
The AI needs to understand what happened. Keep:
- error messages, exception types and stack frames;
- timestamps and the order of events;
- file paths and line numbers (with usernames removed);
- the relationships between values: that the same user failed twice, or that two requests came from the same IP.
That last point is why deleting values doesn’t work well. If every email becomes [REDACTED], the AI can’t tell one user from another. Consistent placeholders fix this: the first email becomes <EMAIL_1> everywhere it appears, the second <EMAIL_2>, and the log still tells the same story.
A two-minute routine
- Cut the log down to the relevant window: the error and a few dozen lines before it. Less text means less to leak, and better answers.
- Paste it into ScrubLogs. It highlights and replaces keys, tokens, passwords, emails, IPs and more with numbered placeholders. It runs in your browser; nothing is uploaded.
- Review the highlights. Click anything you need to keep, and select anything it missed (names and addresses have no fixed pattern) and press Redact selection.
- Copy the cleaned text and paste that into the AI.
- Read the answer with your placeholders in mind. When the AI says “
<HOST_1>is refusing connections”, you know which host it means.
Check your company’s AI policy
Many companies now have rules about what may be shared with AI tools, and which tools are approved. Business and enterprise plans of the major assistants usually exclude your conversations from model training by default, but your data is still stored by a third party. Redacting first keeps you within almost any policy.
If something sensitive has already been pasted, see pasted an API key into ChatGPT.