Install
This page assumes your app already uses
ai. The VerifiedX wrapper surface is the same across supported Vercel model providers.Net-new VerifiedX code
The Vercel AI SDK integration surface is the same regardless of whether your model is OpenAI, Anthropic, or another provider.streamText(...), wrap that instead:
ToolLoopAgent, wrap the agent once:
That is the important part. Your existing Vercel AI SDK tool definitions,
onStepFinish, experimental_onToolCallStart, experimental_onToolCallFinish, messages, and provider model wiring stay the same.Your native tool surface is the config. VerifiedX uses your existing tool names, descriptions, schemas, and approval hints as the source of truth for what to preflight.
Provider examples
The VerifiedX wrapper stays the same. Only the provider model import and model call change.Full example
Do not use raw
bindHarness(...) for this path. Keep the native Vercel AI SDK surface and wrap generateText(...), streamText(...), or ToolLoopAgent directly.Composed systems
If this Vercel AI SDK run is part of a larger multi-agent or agent+human workflow, pass upstream context into VerifiedX so the current run has better system and situational awareness before it takes a high-impact action. This is useful when a supervisor agent, parent workflow, or human reviewer already has context that the current run should use before taking action. VerifiedX does not require a fixed schema for this. Pass the upstream context you already have in any JSON-serializable shape.streamText(...) and ToolLoopAgent too.
Upstream context is supporting workflow context from outside the current run. It is not proof that this run already executed any local action.
Supported surfaces
The VerifiedX Vercel adapter currently wraps:generateText(...)streamText(...)ToolLoopAgent.generate(...)ToolLoopAgent.stream(...)
experimental_onToolCallStartexperimental_onToolCallFinishonStepFinishtoolCallstoolResults- UI tool parts from
messages[].parts - Approval-requested and approval-response tool parts
Provider handling
The adapter surface is provider-agnostic. You use the same VerifiedX wrapper no matter which Vercel model you pass in. VerifiedX currently infers provider attribution from model metadata such as:- OpenAI provider values like
openai.responses - Anthropic or Claude provider values like
anthropicorclaude - Bedrock-flavored provider values containing
bedrock
What the adapter already captures
Once attached, VerifiedX keeps the Vercel AI SDK surface intact and captures the native lifecycle around your tool loop. That includes:- Prompt and message context for each top-level invocation
- Fresh VerifiedX run context per top-level invocation
- Native tool-start history from
experimental_onToolCallStart - Native tool-finish and tool-result capture from
experimental_onToolCallFinish - Native step summaries and tool history from
onStepFinish - Vercel UI tool parts in
messages[].parts - Approval-requested and approval-response tool parts
- Approval-capable tools declared with
needsApproval
experimental_onToolCallStart and onStepFinish, VerifiedX deduplicates that history instead of double-counting it.
What gets preflighted
VerifiedX wraps your toolexecute(...) functions directly and infers the protected boundary from the tool name, description, schema shape, and approval hints.
That includes:
- Memory writes such as tools with
namespace,key, andvalue - Record mutations such as customer, CRM, ticket, account, or workflow updates
- Internal updates such as routing, status, config, flags, metadata, and workflow-state changes
- Message sends such as Slack, email, replies, notifications, and other communication tools
lookup_workflow are recorded as internal_retrieval.
If a tool is otherwise ambiguous but marked needsApproval, VerifiedX still treats it as a guarded internal update and records its approval capability in tool metadata.
What to expect at runtime
Protected boundaries can return:allowallow_with_warningreplan_requiredgoal_fail_terminal
ok: false, blocked: true, boundary_outcome, safe_next_steps, and decision_receipt, so your agent can keep moving toward the same goal safely.
Across the tested Vercel AI SDK paths, VerifiedX is exercised to:
- infer OpenAI and Anthropic providers correctly from model configuration
- wrap
generateText(...),streamText(...), andToolLoopAgent - carry native tool-start history into the next boundary preflight
- preserve clean per-invocation run context instead of leaking tool history across separate top-level calls
- record UI approval-request tool parts truthfully
Pricing note
One protected action check equals one real boundary preflight. Taint, event ingest, execution reports, and decision reads are all included at that price. The Free Sandbox includes every language, provider, framework, and adapter. VerifiedX does not replace your orchestrator or human workflow. It returns receipts your system can keep local, route downstream, or pass upstream.For the full raw runtime reference, see the TypeScript SDK.