Tool Interface
Veto uses a unified tool definition format that works across all providers:Executable Tools
To wrap tools with handlers, use theExecutableTool interface:
Basic Wrapping
The simplest way to add Veto to any framework is withveto.wrap():
How wrap() Works
- Input: Takes an array of tools with
name,inputSchema, andhandler - Validation: For each tool, creates a wrapper around the
handler - Interception: When the handler is called, Veto intercepts with
validateToolCall() - Decision:
- Allow: Original handler executes (with modified args if applicable)
- Deny: Throws
ToolCallDeniedError
- Output: Returns wrapped tools with same interface as input
Provider Adapters
Veto includes adapters for converting between tool formats.OpenAI Adapter
Convert between Veto and OpenAI tool formats:Anthropic Adapter
Google (Gemini) Adapter
MCP Adapter
Generic Adapter
Use the generic adapter interface for consistent conversion:Custom Integration Example
Here’s how to build a custom integration for a hypothetical framework:Usage
Manual Validation
For frameworks that don’t support tool wrapping, validate manually:Standalone Guard Checks
Useveto.guard() for validation outside the tool call flow:
Output Validation
Validate agent output before returning to user:Python Custom Integration
For Python frameworks:Type Safety
Veto preserves TypeScript types through wrapping:Next Steps
Tool Types
Full tool interface documentation
Provider Types
Provider-specific type definitions
Configure Rules
Define validation rules for your tools
Error Handling
Handle validation errors gracefully

