Redact JSON Web Tokens from text, JSON, and CSV
A JWT is a bearer credential. Anyone holding one can act as the user until it expires, and pasted browser network logs are full of them.
How Redactly detects JSON Web Tokens
- Matched by regex for the three dot-separated Base64URL segments that begin with the eyJ header.
- Runs independently of the model, so a token in a header dump is caught.
- The whole token is replaced, not just the payload segment.
Why redact JSON Web Tokens?
JWTs are self-contained credentials: whoever holds one is authenticated until expiry.
Example request
curl -X POST https://api.bitbanger.in/v1/redact \
-H "X-API-Key: rdct_your_key_here" \
-H "Content-Type: application/json" \
-d '{"text": "Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxMjM0In0.dBjftJeZ4CVPmB92K27uhbUJU1p1r_wW1gFWFOEjXk", "style": "replace"}'
Every hit in the response carries entity, text, start, and end. The offsets index into the text you sent, so you can apply the redactions to your own copy of the document. The full response schema is in the API reference.
Questions
Does Redactly redact JSON Web Tokens automatically?
Yes. Send text to the API and every detected type is redacted, including JSON Web Tokens. To redact only this type, pass the value credential.jwt in the entities filter. No training or configuration is required.
What happens to JSON Web Tokens after redaction?
With style set to replace, each match becomes [credential.jwt] — the entity type in square brackets. Setting style to mask replaces every character with a block character, and remove deletes the span entirely.
Related entity types
- API keysRedact AWS, OpenAI, Anthropic, GitHub, Google, Slack, and Hugging Face API keys from logs and pasted text.
- PasswordsRedact plaintext passwords from configuration dumps, tickets, and transcripts before they are shared.
- Login credentialsRedact username and password pairs from pasted transcripts, config files, and support threads.
Redact JSON Web Tokens in production
Get an API key and send your first request in a minute. Plans start at $24/month.
See pricing