Home/Integrations/Nanobot
N
+TORK

Nanobot + Tork Network

Secure Your Lightweight AI Agents

Sub-millisecond PII detection that matches Nanobot's performance-first philosophy. Governance without compromise.

<1ms
PII Detection
~2KB
SDK Overhead
50+
PII Patterns
0%
Performance Hit
Quick Start

Add Tork in 3 Steps

1

Install the Tork SDK

Lightweight SDK designed for minimal footprint agents.

npm install @torknetwork/node-sdk
2

Add Tork Middleware

Insert 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' },
});
3

Verify Latency

Confirm sub-millisecond overhead in your pipeline.

const result = await tork.govern('test@email.com');
console.log(`Latency: ${result.processingTimeMs}ms`);
Integration Code

Full Integration Example

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');
Comparison

Without Tork vs. With Tork

Without Tork
With Tork
PII passes through tool calls unfiltered
50+ PII types caught in <1ms
No compliance trail for lightweight agents
Automatic receipt generation per call
Performance overhead from governance layers
Sub-millisecond — designed for speed
No way to verify agent safety
Trust badges prove governance compliance
Manual PII review of agent outputs
Automatic redaction in the pipeline
Trust Badge

Show Users Your Agent is Governed

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>

Ready to Govern Your Nanobot Agents?

Add independent governance in under 5 minutes. Free tier available.

Get Started FreeView Documentation