As soon as the model calls a tool, it runs. No built-in approval layer means sensitive operations happen automatically. Database writes, API calls, and external integrations all execute without a control boundary.
Intercept tool execution, evaluate against your policies, and control the outcome. Works with any Vercel AI SDK tool — built-in or custom.
import { Shield } from "@runplane/runplane-sdk";
import { generateText, tool } from "ai";
const runplane = new Shield({
apiKey: process.env.RUNPLANE_API_KEY
});
// Wrap your tool execution with Runplane
const result = await runplane.guard(
"send_email",
"vercel-ai-agent",
{ to: params.to, subject: params.subject },
async () => sendEmail(params)
);
// Or wrap the entire tool definition
const protectedTool = tool({
description: "Send an email",
parameters: z.object({
to: z.string(),
subject: z.string(),
body: z.string()
}),
execute: async (params) => {
return runplane.guard(
"send_email",
"vercel-ai-agent",
params,
() => sendEmail(params)
);
}
});Wrap any AI SDK tool
Policy enforcement before execution
Works with streaming and edge functions
guard() intercepts the action before execution
Policy engine evaluates and returns a decision
Action runs, blocks, or waits for approval
generateTextstreamTextgenerateObjectCustom Tools