Skip to main content
Veto provides first-class integrations with popular AI frameworks, making it easy to add guardrails to your existing agent workflows without changing your code structure.

Supported Integrations

Veto integrates with the following frameworks and tools:

LangChain

Middleware and callback handlers for LangChain agents and LangGraph

Vercel AI SDK

Language model middleware for generateText and streamText

OpenAI Agents

Input, output, and tool guardrails for OpenAI Agents protocol

browser-use

Controller wrapper for AI browser automation

How Veto Wrapping Works

Veto’s integration approach is designed to be transparent — it preserves your existing tool interfaces and types.

Type Preservation

When you wrap tools with Veto, the types are preserved:
import { Veto } from 'veto-sdk';
import { tool } from '@langchain/core/tools';

const myTools = [
  tool(async (args) => { /* ... */ }, { name: 'search' }),
  tool(async (args) => { /* ... */ }, { name: 'email' }),
];

const veto = await Veto.init();

// wrappedTools has the same type as myTools
const wrappedTools = veto.wrap(myTools);

// Pass to your agent — no type errors, no interface changes
const agent = createAgent({ tools: wrappedTools });

How It Works

  1. Wrap Phase: veto.wrap(tools) creates a thin wrapper around each tool handler
  2. Interception: When the AI calls a tool, Veto intercepts the call before execution
  3. Validation: Arguments are validated against your YAML rules (deterministic + optional LLM)
  4. Decision: Based on the validation result:
    • allow → Original handler executes
    • blockToolCallDeniedError thrown with reason
    • ask → Queued for human approval (Veto Cloud)

Integration Approaches

Veto offers two main approaches for adding guardrails:

1. Generic Wrapping

Use veto.wrap() to wrap any tool array. Works with all frameworks:
const wrappedTools = veto.wrap(myTools);
This is the simplest approach and works with:
  • LangChain tools
  • Vercel AI SDK tools
  • Custom tool objects
  • Any framework that accepts tool arrays

2. Framework Middleware

Use framework-specific middleware for deeper integration:
  • LangChain: createVetoLangChainMiddleware()
  • Vercel AI SDK: createVetoMiddleware()
  • OpenAI Agents: createVetoInputGuardrail(), createVetoToolGuardrails()
  • browser-use: wrapBrowserUse()
Middleware provides framework-specific features like:
  • Streaming support
  • Native error handling
  • Framework-specific callbacks
  • Better integration with framework features

Provider Adapters

Veto includes adapters for converting between tool formats:
import { toOpenAI, fromOpenAI, toAnthropic, fromAnthropic } from 'veto-sdk/providers/adapters';

// Convert Veto tools to provider format
const openAITools = vetoTools.map(toOpenAI);
const anthropicTools = vetoTools.map(toAnthropic);

// Convert provider tools to Veto format
const vetoTool = fromOpenAI(openAITool);
Supported providers:
  • OpenAI (toOpenAI, fromOpenAI)
  • Anthropic (toAnthropic, fromAnthropic)
  • Google (toGoogleTool, fromGoogleFunctionCall)
  • MCP (toMCP, fromMCP)
See Custom Integration Guide for details on using adapters.

Next Steps

Choose Your Framework

Pick an integration guide for your AI framework

Custom Integration

Build a custom integration or wrap your own tools

Configure Rules

Write validation rules for your tools

Tool Interface

Understand the tool definition format

Build docs developers (and LLMs) love