Works with your entire stack
First-class integrations with leading agent frameworks, payment protocols, and commerce platforms. Add compliance to any workflow in minutes.
Drop-in agent framework support
Automatic action logging and compliance verification for the most popular agent frameworks. Add a callback, observer, or middleware and every agent action flows into your audit trail.
LangChain
Callback handler for automatic action logging. Every LLM call, tool use, and retrieval is captured in your Kontext audit trail with zero extra code.
import { Kontext } from 'kontext-sdk';
import { CallbackHandler } from '@kontext/langchain';
const ctx = new Kontext({ apiKey: process.env.KONTEXT_KEY });
// Automatic logging for every LLM call and tool use
const kontextHandler = new CallbackHandler(ctx, {
logLLMCalls: true,
logToolUse: true,
logRetrieval: true,
});
// Attach to any LangChain chain or agent
const agent = new AgentExecutor({
agent,
tools,
callbacks: [kontextHandler],
});
// Every LLM call, tool invocation, and retrieval
// is automatically logged to your Kontext audit trail
const result = await agent.invoke({
input: 'Transfer 500 USDC to vendor 0x1234',
});
// Query the audit trail
const trail = await ctx.export({
agent: 'langchain-agent',
format: 'json',
});CrewAI
Task observer that hooks into the CrewAI task lifecycle. Log task starts, verify completions with trust scoring, and capture errors across your entire crew.
import { Kontext } from 'kontext-sdk';
const ctx = new Kontext({ apiKey: process.env.KONTEXT_KEY });
// CrewAI task observer -- hooks into task lifecycle
function kontextTaskObserver(ctx) {
return {
onTaskStart: async (task, agent) => {
await ctx.log({
action: 'crew_task_start',
agent: agent.role,
metadata: {
taskDescription: task.description,
expectedOutput: task.expected_output,
crewId: task.crew_id,
},
});
},
onTaskComplete: async (task, agent, output) => {
const result = await ctx.verify({
action: 'crew_task_complete',
agent: agent.role,
metadata: {
taskDescription: task.description,
output: output.raw,
tokensUsed: output.token_usage,
},
});
console.log('Task trust score:', result.trustScore);
},
onTaskError: async (task, agent, error) => {
await ctx.log({
action: 'crew_task_error',
agent: agent.role,
metadata: { error: error.message },
});
},
};
}AutoGen
Message interceptor for multi-agent conversations. Log agent message exchanges, verify transaction decisions, and block non-compliant actions in real time.
import { Kontext } from 'kontext-sdk';
const ctx = new Kontext({ apiKey: process.env.KONTEXT_KEY });
// AutoGen message interceptor for multi-agent conversations
function kontextMiddleware(ctx) {
return {
async processMessage(sender, receiver, message) {
// Log every agent-to-agent message
await ctx.log({
action: 'autogen_message',
agent: sender.name,
metadata: {
receiver: receiver.name,
messageType: message.type,
content: message.content?.substring(0, 500),
},
});
// Verify transaction decisions
if (message.metadata?.isTransaction) {
const result = await ctx.verify({
action: 'autogen_transaction_decision',
amount: message.metadata.amount,
currency: message.metadata.currency,
agent: sender.name,
metadata: {
receiver: receiver.name,
conversationId: message.conversation_id,
reasoning: message.metadata.reasoning,
},
});
if (result.flagged) {
return {
...message,
blocked: true,
reason: 'Kontext compliance check failed',
};
}
}
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 for USDC transfers on Base and Ethereum. Audit trails, trust scoring, and GENIUS Act readiness.
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
Support for emerging agent commerce and cross-chain protocols. Built for the next generation of agentic infrastructure.
Google UCP / A2A
Agent-to-agent commerce verification via Google's Universal Checkout Protocol. Trust scoring for cross-agent transactions.
CCTP
Cross-chain USDC transfer compliance via Circle's Cross-Chain Transfer Protocol. Audit trails spanning source and destination chains.
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.