Skip to main content
Sentinel is ClawHQ’s built-in security system. It runs automatically inside the Hermes service and intercepts every message, tool call, and agent output before it reaches your agents or leaves your system. It’s not a plugin or an optional add-on. Sentinel is infrastructure.

Why AI agents need dedicated security

Standard network security wasn’t designed for AI systems. Agents introduce threats that firewalls and WAFs don’t cover:
  • Prompt injection — malicious instructions embedded in web pages, emails, or documents that hijack agent behavior when fetched as tool output
  • System prompt extraction — jailbreak attempts that try to make an agent reveal its instructions
  • Tool chain exfiltration — an agent reads a file and immediately makes an external web request, leaking the contents
  • Indirect injection — an attacker plants instructions in a shared document, Slack message, or API response knowing your agent will eventually read it
  • Privilege escalation — inputs that try to elevate agent permissions beyond what was configured
Sentinel catches all of these.

Architecture

Sentinel runs 6 defense layers in sequence on every request:
Every threat event feeds into the correlation engine. The Shield layer responds automatically based on severity.

Layer 2a: Prompt Guard

The Prompt Guard scans every inbound message and outbound tool output for injection patterns.

Injection signatures

When blocked, the request is rejected with a 403 and logged. When quarantined, the message is flagged and held for review but not delivered.

Tool output scanning

Tool outputs are scanned separately because they’re a primary injection vector. When your agent fetches a webpage or reads a file, the Prompt Guard checks the content before it’s returned to the agent.

System prompt fingerprinting

Sentinel registers a fingerprint of every agent’s system prompt on startup. If an agent’s response contains phrases that match its own system prompt, it’s flagged as a potential leak and blocked. This catches the class of attacks where a user tricks an agent into repeating its instructions back.

Layer 2b: Tool Guard

The Tool Guard intercepts every tool call before it executes.

Dangerous tool chain detection

Certain tool sequences are high-risk even when each individual call looks legitimate. The Tool Guard tracks the last 5 tool calls per session and blocks dangerous combinations:

File access boundaries

Agents are sandboxed to specific filesystem paths. Attempts to access sensitive paths are blocked outright:

Terminal command filtering

Shell commands are checked against a deny list before execution:
  • curl * | bash / wget * | sh — remote code execution
  • rm -rf / — destructive commands
  • nc -l — reverse shell (netcat listener)
  • bash -i >& /dev/tcp/... — bash reverse shell
  • eval $(base64 ...) — encoded payload execution
  • sudo commands — held for human approval

Layer 3: Canary Engine

Canary tokens are fake credentials, URLs, and secrets planted in your agents’ environment. If any of them are ever used or accessed externally, you have confirmed compromise — not a warning, not a heuristic, not a guess.

Token types

What a trigger means

When a canary is triggered:
  • api_key used externally → EMERGENCY — confirmed exfiltration
  • url accessed from unknown IP → CRITICAL — active probing
  • prompt_bait appears in agent output → CRITICAL — system prompt leaked
The Shield layer responds automatically: locks down access, fires alerts to all configured channels, and captures a forensic snapshot of system state at the time of compromise. Canaries rotate automatically after a confirmed trigger.

Layer 4: Decoy Swarm

Three honeypot agents are injected into the ClawHQ agent registry: Legitimate users never interact with these agents. Attackers who probe your system will find them and try to exploit them — generating alerts and wasting their time with synthetic (entirely fake) responses. Any interaction with a decoy agent fires an alert. Sustained probing (3+ interactions with suspicious keywords in a session) escalates to critical.

Layer 6: Shield

The Shield layer handles automated response:

Alert channels

Configure where Shield sends alerts in config/shield.yaml:

Lockdown mode

Lockdown is activated when a canary token is used externally — the only event that indicates confirmed compromise rather than a probe. In lockdown, all non-whitelisted access is blocked and a forensic snapshot of active sessions, agent states, and tool call history is captured. Exiting lockdown requires manual action in the dashboard under Security → Exit Lockdown.

Dashboard

The Security page at /security shows live shield status:
  • Sentinel active/offline indicator
  • Canary token health (by type: healthy vs. triggered)
  • Honeypot agent interaction count
  • Blocked IP count
  • Real-time security event feed with severity color coding
  • Lockdown banner if a canary has been triggered
The page auto-refreshes every 15 seconds.

Configuration

All Sentinel config lives in services/hermes/sentinel/: The defaults are production-ready. Customize allow_paths in sentinel.yaml to match your workspace layout, and add your webhook URLs to shield.yaml.

API endpoints

Sentinel exposes endpoints on the Hermes service (port 4300): These are proxied through the dashboard API at /api/sentinel.

Tool check example

Call this before executing any tool from an agent:

Prompt scan example


Pack vetting

Sentinel’s security posture extends to the pack registry. Every pack uploaded via the admin API is vetted before it is stored — hardcoded secrets, high-risk tools without human-in-the-loop approval, and schema violations are all hard failures that block the upload. Third-party packs (submitted with X-ClawHQ-Pack-Origin: external) face stricter rules: publisher identity is required, external URLs in task prompts are a hard fail (not a warning), and contact information is mandatory for accountability. See Pack security vetting for the full check list and CLI usage.