Safety layer that checks AI agent payments before they settle on Hedera
Sentinel is a safety layer for x402 payments on Hedera. It checks whether an AI agent should make a payment before it settles.
A normal x402 facilitator checks that a payment is valid: the signature, amount, asset, recipient, and fee payer are correct. But a valid payment can still be unsafe. An agent may be tricked, pay the wrong recipient, overpay, or get stuck in a spending loop.
Sentinel adds behavioral checks before settlement:
Sentinel also prevents replay attacks and records every approval, block, and replay rejection on an HCS topic.
In the demo, a vanilla facilitator settles the same poisoned payment that Sentinel blocks. The clean payment settles normally. The demo includes HashScan links for both settlements and HCS records for approvals, blocks, and replay rejections.
Hedera is used for testnet settlement, HTS token transfers, HCS audit logging, and HashScan-verifiable transaction history.
Sentinel is built with TypeScript, Node.js, Express, and the Hedera JavaScript SDK. It uses @x402/core and @x402/hedera for the x402 payment flow and Hedera exact-scheme verification.
The system has three main parts:
Resource server: exposes a credits endpoint. When an agent requests it, the server returns HTTP 402 with payment requirements.
Sentinel facilitator: receives the signed payment, verifies the Hedera transaction, checks the payer balance, prevents replay attacks, and runs behavioral safety checks before settlement.
Hedera testnet: settles approved payments and stores audit records on HCS.
The behavioral safety profile includes seven checks:
Every approval, block, and replay rejection is written to an HCS topic. The demo includes a contrast test: the same poisoned payment is sent to a vanilla facilitator and Sentinel. The vanilla facilitator settles it, while Sentinel blocks it before settlement.
The project uses SQLite for replay protection and behavioral history. It uses environment variables for configuration and does not store private keys in the public repository.

