$ INTEGRATIONS
First-class Vercel AI SDK wrapper plus verify() compatibility with any agent framework. Add compliance to any workflow in minutes.
Drop-in agent framework support
First-class Vercel AI SDK wrapper with automatic action logging. LangChain, CrewAI, and AutoGen work directly with verify() and log() — no dedicated wrapper needed.
Vercel AI SDK
First-class middleware for the Vercel AI SDK. Wraps generateText(), streamText(), and generateObject() with automatic digest chain logging, financial tool detection, trust scoring, and compliance checks. One line to add tamper-evident audit trails to every AI operation.
import { openai } from '@ai-sdk/openai';
import { generateText } from 'ai';
import { Kontext, kontextWrapModel } from 'kontext-sdk';
const ctx = Kontext.init({
projectId: 'payment-agent',
environment: 'production',
});
// Wrap your model — every tool call gets logged
const model = kontextWrapModel(openai('gpt-4o'), ctx, {
agentId: 'payment-agent',
});
const result = await generateText({
model,
tools: {
transfer_usdc: {
description: 'Transfer USDC to an address',
parameters: { to: 'string', amount: 'string' },
execute: async ({ to, amount }) => {
return { success: true, hash: '0xabc...' };
},
},
},
prompt: 'Send 500 USDC to 0x1234 for the API invoice',
});
// Export the tamper-evident audit trail
const audit = await ctx.export({ format: 'json' });LangChain
Works with verify() and log() — add compliance logging to any LangChain agent by wrapping tool calls. No dedicated wrapper needed; the core SDK functions work directly in callbacks.
import { Kontext } from 'kontext-sdk';
const ctx = Kontext.init({
projectId: 'langchain-agent',
environment: 'production',
});
// Log each tool call in your LangChain agent
async function onToolCall(toolName, input, output) {
await ctx.log({
action: toolName,
agentId: 'langchain-agent',
details: JSON.stringify(input),
metadata: { output },
});
// If it's a financial action, verify it
if (toolName === 'transfer_usdc') {
const result = await ctx.verify({
txHash: output.hash,
chain: 'base',
amount: input.amount,
token: 'USDC',
from: input.from,
to: input.to,
agentId: 'langchain-agent',
});
console.log('Compliant:', result.compliant);
}
}
// Export tamper-evident audit trail
const audit = await ctx.export({ format: 'json' });CrewAI
Works with verify() and log() — hook into CrewAI's task lifecycle to log task starts, verify completions with trust scoring, and capture errors across your entire crew.
import { Kontext } from 'kontext-sdk';
const ctx = Kontext.init({
projectId: 'crew-project',
environment: 'production',
});
// CrewAI task observer — hooks into task lifecycle
function kontextTaskObserver(ctx) {
return {
onTaskStart: async (task, agent) => {
await ctx.log({
action: 'crew_task_start',
agentId: agent.role,
metadata: {
taskDescription: task.description,
crewId: task.crew_id,
},
});
},
onTaskComplete: async (task, agent, output) => {
await ctx.log({
action: 'crew_task_complete',
agentId: agent.role,
metadata: {
output: output.raw,
tokensUsed: output.token_usage,
},
});
const trust = await ctx.getTrustScore(agent.role);
console.log('Trust score:', trust.score);
},
};
}AutoGen
Works with verify() and log() — intercept multi-agent messages, log exchanges, verify transaction decisions, and block non-compliant actions in real time.
import { Kontext } from 'kontext-sdk';
const ctx = Kontext.init({
projectId: 'autogen-agents',
environment: 'production',
});
// AutoGen message interceptor for multi-agent conversations
function kontextMiddleware(ctx) {
return {
async processMessage(sender, receiver, message) {
await ctx.log({
action: 'autogen_message',
agentId: sender.name,
metadata: {
receiver: receiver.name,
content: message.content?.substring(0, 500),
},
});
// Verify financial decisions
if (message.metadata?.isTransaction) {
const result = await ctx.verify({
txHash: message.metadata.txHash,
chain: 'base',
amount: message.metadata.amount,
token: 'USDC',
from: sender.wallet,
to: receiver.wallet,
agentId: sender.name,
});
if (!result.compliant) {
return { ...message, blocked: true };
}
}
return message;
},
};
}Payment and commerce integrations
Verify and audit agent transactions across stablecoin transfers, traditional payment processors, and micropayment protocols.
USDC / Circle
Native stablecoin compliance support for USDC transfers on Base and Ethereum. Audit trails, trust scoring, and GENIUS Act alignment.
Stripe
Verify agent-initiated Stripe payment intents with trust scoring. Audit IDs embedded in Stripe metadata for full traceability.
x402
HTTP-native micropayment verification middleware. Per-request compliance checks for agent-to-service payment flows.
Protocol integrations
On-chain anchoring and agent-to-agent attestation — cryptographic proof layers built into verify().
On-Chain Anchoring
Anchor your terminal digest to Base via the KontextAnchor contract. Immutable, publicly verifiable proof that compliance checks ran. Read-only verification needs zero dependencies.
A2A Attestation
Exchange compliance proofs between agents via .well-known/kontext.json discovery. Both sides prove they ran checks on the same transaction. Zero dependencies.
Terminal-first compliance
Run compliance operations from the command line or integrate with AI coding assistants via the MCP server.
Kontext CLI
12 commands for compliance operations: check, verify, reason, cert, audit, anchor, attest, sync, session, checkpoint, status, and mcp. Install globally or run via npx.
$ kontext verify --chain base --amount 5000
MCP Server
8 compliance tools exposed via Model Context Protocol for Claude Code, Cursor, and Windsurf. AI coding assistants get compliance verification, audit export, and trust scoring as native tools.
Framework Agnostic
Kontext is a standalone TypeScript SDK with zero framework dependencies. The integrations above are convenience wrappers — you can use ctx.verify() and ctx.log() directly in any agent framework, custom pipeline, or serverless function.
Start building with trust
Add compliance to your agentic workflows in minutes. Open source, TypeScript-first, and ready for production.