$ INTEGRATIONS

First-class Vercel AI SDK wrapper plus verify() compatibility with any agent framework. Add compliance to any workflow in minutes.

Agent Frameworks

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.

SDK Wrapper

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.

vercel-ai-integration.ts
typescript
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' });
Works with verify()

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.

langchain-integration.ts
typescript
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' });
Works with verify()

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.

crewai-integration.ts
typescript
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);
    },
  };
}
Works with verify()

AutoGen

Works with verify() and log() — intercept multi-agent messages, log exchanges, verify transaction decisions, and block non-compliant actions in real time.

autogen-integration.ts
typescript
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 & Commerce

Payment and commerce integrations

Verify and audit agent transactions across stablecoin transfers, traditional payment processors, and micropayment protocols.

Available

USDC / Circle

Native stablecoin compliance support for USDC transfers on Base and Ethereum. Audit trails, trust scoring, and GENIUS Act alignment.

Available

Stripe

Verify agent-initiated Stripe payment intents with trust scoring. Audit IDs embedded in Stripe metadata for full traceability.

Available

x402

HTTP-native micropayment verification middleware. Per-request compliance checks for agent-to-service payment flows.

Protocols

Protocol integrations

On-chain anchoring and agent-to-agent attestation — cryptographic proof layers built into verify().

Available

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.

Available

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.

CLI & DevOps

Terminal-first compliance

Run compliance operations from the command line or integrate with AI coding assistants via the MCP server.

Available

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.

$ npm install -g @kontext-sdk/cli
$ kontext verify --chain base --amount 5000
Available

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.

$ kontext mcp

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.