Skip to content

~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.

docs(security): point scrub guidance at scrub_error() (#5019 follow-up) (#5040)

LearningCircuit1e3fe251d980
diff --git a/.pre-commit-hooks/check-sensitive-logging.py b/.pre-commit-hooks/check-sensitive-logging.py
index 4aae304078..7cbdbd7be6 100755
--- a/.pre-commit-hooks/check-sensitive-logging.py
+++ b/.pre-commit-hooks/check-sensitive-logging.py
@@ -864,7 +864,7 @@ class SensitiveLoggingChecker(ast.NodeVisitor):
f"{self.filename}:{node.lineno}: "
f"Exception variable in logger.exception() — this message is "
f"production-visible at ERROR (secure_logging wrapper) — "
- f"log a scrubbed message (sanitize_error_message/redact_secrets) instead"
+ f"log a scrubbed message (scrub_error(); engines: self._scrub_error()) instead"
)
else:
self.errors.append(
@@ -883,7 +883,7 @@ class SensitiveLoggingChecker(ast.NodeVisitor):
f"{self.filename}:{node.lineno}: "
f"Exception variable in logger.exception() keyword arg — this message is "
f"production-visible at ERROR (secure_logging wrapper) — "
- f"log a scrubbed message (sanitize_error_message/redact_secrets) instead"
+ f"log a scrubbed message (scrub_error(); engines: self._scrub_error()) instead"
)
else:
self.errors.append(
@@ -1150,7 +1150,8 @@ def main():
" - In llm/providers/, embeddings/providers/, web_search_engines/:"
)
print(
- " use sanitize_error_message()/redact_secrets() and log the safe_msg"
+ " use scrub_error() from security.log_sanitizer (engines: "
+ "self._scrub_error()) and log the safe_msg"
)
print(
" - Elsewhere: use logger.exception() (traceback is dev-only) or remove the variable"
diff --git a/.pre-commit-hooks/custom-checks.py b/.pre-commit-hooks/custom-checks.py
index 3b3f56dceb..a0168183d7 100755
--- a/.pre-commit-hooks/custom-checks.py
+++ b/.pre-commit-hooks/custom-checks.py
@@ -146,7 +146,7 @@ class CustomCodeChecker(ast.NodeVisitor):
"logger.exception() message is production-visible at ERROR "
"here (security.secure_logging wrapper; only the traceback "
"is diagnose-gated) — log a scrubbed safe_msg "
- "(sanitize_error_message/redact_secrets) and " + detail
+ "(scrub_error(); engines: self._scrub_error()) and " + detail
)
return (
"logger.exception() automatically includes exception details, "
diff --git a/docs/developing/credential-scrubbing.md b/docs/developing/credential-scrubbing.md
index 2e69d3551b..925d69644a 100644
--- a/docs/developing/credential-scrubbing.md
+++ b/docs/developing/credential-scrubbing.md
@@ -19,7 +19,13 @@ for that, which this repo already runs in pre-commit/CI).
it is scrubbed regardless of shape. This is the real guarantee for
*known* secrets; the regex layer is best-effort for *unknown* ones.
-Always pair them ("dual-scrub") on any path that surfaces secret-adjacent text.
+Always pair them ("dual-scrub") on any path that surfaces secret-adjacent
+text — via **`scrub_error(error, *known_literals)`** (`security.log_sanitizer`),
+which composes both passes plus the defensive guards (a raising `__str__`
+or a non-string secret cannot crash the `except` handler). Engine
+subclasses use `self._scrub_error(error)`, which resolves the engine's
+`_secret_attrs` and delegates to the same helper. Don't hand-inline the
+two calls: per-site copies are how scrub passes drift apart.
## Design constraints (why it is curated, not exhaustive)