Skip to main content

Sentinel SDK

The ABS Sentinel SDK (@abs/sentinel) is the primary way to integrate your AI agents with the ABS Kernel. It handles event logging, policy checkpoints, and heartbeat monitoring.

Installation

npm install @abs/sentinel

Usage

1. Initialization

import { ABS } from "@abs/sentinel";

const abs = new ABS({
  dsn: "https://api.abscore.app", // Or your self-hosted instance
  apiKey: process.env.ABS_TOKEN,
  mode: "runtime", // 'runtime' (active blocking) or 'scanner' (passive logging)
});

2. Logging Events

Log LLM inputs and outputs to create an audit trail.
await abs.log({
  input: "Transfer $500 to Alice",
  output: "Transferring...",
  model: "gpt-4o",
  agent_id: "agent-007",
  risk_level: "medium",
});

3. Policy Checkpoint (Blocking)

Before executing an action, check if it’s allowed.
const verdict = await abs.check({
  intent: "database_write",
  payload: { table: "users", action: "delete" },
});

if (verdict.allowed) {
  // Execute action
} else {
  console.error("Blocked by ABS:", verdict.reason);
}

4. Heartbeat

Start a background heartbeat to prevent “Shadow AI”.
abs.startHeartbeat("agent-007");

Configuration Options

OptionTypeDefaultDescription
dsnstring-URL of the ABS API
apiKeystring-Your ABS Project Token
modestring'scanner''runtime' for enforcement, 'scanner' for logging only
batchSizenumber10Number of events to buffer before sending
flushIntervalMsnumber5000Max time to wait before sending buffer