Guardrailed AI Agent Execution

AI agents trade onchain. You approve the big calls.

Small trades run automatically within daily spending limits. Moves at or above $1,000 hold onchain until you approve.

Built with
ENSv2 Identity · ENS Approval Gate · Uniswap V3 · 0G
Illustration of onchain guardrail flow
Sepolia
$250.00 Swap USDC → WETH
Auto-executed
< $1,000 threshold ✓ Settled on Uniswap V3
Threshold Gate ($1,000)
$5,000.00 Swap USDC → WETH
Human approval
≥ $1,000 threshold
● Held onchain · Awaiting ENS Owner Approval
Onchain Verification

Live proof on Sepolia.

Every phase of guardrailed agent execution is recorded on Ethereum Sepolia and 0G. Verified transactions and cryptographic storage receipts from real runs below.

How it works

Four phases, one request.

An agent asks to act. AegisNet checks who it is, builds the route, decides if a human must sign off, then settles it onchain.

  1. Plan (0G Compute)

    The AI agent plans execution parameters inside 0G Private Compute TEEs, verifying liquidity and quotes.

  2. Check (ENSv2 Identity & on-chain limits)

    AegisExecutionManager queries AegisSubnameRegistry on Sepolia to verify the agent's ENSv2 identity, EAC target contract whitelist, and daily spend limits.

  3. Approve (ENS Owner Gate, only above the threshold)

    Trades at or above the threshold hold onchain until authorization arrives from the registered ENS subname owner.

  4. Execute and record (Uniswap + 0G Storage)

    The trade settles atomically on Uniswap V3 via SwapRouter02 and writes an immutable decision audit record to 0G Storage.

request trace
# 1. Plan via 0G Private Compute
POST /api/agent/propose  { "amountUSD": 2500 }
← 0G Req: b9fed931… · 0G Storage Root: 0xc9d554…

# 2. Onchain check on Sepolia
AegisExecutionManager.requestExecution(adapter, data, 2500e18)
← ExecutionRequested  requiresApproval true

# 3. ENS Owner Approval Gate
POST /api/approval/verify  { sessionId }
← relayer signature ✓ (nullifier: 0x3d15…)

# 4. Uniswap V3 swap & 0G storage record
AegisExecutionManager.approveWithRelayer(reqId, nullifier, sig)
← SwapExecuted  SETTLED ON SEPOLIA (USDC → WETH)
Why AegisNet

Autonomy for agents. Control for owners.

Agents with a raw private key can do anything. AegisNet gives each agent a named identity with hard limits, and brings a verified human in exactly when the stakes are high.

Scoped agent identity

Every agent is registered to its operating address with daily spend limits and whitelists owned by you. Revoke it onchain and the agent is immediately deactivated.

AegisSubnameRegistry

Enforced permissions

A whitelist of target contracts and a daily spend limit live onchain. Requests outside them are rejected before they are queued.

isAgentAuthorized()

ENS Owner Approval Gate

Anything at or above the agent's threshold pauses until human authorization arrives from the registered ENS subname owner. Each approval works only once with single-use replay protection.

≥ $1,000 → Owner Gate

0G Compute & Storage

Autonomous trade proposals are planned in 0G Private Compute TEEs, while Merkle-verified JSON decision records are permanently committed to 0G Storage.

0gm-1.0-35b-a3b · Merkle Root

Uniswap V3 execution

Approved trades route directly through Uniswap V3 SwapRouter02 on Sepolia, executing exact-input swaps with strictly configured slippage bounds.

SwapRouter02 · ExactInputSingle

Owner veto

A pending high-value request can be cancelled by the agent's owner at any point before it executes. Nothing moves without the gate clearing.

cancelExecution()
ENSv2Hierarchical Identity & EAC
UniswapV3 SwapRouter02 execution
0G ComputeTEE-attested trade planning
0G StorageDecentralized audit records
Use cases

Three situations, one safety net.

The same agent, three different trades. AegisNet decides, on its own, which ones can run, which need a human, and which get stopped.

Executes < $1,000 threshold

Treasury autopilot

Automated DAO treasury rebalancing within pre-approved daily spend limits.

Outcome Routine small rebalance runs automatically on Uniswap V3 within pre-approved daily spend limits.
Waits for human ≥ $1,000 threshold

Whale-size trade

Large opportunistic position exceeding the configured approval threshold.

Outcome High-value trade pauses onchain until approved by the owner via the ENS Owner Approval Gate.
Blocked Safety boundary

Compromised agent

Rogue or exploited agent attempting an unwhitelisted contract call or limit breach.

Outcome Unauthorized or out-of-whitelist call is rejected onchain before any assets can move.
Live network

Deployed on Sepolia.

Every contract is live and verifiable on Etherscan. This list is loaded from the running backend when it's available.

ContractAddressRole
AegisSubnameRegistry0x6Dbd…49FEENSv2 Subname Registry, EAC whitelists & ENSIP-26 metadata
AegisExecutionManager0x13d7…6fa8Request queue, on-chain limit enforcement & approval gate
AegisUniswapAdapter0x6383…C185Uniswap V3 SwapRouter02 execution adapter
Checking backend… Chain ID 11155111 Uniswap Router 0x3bFA…48E
Developers

Run it locally in minutes.

Hardhat contracts, a TypeScript API and this console, all in one repo.

Quickstart

  1. Test the contractscd contracts npm install npm test
  2. Add keys to backend/.envSEPOLIA_RPC_URL=… PRIVATE_KEY=… RELAYER_PRIVATE_KEY=… ZG_COMPUTE_API_KEY=… ZG_STORAGE_RPC=https://rpc-storage-testnet.0g.ai WORLD_ID_APP_ID=app_…
  3. Start the API and consolecd backend npm install && npm run build npm start # → http://localhost:4000

REST API

Writes are signed by the user's wallet directly on the contracts. The API plans, verifies and indexes.

  • POST
    /api/agent/propose0G Compute plans strategy & returns encoded Uniswap V3 calldata
  • POST
    /api/approval/sessionCreate ENS Owner verification session
  • POST
    /api/approval/verifyValidate owner authorization & return relayer attestation
  • GET
    /api/execution/requestsEvery trade request, indexed from chain events
  • GET
    /api/uniswap/infoUniswap V3 router, adapter, and Sepolia deployment details
  • GET
    /api/zg/proofLatest 0G Compute request ID and 0G Storage Merkle root
  • GET
    /api/healthChain, relayer, 0G compute, storage and indexer status
FAQs

Questions, answered.

Hackathon Scope & Limitations

AegisNet is currently deployed for testing on Ethereum Sepolia (execution manager & Uniswap V3 swaps) and the 0G Galileo testnet (storage & private compute). Approval thresholds and USD exchange rates are configurable via environment variables for live demonstration.

Give your first agent guardrails.

Register an agent, preview its route and run a guarded execution from the console.

Try an execution