ChatGPT
Chat
12d ago
A regex to catch API keys before pasting into an AI — and why it’s never enough
Give me one regex that catches most API keys so I can warn myself before pasting logs into an AI chat.
One regex that catches the common prefixed formats: [code] That covers OpenAI/Anthropic-style sk-…, AWS access keys, GitHub tokens, Slack tokens, Google API keys, Stripe keys and JWTs. Now …