A cookie in a log line is your login: Hermes closes the last two redaction gaps

There is a habit that is very hard to audit afterwards: asking the agent why an endpoint returns 401. You paste a whole curl into the chat — including a raw Cookie header, or an x-api-key one. It works, the problem is solved, and you forget about it.
Days later you are debugging something else, reading gateway.log, a request dump, or your own session export, and that cookie is sitting there in plain text. An attachment on a ticket, a shared drive, one archive sent to a colleague — once is enough. A cookie does not need your password. It is the login.
Hermes has had redaction all along, with security.redact_secrets on by default. But it was missing two shapes, and both share a property: neither looks like a key.
The two gaps: Cookie headers and proxy URLs
Cookies first. The old rules watched for Authorization: Bearer ...-style headers with a scheme word, vendor-prefixed keys (sk- and friends), and assignments like password=. Cookie: and Set-Cookie: were not on the list — they do not resemble a key, and their values carry no prefix. So an entire Cookie: a=1; sid=SECRET line went straight into logs, request dumps and terminal tool output.
Then proxy URLs. Your proxy may look like http://user:pass@host:port. Printing a proxy address at startup is normal, and the old behavior masked the password but kept the username slot intact — syntactically, that is just a username.
In practice, nobody puts a username there. Plenty of tools (Infisical Agent Vault, for one) put a bearer token in the userinfo username position and leave the password slot as a placeholder. Real logs ended up containing lines like:
Proxy detected: http://AGENTTOKEN0a1b2c3d4e5f:***@127.0.0.1:37343
Password masked. Token untouched.
How cookies are handled now
The new rule: if it looks like a cookie header, the whole value becomes ***, and the header name stays.
The covered shapes are more numerous than they sound, because all of them show up in real logs:
- raw header lines:
Cookie: a=1; sid=SECRET curl-Harguments, single-quoted, double-quoted and unquoted- HTTP dump lines, the kind you see after
curl -i - JSON request dumps — handled escape-aware, so masking does not break the JSON
- a header appearing mid-line in a log message
- assignment forms:
cookie=,*_COOKIE=,SESSION_COOKIE=
One detail worth appreciating: a name=value pair must be present before it treats the text as a cookie. So the prose sentence “the cookie: it was stale” is left alone, as are the ?cookie= URL parameter and cookie == comparisons in code.
The same fix added a set of single-value, scheme-less secret headers: x-api-key, x-goog-api-key, api-key, apikey, x-api-token, x-auth-token, x-access-token. These used to leak for a blunt reason — no Bearer, no sk- prefix, nothing in the value itself to recognize.
It also repaired a genuine leak: an intermediate version of the regex stopped at the first space, so Cookie: a=1; sid=SECRET masked a=1; and left sid=SECRET in cleartext. The whole name=value; name=value run is masked now.
Values that are already redaction markers (for example x-api-key: *** see docs) are left as-is, which makes the function idempotent — running it twice never mangles a log.
Proxy URLs: scheme, host, port, nothing else
Proxies take a different route. Rather than masking parts of a value, the address simply is not printed in full: log lines carry http://127.0.0.1:41305 and nothing more. The complete URL still reaches the HTTP client unchanged.
The change lands at every call site that printed a proxy: Telegram’s request builder, Discord’s connect, Matrix initialization, the standalone Telegram sender, and both “missing aiohttp_socks” SOCKS warnings. They now share safe_url_for_log, the helper Slack already used.
There is a subtler entry point too: a malformed proxy URL comes back inside transport exceptions. Think InvalidURL: bob:p%C3%A4ss@... or Invalid port: '<pw>'. Those strings get re-quoted and split, so substring masking cannot cover every shape. Now, whenever a proxy URL holds anything the log-safe rendering would drop, both the log and the chat reply reduce to <ExceptionType> via <scheme://host:port or placeholder> with no traceback. With no proxy configured — or one whose URL is safe to show whole — the full error text is preserved.
What is covered, and where the edges are
The good news first:
security.redact_secretsistrueby default and applies to tool output (terminal echo included) and logs.- Reading
.env-style files masks credential-shaped assignments with a non-reusable«redacted-secret»marker viaread_file,search_files, and a terminalcat/grep— even when the value looks like nothing. - Ordinary source and project config keep only vendor-prefix patterns, so fixtures such as
MAX_TOKENS: 100are never mangled.
The edges matter, because false confidence is worse than none:
- Redaction happens when Hermes emits or records, not retroactively. Log files already on disk are not rewritten.
- It recognizes shapes. A custom credential in a header outside the list, with no vendor prefix and not in
name=valueform, can still slip through. - Files written by third-party programs, output you
teeelsewhere, snippets you paste into another tool — all outside Hermes’ reach. security.redact_secrets: falsestill turns it off. Unless you are developing the redactor itself, there is no reason to.
Two checks you can run today
- Look at the proxy lines in
gateway.log. After these fixes you should seescheme://host:portwith nouser:pass@. - Search your recent session exports or request dumps for
Cookie:. If a long value still follows, that machine predates both fixes.
grep -n "Proxy detected" ~/.hermes/logs/gateway.log
grep -rn "Cookie:" ~/.hermes/logs/ | head
If what you find is a real credential, treat it as leaked: revoke that session, rotate that key. Upgrading does not clean values that are already written.
When you can use this
Both PRs are on main: #151119 (cookies and secret headers) merged November 8, #150958 (proxy URLs) merged November 9. v0.23.0 shipped on November 6, so these changes are not in v0.23.0; they arrive with the next stable release.
Update (2026-11-10): these changes shipped in v0.23.1 (November 9) —
hermes updateis enough. The “not in v0.23.0” statements above are still accurate; v0.23.1 closes the gap.
To reduce exposure today without changing code: stop pasting full curls that carry Cookie: (use an env var or a cookie jar instead), and stop putting tokens in the userinfo of a proxy URL — that is the slot most likely to be written into a log.
Two companion reads on the same theme: the invisible characters in Hermes approval prompts is about a display being poisoned, while this is about a record being too honest; and the API-key and cron-output redaction lanes covers key shapes and outbound surfaces.
The short version
A cookie logs you in without a password, and it used to be written into logs and request dumps verbatim; the “username” slot of a proxy URL is where tools put tokens, and only the password used to be masked. Now cookies are masked whole (along with seven secret header names), and proxy URLs print only scheme, host and port — malformed proxy exceptions included. Both changes are main-only, but it is worth looking through your old logs now, because those files will not clean themselves.