A self-observing AI agent SDK

Know when your agent starts behaving differently.

DriftWatch traces every tool call and model step as OpenTelemetry, runs a model over that telemetry to detect behavioral drift, and closes the loop with a policy-driven autopilot to notify, pause, rollback, or throttle with a human in the loop for anything destructive.

npm install @driftwatch/sdk ai zodnpm install @ai-sdk/openai   # or any AI SDK provider you already use
import { runAgentTask } from '@driftwatch/sdk';import { openai } from '@ai-sdk/openai';import { tool } from 'ai';import { z } from 'zod';const tools = {  get_repo: tool({    description: 'Get public information about a GitHub repository',    inputSchema: z.object({ owner: z.string(), repo: z.string() }),    execute: async ({ owner, repo }) => {      const res = await fetch(`https://api.github.com/repos/${owner}/${repo}`);      const data = await res.json();      return { stars: data.stargazers_count, language: data.language };    },  }),};const result = await runAgentTask({  prompt: 'How many stars does vercel/next.js have?',  modelClient: openai('gpt-4o-mini'),  tools,});console.log(result.responseText);// → "vercel/next.js has 129,304 stars."// Add bootstrapTelemetry (a one-line preload) to send this to SigNoz.// Full walkthrough: /docs/sdk

The packages

@driftwatch/sdkThe product

Telemetry, drift detection, guardrails, and the full Autopilot orchestration engine. Zero provider SDKs, zero required dependencies.

@driftwatch/autopilotCompanion

Concrete Slack, Telegram, and webhook notifiers, plus inbound-webhook verification. Bring it in only if you use those channels.

@driftwatch/serverReference

A ready-to-run Fastify service built on @driftwatch/sdk and @driftwatch/autopilot - the fastest way to see DriftWatch working.

@driftwatch/consoleReference

The operator web console for the reference server: approvals, drift feed, action log, agent health.