Quick Start
1
Set Environment Variable
Enable tool whitelisting by setting The user requests news and a message; only tools on the allow-list are exposed to the model.
ALLOWED_TOOLS to a comma-separated list of tool names:2
Programmatic Usage
Use the
AllowedToolsFilter class directly for more control:How It Works
The filter operates at tool registration time, intercepting the complete tool registry and returning only whitelisted tools.Configuration Options
AllowedToolsFilter Methods
Common Patterns
Multi-Environment Composition
Combine YouTube, Twilio, and Gmail tool modules while ensuring agents see only canonical tools:CI/CD Strict Mode
Catch typos early by enabling strict mode in pipelines:Backward Compatibility Migration
Existing projects usingHERMES_ONLY_TOOLS continue working:
Best Practices
Use exact registered tool names
Use exact registered tool names
Tool names are case-sensitive and must match exactly as registered in the tool registry. Use
list_tools() to verify available names before whitelisting.Enable strict mode in CI pipelines
Enable strict mode in CI pipelines
Set
CI=true in automated environments to catch typos in ALLOWED_TOOLS that would otherwise be silently ignored in development.Prefer ALLOWED_TOOLS over legacy naming
Prefer ALLOWED_TOOLS over legacy naming
New projects should use
ALLOWED_TOOLS instead of the deprecated HERMES_ONLY_TOOLS. The new name is clearer and future-proof.Combine with BotConfig for layered security
Combine with BotConfig for layered security
Environment-variable whitelisting is global and name-based, while
BotConfig.allowed_tools provides per-bot runtime filtering. Use both for comprehensive tool security.When to Use ALLOWED_TOOLS
Real-World Scenario
User runs an agent in an environment with YouTube, Gmail, and Twilio integrations. Each provides asend_message tool:
- Without ALLOWED_TOOLS: Agent might pick wrong
send_messageimplementation - With ALLOWED_TOOLS: Agent gets deterministic tool set:
search,gmail_send,twilio_sms - User types: “/summarize latest emails and send alerts”
- Agent behavior: Uses
searchfor email summary,gmail_sendfor notifications (not the conflicting tools)
Related
Tool Configuration
Environment variables and tool setup
Security Best Practices
Agent and tool security guidelines

