Heuristic:42 evey Hermes plugins Sensitive Content Routing
| Knowledge Sources | |
|---|---|
| Domains | Security, LLM_Delegation, Privacy |
| Last Updated | 2026-10-29 00:00 GMT |
Overview
Detect sensitive content (passwords, API keys, tokens) in delegation prompts and force them to the user's active model, never allowing a model override that could send secrets to a third-party provider.
Description
The delegate-with-model plugin checks every delegation request against a list of 15 sensitive patterns (password, api key, token, credential, private key, .env, ssh key, certificate, bearer, etc.) before routing. If sensitive content is detected, the model argument is forced to None — the request runs on the user's active model (which may be a local model) regardless of what the caller requested. The routing reason is set to "SENSITIVE content detected — active model only, no override" and the response includes "sensitive": true.
This prevents a scenario where an agent delegates a task containing a password or API key to a third-party model like GPT-4 or Claude, which would expose the secret to an external API.
Usage
Use this heuristic whenever building an LLM delegation tool that supports model overrides. Always scan the prompt for sensitive patterns before honoring a model override request.
The Insight (Rule of Thumb)
- Action: Before honoring a
modeloverride, scanf"{goal} {context}"for sensitive patterns. If found, setuse_model = None. - Value: 15 sensitive patterns:
password,api key,api_key,secret key,secret_key,token,credential,private key,confidential,.env,ssh key,certificate,auth token,bearer,my password,my credentials. - Trade-off: False positives are possible — a prompt about "password security best practices" would be forced to the active model. This is acceptable: better to over-protect than leak secrets.
- Compatibility: Works with any model provider. The check is case-insensitive substring matching, so it catches
"PASSWORD","Password", etc.
Reasoning
Model overrides let the agent choose a specific model for a task — but that model might be a third-party API (OpenAI, Anthropic) that logs or retains inputs. If the delegation prompt contains a secret (e.g., "Check if this API key is valid: sk-abc123"), the secret would be sent to the external provider.
The sensitive content check is a defense-in-depth measure. It doesn't replace proper secret management (environment variables, vaults), but it catches cases where the agent inadvertently includes secrets in a delegation prompt. The check runs before the ctx.llm.complete() call, so the secret never leaves the active model's context.