Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

ai-sentinel

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ai-sentinel

OpenClaw plugin for prompt injection detection. Drop-in security scanning that hooks into message, tool call, and tool result lifecycle events using heuristic pattern matching. For the full SDK with ML classification, custom rules, and audit logging, see

latest
npmnpm
Version
0.2.1
Version published
Weekly downloads
35
-40.68%
Maintainers
1
Weekly downloads
 
Created
Source

AI Sentinel — OpenClaw Plugin

Prompt injection detection and security scanning for OpenClaw agents. Scans messages, tool results, and tool parameters in real time using 44 regex-based threat patterns across 8 categories.

Install

openclaw plugins install ai-sentinel

Or via npm directly:

npm install ai-sentinel

Configuration

Add to your ~/.openclaw/openclaw.json:

{
  plugins: {
    entries: {
      "ai-sentinel": {
        enabled: true,
        config: {
          mode: "monitor",           // "monitor" | "enforce"
          threatThreshold: 0.7,      // 0.0–1.0, block above this in enforce mode
          logLevel: "info",          // "debug" | "info" | "warn" | "error"
          allowlist: [],             // session keys to skip scanning
        },
      },
    },
  },
}

Modes

ModeBehavior
monitorLog threats and annotate the transcript, but allow messages through
enforceBlock messages above threatThreshold and return a safety notice

Cloud Reporting (optional)

Connect to AI Sentinel Pro for dashboards, threat intel feeds, and alerting:

{
  config: {
    apiKey: "sk-...",               // or set AI_SENTINEL_API_KEY env var
    apiUrl: "https://api.zetro.ai",
    reportMode: "telemetry",        // "telemetry" | "cloud-scan" | "none"
    reportFilter: "all",            // "all" | "threats-only"
  },
}

Multi-Agent Support

Configure per-agent scanning behavior:

{
  config: {
    agentId: "my-agent",
    excludeAgents: ["internal-bot"],
    agentOverrides: [
      { agentId: "high-risk-agent", mode: "enforce", threatThreshold: 0.5 }
    ],
  },
}

What It Detects

44 patterns across 8 threat categories:

CategoryPatternsExamples
Prompt InjectionPI-001 – PI-006"ignore previous instructions", chat template delimiters
JailbreakJB-001 – JB-010DAN, developer mode, character override, bracket persona, pretend-to-be
Instruction OverrideIO-001 – IO-003"forget everything", "override your safety"
Data ExfiltrationDE-001 – DE-010"repeat words above", "paste your system prompt", code block extraction, SmartGPT
Social EngineeringSE-001 – SE-005False authority claims, fake security audits
Tool AbuseTA-001 – TA-003Code execution injection, pipe-to-shell
Indirect InjectionII-001 – II-005Hidden instructions in documents, zero-width chars

Tool results get an automatic confidence boost (+0.15) since indirect injection is higher-signal in untrusted content.

How It Works

AI Sentinel registers hooks into the OpenClaw plugin lifecycle:

HookPurpose
message_receivedScan inbound user messages before the agent processes them
tool_result_persistScan tool results for indirect prompt injection
before_tool_callInspect tool parameters before execution
before_agent_startInject security awareness into the agent's system prompt

It also registers an ai_sentinel_scan tool that agents can call to manually scan suspicious content.

Bootstrap Hook (standalone)

For an additional layer of defense, install the gateway bootstrap hook which injects security awareness rules into the agent's system prompt at startup:

./scripts/install-bootstrap-hook.sh
openclaw hooks enable ai-sentinel-bootstrap

Development

npm run build          # Compile TypeScript
npm run test           # Run 99 tests (pattern coverage + promptmap corpus + scan engine)
npm run dev            # Watch mode
npm run typecheck      # Type-check without emitting

License

MIT

Keywords

openclaw

FAQs

Package last updated on 14 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts