Sentinel

Safety layer that checks AI agent payments before they settle on Hedera

Sentinel

Created At

ETHGlobal Mumbai

Project Description

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:

  • B1: Intent binding — checks that the payment matches the agent’s declared intent
  • B2: Recipient allowlist — blocks payments to unapproved addresses
  • B3: Exploit-pattern replay — blocks payments matching known unsafe patterns
  • B4: Agent reputation floor
  • B5: Amount anomaly detection
  • B6: Price-match guard — compares the requested payment with a facilitator-configured listed price
  • B7: Spend cap and velocity limit — limits single payments, daily spending, and payment frequency

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.

How it's Made

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:

  1. Resource server: exposes a credits endpoint. When an agent requests it, the server returns HTTP 402 with payment requirements.

  2. Sentinel facilitator: receives the signed payment, verifies the Hedera transaction, checks the payer balance, prevents replay attacks, and runs behavioral safety checks before settlement.

  3. Hedera testnet: settles approved payments and stores audit records on HCS.

The behavioral safety profile includes seven checks:

  • B1 checks that the payment matches the agent’s declared intent.
  • B2 checks that the recipient is allowed.
  • B3 checks the payment against known exploit patterns.
  • B4 checks the agent’s reputation score.
  • B5 checks whether the payment amount is unusual for that agent.
  • B6 compares the requested payment with a facilitator-configured listed price.
  • B7 limits single payments, daily spending, and payment frequency.

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.

background image mobile

Join the mailing list

Get the latest news and updates

Sentinel | ETHGlobal