Skip to main content

Overview

Sudont enforces a four-node decision architecture called The Diamond. Every transaction an AI agent wants to execute must pass through all four nodes before any value moves on-chain.
          "Intent + Physics + Policy = Verdict"

                  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                  β”‚   THE CONSTITUTION    β”‚  ← Layer 1: THE LAW
                  β”‚   user-defined policy β”‚
                  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              β”‚
               β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
               β”‚                             β”‚
        β”Œβ”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”               β”Œβ”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”
        β”‚ THE CORTEX  β”‚               β”‚  THE CAGE   β”‚  ← Layer 2: THE BODY
        β”‚ intent      β”‚               β”‚  physics    β”‚
        β”‚ extraction  β”‚               β”‚  simulation β”‚
        β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜               β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜
               β”‚                             β”‚
               β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              β”‚
                  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                  β”‚     THE JUDGE         β”‚  ← Layer 3: THE VERDICT
                  β”‚  ALLOW Β· DENY         β”‚
                  β”‚  DIAGNOSE_ONLY        β”‚
                  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
The Diamond is a fan-out / fan-in shape: it fans out from a single policy source (Constitution) into two parallel verification paths (Cortex and Cage), then converges at a single verdict (Judge). No single node can approve or reject alone.
The Judge requires both the Cortex’s intent analysis and the Cage’s simulation results to produce any verdict. When the Judge returns an INTERROGATE verdict, the flow loops back through the Cortex for a structured challenge round. See The Interrogation Protocol.

The Triangle of Truth

The Diamond enforces what we call the Triangle of Truth β€” a transaction is only approved when all three vertices align.

Intent

What the agent claims it wants to do β€” extracted by the Cortex. Deterministic, no LLM.

Physics

What would actually happen on-chain right now β€” computed by the Cage via revm or LiteSVM.

Policy

What the operator has defined as acceptable β€” enforced by the Constitution. JSON/YAML authored.

The Four Layers

Layer 1: The Constitution β€” THE LAW

β€œThe law that governs what is acceptable before a transaction leaves the system.”
Rust crate: sudont-constitutionThe Constitution is the top of the Diamond. It defines rules that every transaction is evaluated against. Operators author policy in JSON or YAML; the Constitution compiles this into an immutable policy object used throughout the hot path.
FieldPurpose
chain_allowlistPermitted chain IDs
protocol_allowlistPermitted protocol identifiers (e.g. uniswap_v3, aerodrome)
target_allowlistPermitted router/contract addresses
token_allowlist / token_denylistPer-token permissions
max_trade_sizeAbsolute size cap in base units
max_slippage_bpsSlippage tolerance in basis points
max_price_impact_bpsPrice impact cap
min_liquidityMinimum pool liquidity threshold
private_route_requiredForce private mempool egress
fail_closedReject any transaction with uncertain state
The PolicySnapshot struct in sudont-types captures the compiled policy at a point in time. All policy decisions are deterministic and auditable.

Layer 2a: The Cortex β€” INTENT

β€œIntent normalization β€” what is the agent actually trying to do?”
Rust crate: sudont-cortexThe Cortex parses raw signed transactions, unsigned tx requests, and typed trade requests, then normalizes them into a CanonicalIntent.
CanonicalIntent
pub struct CanonicalIntent {
    pub vm_type: VmType,       // Evm or Svm β€” routes to the correct Cage
    pub from: Address,
    pub to: Option<Address>,
    pub value: U256,
    pub data: Bytes,
    pub nonce: u64,
    pub gas_limit: u64,
    // Swap-specific (optional)
    pub token_in: Option<Address>,
    pub token_out: Option<Address>,
    pub amount: Option<U256>,
    pub slippage_bps: Option<U256>,
}
The Cortex is deterministic β€” no LLM is in the hot path. Unknown fields are preserved as explicit nulls; the Cortex never hallucinates intent it cannot infer.

Layer 2b: The Cage β€” PHYSICS

β€œDeterministic physics β€” what would actually happen if this transaction executed now?”
Rust crates: sudont-cage (EVM), sudont-cage-svm (SVM)The Cage simulates the exact on-chain execution of the transaction against current state. Both cages implement the SimulationEngine trait:
SimulationEngine Trait
pub trait SimulationEngine: Send + Sync {
    fn simulate(&self, intent: &CanonicalIntent) -> Result<SimOutcome, String>;
}
SimOutcome
pub struct SimOutcome {
    pub success: bool,
    pub exit_reason: String,
    pub logs: Vec<SimLog>,
    pub asset_changes: Vec<AssetChange>,
    pub state_diff: Vec<StateDiff>,
}
This unified interface allows the Judge to work identically regardless of VM type.

Layer 3: The Judge β€” VERDICT

β€œThe verdict engine β€” does intent match physics, and does physics satisfy policy?”
Rust crate: sudont-judgeThe Judge receives the CanonicalIntent from Cortex, the SimOutcome from Cage, and the compiled PolicySnapshot from Constitution, then produces one of three verdicts:
VerdictWhenOutput
APPROVEIntent matches physics, within Constitution limitsEIP-191 signed ExecutionAttestation
BLOCKIntent β‰  physics, or Constitution hard-violatedStable reason code + human-readable headline
INTERROGATEMedium-risk signal detectedLoops back to Cortex for challenge round
Verdict Enum
pub enum Verdict {
    Approved(ExecutionAttestation),
    Rejected(ReasonCode),
    Vetoed(String),
}
Reason codes are stable and machine-readable: SUDONT_SLIPPAGE_EXCEEDED, SUDONT_PRICE_IMPACT_EXCEEDED, SUDONT_POLICY_DENY, SUDONT_UNSUPPORTED_TARGET, SUDONT_UNKNOWN_STATE, SUDONT_INTENT_OUTCOME_MISMATCH.

The Interrogation Loop

When the Judge returns INTERROGATE, the Diamond’s linear flow becomes a loop:
Judge β†’ INTERROGATE β†’ Cortex (challenge) β†’ Agent (self-correct) β†’ Diamond (re-enter) β†’ Judge
The Cortex issues a structured, actionable challenge. The agent self-corrects and resubmits. If the correction satisfies the Constitution, the Judge approves. If not, the block is final. Every challenge round produces an immutable adversarial record.
See The Interrogation Protocol for the complete flow, trigger conditions, and audit schema.