Secure Your Lightweight AI Agents
Sub-millisecond PII detection that matches Nanobot's performance-first philosophy. Governance without compromise.
Lightweight SDK designed for minimal footprint agents.
npm install @torknetwork/node-sdkInsert Tork into Nanobot's tool pipeline as middleware.
import { TorkClient } from '@torknetwork/node-sdk';
const tork = new TorkClient({
apiKey: process.env.TORK_API_KEY,
config: { mode: 'redact' },
});Confirm sub-millisecond overhead in your pipeline.
const result = await tork.govern('test@email.com');
console.log(`Latency: ${result.processingTimeMs}ms`);import { Nanobot } from 'nanobot';
import { TorkClient } from '@torknetwork/node-sdk';
const tork = new TorkClient({
apiKey: process.env.TORK_API_KEY,
config: {
redactPii: true,
generateReceipts: true,
},
});
// Create a Nanobot agent with Tork middleware
const bot = new Nanobot({
name: 'fast-agent',
tools: ['web-search', 'file-read'],
});
// Add governance middleware to the tool pipeline
bot.use(async (ctx, next) => {
// Govern input before tool execution
const input = await tork.govern(ctx.input);
ctx.input = input.governedText;
// Execute the tool
await next();
// Govern output before returning to user
const output = await tork.govern(ctx.output);
ctx.output = output.governedText;
// Log receipt for compliance
if (output.receiptId) {
console.log(`Receipt: ${output.receiptId}`);
}
});
// Run — governance adds <1ms to each tool call
await bot.run('Find information about John Smith at john@example.com');Embed a verifiable trust badge to prove your agent passes Tork governance checks.
<!-- Nanobot Trust Badge -->
<a href="https://tork.network/badge/YOUR_BADGE_ID">
<img
src="https://tork.network/api/v1/badge/svg/YOUR_BADGE_ID"
alt="Tork Governed — Nanobot"
/>
</a>Add independent governance in under 5 minutes. Free tier available.