fix(security): extend secret redaction to ElevenLabs, Tavily and Exa API keys#3790
Open
memosr wants to merge 1 commit intoNousResearch:mainfrom
Open
fix(security): extend secret redaction to ElevenLabs, Tavily and Exa API keys#3790memosr wants to merge 1 commit intoNousResearch:mainfrom
memosr wants to merge 1 commit intoNousResearch:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Three provider API keys used by Hermes were leaking in plain text to
logs and tool output because their prefixes were missing from
_PREFIX_PATTERNSinagent/redact.py.ElevenLabs TTS keys start with
sk_(underscore). The existingpattern only covers
sk-(dash). One character difference — completelymissed.
Tavily search keys use a
tvly-prefix. No pattern existed.Exa search keys use an
exa_prefix. No pattern existed.All three providers are actively used by Hermes (TTS, web search).
Running
printenvor any command that dumps environment variables wouldexpose these keys in full.
Related Issue
No existing issue — this is a proactive security fix.
Type of Change
Changes Made
agent/redact.py:r"sk_[A-Za-z0-9_]{10,}"— ElevenLabs TTS keyr"tvly-[A-Za-z0-9]{10,}"— Tavily search API keyr"exa_[A-Za-z0-9]{10,}"— Exa search API keytests/agent/test_redact.py:TestMissingProviderKeysclass with new test casesHow to Test
Checklist