What is a HAR sanitizer?
A HAR file is the network log a browser exports from its developer tools. It records every request of a page: URL, headers, cookies, timings and often the full bodies. That makes it the best attachment for a bug report, and also a risky one. A HAR from a logged-in session usually carries session cookies, Authorization headers, API keys in query strings and the passwords you typed into a login form.
This tool takes a HAR and replaces the secret values with [redacted]. Names and structure stay. The Cookie header is still there, the cookie is still called sid, the request is still a POST to the same path with the same status and timings. Only the value is gone, so the person who receives the file can still follow what happened.
It looks in several places: cookies (header and cookie lists), authentication headers, secret URL parameters, passwords inside a URL, secret fields in JSON and form bodies, and tokens recognised by their shape anywhere in the text: JWT, AWS keys, GitHub, Slack, Stripe and Google keys, private key blocks and Bearer or Basic values. You can add your own header, field and parameter names, and extra words such as an email address or a project name. Everything runs in your browser. The file is never uploaded.
One honest limit: no tool can promise to find every secret. A token with an unusual name and no known shape can slip through. The report lists what was changed, and the note under it says it plainly: only what is listed was changed. Read the result before you share it.
How to sanitize a HAR file
- Export the HAR from your browser (Network tab, "Save all as HAR") and open the file in the tool, or paste its JSON into the input box.
- Leave the switches on: cookies, auth headers, secret URL parameters and tokens by shape. Turn one off only if you need that part intact.
- Choose what to do with bodies: "scrub secret fields" (default), "keep" them as they are, or "remove" them completely, which empties every request and response body.
- In "extra names to scrub", list header, parameter or field names specific to your company, such as
x-company-key, internal_id. - In "extra words to replace", list literal text to remove wherever it appears, such as
ana@example.com, Project Falcon. - Read "What was removed". It counts redactions by category and names the headers, parameters and cookies, never their values.
- Search the output for anything that should not leave your machine, then copy or download it. The indent switch gives you pretty or minified JSON.
Examples
A login request
Before, a request to a login endpoint with an API key in the URL:
POST https://api.example.com/v1/login?client=web&api_key=AIzaSyA-1234567890abcdefghijklmnopqrstuv
Authorization: Bearer eyJhbGciOiJIUzI1NiJ9
Cookie: sid=abc123def456; theme=darkAfter:
POST https://api.example.com/v1/login?client=web&api_key=[redacted]
Authorization: Bearer [redacted]
Cookie: sid=[redacted]; theme=[redacted]The scheme Bearer stays, the parameter client=web stays, and so do the cookie names.
JSON bodies
A request body and a response body, before:
{ "email": "ana@example.com", "password": "hunter2", "remember": true }
{ "user": { "id": 7, "name": "Ana" }, "access_token": "at_9f8e7d6c5b4a", "refresh_token": "rt_1a2b3c4d5e6f" }After:
{ "email": "ana@example.com", "password": "[redacted]", "remember": true }
{ "user": { "id": 7, "name": "Ana" }, "access_token": "[redacted]", "refresh_token": "[redacted]" }Only fields whose names look secret are changed. The email stays because it is not a secret field name. To remove it too, add it under "extra words to replace".
A redirect and a password in the URL
https://ana:s3cret@a.test/x?token=abc
https://a.test/cb?code=xyz&state=1becomes:
https://ana:[redacted]@a.test/x?token=[redacted]
https://a.test/cb?code=[redacted]&state=1The Location header and the redirectURL field of the response get the same treatment, so a redirect that carries a code does not leak it.
Common mistakes
- Sharing without reading the result. The report only lists what the tool changed. A secret with an unusual name, or one inside free text, may remain. Search for your own email, domain and customer names.
- Pasting something that is not a HAR. The tool shows "This is JSON but not a HAR" when the JSON has no
logwith anentrieslist. Export the file as HAR, not as a copy of one request. - Broken JSON. A HAR cut off in the middle, or edited by hand, fails to parse. Export it again.
- Turning off tokens by shape and bodies together. Then a JWT inside a body passes through untouched.
- Expecting personal data to disappear. Names, emails and IDs are not secrets by name. Use the extra words for them.
- Forgetting that the sanitized file is not the original. Keep the original private and send only the sanitized copy.
Frequently asked questions
Does the HAR sanitizer upload my file?
No. The file is read and rewritten in your browser, so nothing is sent to a server. That matters here more than for most tools.
Will it find every secret?
No tool can promise that. It covers common names and well-known token formats, and it shows a report of what changed. Review the output before you share it.
Can I still debug with the sanitized file?
Yes. URLs, methods, status codes, header names, timings and body structure are kept. Only secret values become [redacted].
How do I inspect or search the result?
Use the JSON formatter to read it, or the JSONPath tester to pull out specific requests. To replay a request, try cURL to code.