Install the published adapters
For application setup, use the published packages. The source examples below are separate local reference code.
npm install @curbi/vercel ai
pip install curbi-langchain
pip install curbi-llamaindexSet up your framework →Curbi / Connectors · local source distribution
Source adapter reference
Each connector is tested against the real framework package with its own fake model. No inference, no network. Install the published adapters from npm or PyPI.
Every snippet on this page is executed in Curbi’s test suite against the pinned framework package, with stand-in models and speakers.
Vercel AI SDK ai@7.0.138
Model middleware: a failing reply is replaced by your approved fallback; streamed output goes through the interceptor, which releases only checked sentences.
import { wrapLanguageModel } from 'ai';
import { curbiMiddleware } from './connectors/src/ai-sdk.mjs';
const model = wrapLanguageModel({ model: yourModel, middleware: curbiMiddleware({ policy, fallback: 'A teammate will confirm that.' }) });LangChain JS @langchain/core@1.2.17
A Runnable you pipe after any chat model or chain. Findings ride along in response_metadata.curbi.
import { curbiGuard } from './connectors/src/langchain.mjs';
const chain = model.pipe(curbiGuard({ policy, fallback: 'A teammate will confirm that.' }));LiveKit Agents (voice) @livekit/agents@1.9.4
Hooks llmNode, the single text source, so speech and the transcript only receive checked sentences; a violation is cut mid-sentence.
import { CurbiAgent } from './connectors/src/livekit.mjs';
const agent = new CurbiAgent({ instructions, llm, tts, curbi: { policy, fallback: 'I need to transfer you to a manager to approve that rate.' } });Stream interceptor no dependencies
Release only checked sentences to TTS; cut before a violation is spoken. ~0.3 ms p50 / ~1 ms p99 per chunk on a typical voice turn (one machine).
import { createStreamChecker } from './stream-check/src/stream.mjs';
const s = createStreamChecker({ policy, fallback });
let step = { release: [], cut: null };
for await (const chunk of modelStream) {
step = s.push(chunk);
step.release.forEach(t => tts.speak(t));
if (step.cut) break;
}
if (!step.cut) { step = s.end(); step.release.forEach(t => tts.speak(t)); } // flush the last sentence
if (step.cut) tts.speak(step.cut.fallback);YOUR NEXT ACTION
Catch one reply. Keep the failure.
Copy this command into a terminal. No signup or key. It sends a synthetic reply and policy to Curbi and returns three findings: action:unrecorded, price:mismatch and forbid:guarantee.
curl -fsS https://api.curbi.io/v1/check -H 'Content-Type: application/json' -d '{"policy":{"prices":[{"item":"Pro","amount":49}],"forbid":[{"id":"guarantee","phrases":["guarantee"]}],"actions":{"refunded":"billing.refund"}},"reply":"Done! I'\''ve refunded you, Pro is just $29, and we guarantee it."}'What next: edit the policy in your sandbox, then export a runnable regression from the MCP console. Connect your framework → · All commands as JSON →
A pass means no configured rule fired. It grants no execution authority or provider-completion proof. public access; production signing is off.