Documentation

Complete technical documentation for the Sentinel AI agent network. Learn how to integrate, deploy, and leverage verifiable AI for cross-chain DeFi security.

Overview

What is Sentinel?

Sentinel is a decentralized security infrastructure that uses verifiable AI agents running inside Trusted Execution Environments (TEEs) to protect DeFi liquidity from MEV attacks and oracle manipulation across multiple chains.

The system continuously monitors cross-chain mempools, liquidity pools, and oracle prices, correlates weak signals into high-confidence threats using an on-chain/off-chain Risk Engine, and autonomously executes defensive actions using Uniswap v4 hooks.

Key Features

  • Cross-chain monitoring and protection
  • Adaptive risk modeling with ML
  • Autonomous agent execution
  • Verifiable compute guarantees via TEE
  • Protocol-native enforcement (Uniswap v4 hooks)

Problems Solved

  • Cross-chain MEV attacks
  • Oracle manipulation via flash loans
  • Unverifiable AI agent execution
  • Reactive and static security measures
  • Centralized and opaque defenses

Architecture

Agent System

Sentinel uses a strictly separated multi-agent system where each agent has a specific role and responsibility.

Scout Agent

Signal Generator

  • Monitors mempools across multiple chains
  • Detects flash loans, gas spikes, large swaps
  • Tracks price movements and clustering
  • Emits weak, fast signals (no decisions)

Validator Agent

Truth Verifier

  • Validates oracle prices (Chainlink, Pyth)
  • Checks DEX spot prices and TWAP
  • Verifies cross-chain consistency
  • Emits high-value threat alerts

Risk Engine

Decision Brain

  • Correlates Scout + Validator signals
  • Adaptive thresholds using EMA
  • Computes composite risk scores
  • Maps threats to defense actions

Executor Agent

Deterministic Actor

  • Listens to Risk Engine decisions only
  • Executes instructed defenses
  • Activates hook logic with TTL
  • Uses LI.FI for cross-chain execution

Trusted Execution Environment

All agents run inside TEEs (Phala / Oasis / EigenCompute) to ensure verifiable and secure execution.

Properties

  • Deterministic code hash
  • Private keys sealed inside enclave
  • Remote attestation proves integrity
  • No external key exposure

Outputs

  • Signed transactions
  • Execution logs
  • Attestation proofs

Uniswap v4 Hook Architecture

Sentinel uses a single composite hook contract per pool with multiple protection mechanisms.

1.

Circuit Breaker

Highest Priority

Temporary pool pause during critical threats

2.

Oracle Validation

Medium Priority

Multi-oracle price verification before swap execution

3.

Anti-Sandwich Protection

Dynamic

Dynamic fee escalation during detected MEV activity

Integration Guide

Yellow Network Integration

Sentinel uses Yellow SDK (Nitrolite) to create Protection Sessions for fast, off-chain agent coordination.

Session Lifecycle

  1. 1.
    Session Start (On-Chain)

    Protocol or LP opens Protection Session, deposits funds into Yellow contracts

  2. 2.
    Off-Chain Protection Loop

    Agents emit signals, verify threats, and authorize actions without mempool exposure

  3. 3.
    Session End (On-Chain Settlement)

    Final balances settled, rewards distributed, protection logs committed

LI.FI Cross-Chain Execution

Executor agents use LI.FI for seamless cross-chain defensive actions when liquidity migrates between chains.

Monitor

Detect threats across chains

Decide

Risk Engine computes action

Act

Execute via LI.FI bridge

End-to-End Flow

1Agents boot inside TEEs and generate attestations
2Agents register identities via AgentRegistry
3Scout emits raw signals from mempool monitoring
4Validator emits threat alerts from oracle checks
5Risk Engine correlates signals and computes threat tier
6Risk Engine emits RiskDecision if action required
7Executor executes the instructed defense action
8Hooks enforce protection at pool level
9Cross-chain execution via LI.FI if needed
10Yellow session settles on-chain with rewards
11UI displays attack → response → outcome

Smart Contracts

SentinelHook.sol

The main Uniswap v4 hook contract implementing all protection mechanisms.

// Core Hook Functions
function beforeSwap(...) external returns (bytes4)
→ Enforces circuit breaker, oracle validation, and anti-sandwich
// Agent Control
function activateCircuitBreaker(...) external onlyExecutor
→ Temporarily pauses pool trading
// Configuration
function updateRiskParameters(...) external onlyGovernance
→ Updates thresholds and protection settings

Security & Verifiability

Verifiable Execution

  • All agents run inside TEEs
  • Remote attestation proves correct code
  • No private mempools required
  • Optional on-chain decision commitment

Non-Custodial

  • No fund custody by agents
  • Protection actions are permissioned
  • Governance can revoke agent access
  • Transparent audit trail

Ready to Get Started?

Join the next generation of DeFi security with verifiable AI agents protecting your liquidity 24/7.