Illustration of an AI agent reading a form's components as structured data and asking the user to confirm a change
Illustration by AIUseFlow · credits

Vercel UI SDK Guide: Let an AI Agent Operate Your React Components Safely, Without Screenshots

Also available in Hindi: यह लेख हिंदी में पढ़ें

Vercel's UI SDK is a new open-source TypeScript library, now in public beta, that agents can use and not just write. Its createAgent bridge lets an AI agent read your components' state and call their actions through the component's own API, with no screenshots. It is Apache 2.0, published as vercel-labs/ui, and its APIs may still change.

Step 1: install and add a component

For React (version 19 or later):

npm install @ui-sdk/react @ui-sdk/core
npx skills add vercel-labs/ui --skill ui-sdk

The second command gives your coding agent the docs shipped inside the packages. Adapters also exist for Vue, Svelte, Solid and Web Components. Give each component an accessible name, because the agent finds it by its label:

<Input aria-label="Project name" defaultValue="Apollo" />

Step 2: create the bridge

How an agent changes a UI SDK component: snapshot, act, allow, callback
Based on the UI SDK "Connect an Agent" docs. Illustration, not a screenshot.
import { createAgent } from "@ui-sdk/react/agent"
const agent = createAgent()
const page = agent.snapshot()
await agent.act({ steps: [{ ref: "Project name", action: "setValue", args: ["Atlas"] }] })

snapshot lists components with their label, value and allowed actions. act runs steps in order; if one fails, earlier steps stay applied. query finds choices in a Select or Combobox. agentTools gives you JSON Schemas for these three tools to pass to your model, and registerTools exposes them to a browser agent through WebMCP.

Step 3: ask a person before risky changes

Without an allow callback, the bridge accepts every supported action. Add one:

const agent = createAgent({
  allow: (step) => step.confirm ? window.confirm(step.confirm) : step.action === "setValue",
})

Return true, false or a promise. If nobody answers within 5 minutes, the step fails. Your change callbacks also see details.source === "agent" and can call details.cancel().

Step 4: mark what the agent may see

UI SDK data-agent attributes and what each does
From the UI SDK Permissions docs. Illustration, not a screenshot.

Text from the page can include what users typed, so treat it as data and keep humans approving anything that spends money or deletes things.

Related reading: A2UI 1.0 interactive agent UI, Vercel eve 1.0 first agent, how to build an AI agent and the Vercel tool page.

Sources

FAQ

Is Vercel UI SDK free?

Yes. It is open source under the Apache 2.0 licence. It is a beta, so APIs may change before general availability.

Do I need Vercel hosting?

No. It is a front-end library that runs in your app wherever you host it.

Does it work outside React?

Yes. There are adapters for Vue, Svelte, Solid and Web Components.

How is it different from Radix UI or shadcn/ui?

It works at a lower level, as shared behaviours across frameworks, and adds a built-in bridge for agents.

About the author

Suraj Kumar builds and edits AIUseFlow, a directory of AI tools for vibe coders, agent builders and creators. Guides like this one walk through a practical workflow with cited sources — not a news wire rewrite. How we rank tools.

Get the weekly stack

Rank movers and new AI tools for builders, once a week. Free, no spam, unsubscribe anytime.