CurbiCurbi

CURBI / VERCEL AI SDK

Your model.
An independent check.

Install one versioned adapter. Check completed replies against your policy, keep exact findings, and return an approved fallback when a configured rule fires.

public access · Production signing: off. This is an opt-in text audit in your application. Curbi does not route model or provider traffic, authorize tools or confirm real-world outcomes.

1. Install the reviewed version

Node 22+. Run in an empty folder. First-party tarball, not an npm-registry publication. Exact AI SDK peer; no package install scripts or runtime dependencies.

Copy and run
npm install --ignore-scripts --save-exact ai@7.0.138 https://curbi.io/downloads/curbi-ai-sdk-http-0.1.0-preview.1.tgz

Download manifest, source and SHA256 → · Reviewed source code →

Copy and run
SHA256: 93edf71f33b063a35db75d7a3795e8da94c41379a2032e2297f962b26ef768f6

2. Catch the first wrong price

Download and inspect the example, then run it. It uses a synthetic model and a real public HTTP check. No LLM key, model purchase or payment action.

Copy and run
curl -fSLo curbi-ai-sdk-first-catch.mjs https://curbi.io/downloads/curbi-ai-sdk-first-catch.mjs
node curbi-ai-sdk-first-catch.mjs

Expected: price:mismatch for $99, with the reply replaced by A teammate will confirm that price. The original finding stays in providerMetadata.curbi.

3. Use your model

Copy and run
import {generateText, wrapLanguageModel} from 'ai';
import {curbiMiddleware} from '@curbi/ai-sdk-http';
const checkedModel = wrapLanguageModel({
  model: yourModel,
  middleware: curbiMiddleware({
    url: 'https://api.curbi.io/v1/check',
    policy: {prices: [{item: 'Starter', amount: 49}]},
    fallback: 'A teammate will confirm that price.',
  }),
});
const result = await generateText({model: checkedModel, prompt: 'State the Starter price.'});

Replace yourModel with the provider instance you already use. Your provider may bill for inference. Handle thrown errors without sending the unchecked draft.

What happens on failure?

The fallback is checked before model generation. A failed text check returns that approved fallback; network errors, timeouts, malformed verdicts and invalid spans throw. The policy and model text are snapshotted before the audit.

generateText only. Streaming is rejected before the underlying model stream starts. Tool-call parts are preserved, but this audit grants them no execution authority.

A pass means no configured rule fired. It does not prove that the policy is complete, that supplied records are true, or that a provider action happened. Completed text and the policy are sent to Curbi; use synthetic data for the demo. Privacy notice →

Keep your next catch

Edit the policy in your sandbox → Export the finding as a CI regression →

Other framework examples →

Run a check. Keep the result.

Check a reply Connect your agent →

A pass means no configured rule fired. It grants no execution authority or provider-completion proof.