Principle:42 evey Hermes plugins Sensitive Content Detection
| Knowledge Sources | |
|---|---|
| Domains | Security, Data_Protection, LLM_Delegation |
| Last Updated | 2026-10-29 00:00 GMT |
Overview
A security pattern that screens task content for sensitive data (passwords, API keys, credentials) before allowing model overrides, forcing sensitive content to run only on the trusted active model.
Description
Sensitive Content Detection prevents accidental leakage of secrets to untrusted or user-specified model endpoints. When an agent delegates a task, the goal and context text are scanned against a list of sensitive patterns (password, api key, token, credential, private key, SSH key, certificate, bearer, etc.). If any pattern matches:
- The model override is blocked: the
modelparameter is ignored. - The task runs on the active (trusted) model only.
- The result includes a
sensitive: trueflag and a routing reason explaining why the override was blocked.
This ensures that even if an operator has granted allow_model_override, sensitive data never goes to a user-specified (potentially untrusted) model endpoint. The active model is assumed to be operator-approved and trusted.
Usage
Use this principle when designing LLM delegation systems that allow model overrides. Essential for any system where users can specify which model to use and where the content may contain secrets. The pattern-based detection is fast but not exhaustive — it catches common secret patterns but cannot detect all forms of sensitive data.
Theoretical Basis
The detection uses substring matching against a curated pattern list:
# Abstract pattern (NOT real implementation)
SENSITIVE_PATTERNS = [
"password", "api key", "api_key", "secret key", "token",
"credential", "private key", "confidential", ".env",
"ssh key", "certificate", "auth token", "bearer",
]
def is_sensitive(text: str) -> bool:
t = text.lower()
return any(p in t for p in SENSITIVE_PATTERNS)
The security policy: if sensitive, model = None (force active model). The decision is logged in the routing reason for auditability.
Failed to parse (syntax error): {\displaystyle \text{model\_used} = \begin{cases} \text{None (active)} & \text{if sensitive} \\ \text{user\_specified} & \text{if not sensitive and override allowed} \\ \text{None (active)} & \text{if not sensitive but override not allowed} \end{cases} }