Skip to content

The agent that grows with you

fix: tighten AgentMail API key regex to avoid false positives

nightqcc885b8b1921
diff --git a/agent/redact.py b/agent/redact.py
index bba13d2882c..153a245dfdd 100644
--- a/agent/redact.py
+++ b/agent/redact.py
@@ -159,7 +159,7 @@ _PREFIX_PATTERNS = [
r"pypi-[A-Za-z0-9_-]{10,}", # PyPI API token
r"dop_v1_[A-Za-z0-9]{10,}", # DigitalOcean PAT
r"doo_v1_[A-Za-z0-9]{10,}", # DigitalOcean OAuth
- r"am_[A-Za-z0-9_-]{10,}", # AgentMail API key
+ r"am_[a-f0-9]{32,}", # AgentMail API key (hex format, 32+ chars)
r"sk_[A-Za-z0-9_]{10,}", # ElevenLabs TTS key (sk_ underscore, not sk- dash)
r"tvly-[A-Za-z0-9]{10,}", # Tavily search API key
r"exa_[A-Za-z0-9]{10,}", # Exa search API key