Agent
TEE Attestation

TEE — AWS Nitro Enclave Attestation

For high-value decisions, Heron's decision logic runs inside an AWS Nitro Enclave — a hardware-isolated environment where not even the host VM can read memory or tamper with execution.

Architecture

┌─ Host VM (EC2 c6a.xlarge) ─────────────────────────────────────────────┐
│  tee_cycle.sh: checks if rebalance is due (free, read-only)            │
│  If yes → builds source tarball → launches enclave                     │
└────────────────────────────┬───────────────────────────────────────────┘

┌─ Nitro Enclave (isolated) ─────────────────────────────────────────────┐
│  Runs the SAME decision logic (swarm, net-edge, plan)                  │
│  Produces: plan_hash, attestation_document (PCR measurements)          │
│  Signs the decision with enclave-held key                              │
└────────────────────────────┬───────────────────────────────────────────┘

┌─ Attestation document ─────────────────────────────────────────────────┐
│  PCR0: enclave image hash (proves which code ran)                      │
│  PCR1: kernel hash                                                     │
│  PCR2: application hash                                                │
│  user_data: plan_hash binding (proves THIS decision came from THAT code)│
│  AWS certificate chain: proves it ran on real Nitro hardware           │
└────────────────────────────┬───────────────────────────────────────────┘

┌─ On-chain submission ──────────────────────────────────────────────────┐
│  Host submits the transaction (enclave cannot access network)          │
│  Attestation stored alongside the decision in history                  │
│  Anyone can verify: code hash + plan_hash + AWS signature              │
└────────────────────────────────────────────────────────────────────────┘

What TEE Proves

ClaimHow
Decision made by exact repo codePCR0 = enclave image hash of the built code
Plan matches on-chain txplan_hash in attestation user_data = submitted tx content
No tampering mid-flightNot even the host operator could alter the decision
Real hardwareAWS certificate chain proves Nitro, not a simulator

PCR Measurements

PCRContents
PCR0Enclave image hash (which binary ran)
PCR1Kernel hash
PCR2Application hash

These are measured at launch and locked — any code change produces different PCRs.

When TEE Runs

TriggerDescription
On depositFirst decision for a new vault
ScheduledEvery 6 hours for active vaults
Max frequency6 launches/day per vault (cost control — each launch ~$1 AWS)
Cooldown1 hour between launches

Verification Flow

Anyone can verify a TEE-attested decision:

  1. Download the attestation document (GET /api/tee/download)
  2. Decode the CBOR/COSE envelope
  3. Walk the X.509 certificate chain to AWS's self-signed Nitro root
  4. Verify the signature
  5. Check PCR0 matches the repo's build hash
  6. Check user_data field contains the expected plan_hash

Server-Side Verification

The backend also provides on-demand verification:

POST /api/tee/verify
→ Parses COSE_Sign1 envelope
→ Walks X.509 chain to AWS Nitro root
→ Verifies signature
→ Cross-checks PCRs + plan_hash binding
→ Returns checklist of what was verified

API

EndpointDescription
GET /api/teeCurrent attestation status and metadata
POST /api/tee/verifyRun cryptographic verification on demand
GET /api/tee/downloadFull attestation document as downloadable JSON

Honest Framing

The current TEE integration is a verified spike run — the enclave was launched, produced a real hardware-signed attestation, and was terminated to stop billing. It is not a continuously-running TEE service. The attestation itself is real hardware-signed proof captured on 2026-07-28.

Roadmap

Migrating TEE attestation from AWS Nitro to GCP Confidential Computing (Confidential VMs with AMD SEV-SNP) to unify infrastructure under a single cloud provider.