diff --git a/src/timmy/thinking.py b/src/timmy/thinking.py index 6bab20c..cfb1db3 100644 --- a/src/timmy/thinking.py +++ b/src/timmy/thinking.py @@ -39,19 +39,21 @@ _DEFAULT_DB = Path("data/thoughts.db") # qwen3 and other reasoning models wrap chain-of-thought in tags _THINK_TAG_RE = re.compile(r".*?\s*", re.DOTALL) -# Sensitive patterns that must never be stored as facts -_SENSITIVE_PATTERNS = [ - "token", - "password", - "secret", - "api_key", - "apikey", - "credential", - ".config/", - "/token", - "access_token", - "private_key", - "ssh_key", +# Sensitive patterns that must never be stored as facts. +# Uses compiled regexes with word boundaries so that compound technical +# terms like "max_tokens" or "num_tokens" are NOT falsely flagged. +_SENSITIVE_RE = [ + re.compile(r"(?