Skip to content

Remote Attestation Protocol

Hardware-backed trust verification using Trusted Execution Environments.

Remote Attestation enables machine-verifiable proof that an agent’s identity operations are running in a secure, uncompromised environment. This is the foundation for the long-term goal of moving Identity Sentinel into a TEE.

┌─────────────────────────────────────────────────────────────────┐
│ Remote Attestation Flow │
├─────────────────────────────────────────────────────────────────┤
│ │
│ Attester (TEE) Verifier Relying Party │
│ │ │ │ │
│ │ 1. Generate evidence │ │ │
│ │ (quote/attestation) │ │ │
│ │─────────────────────────▶│ │ │
│ │ │ │ │
│ │ │ 2. Validate evidence │ │
│ │ │ - Cert chain │ │
│ │ │ - Measurements │ │
│ │ │ - Security version │ │
│ │ │ │ │
│ │ │ 3. Issue verdict │ │
│ │ │─────────────────────▶│ │
│ │ │ │ │
│ │ │ 4. Grant access │
│ │◀─────────────────────────────────────────────────│ │
│ │ │ │ │
└─────────────────────────────────────────────────────────────────┘

Intel Software Guard Extensions provides hardware-isolated enclaves.

┌──────────────────────────────────────────┐
│ Application │
│ ┌──────────────────────────────────┐ │
│ │ SGX Enclave │ │
│ │ ┌──────────────────────────┐ │ │
│ │ │ Identity Sentinel Core │ │ │
│ │ │ • Master Key custody │ │ │
│ │ │ • Signing operations │ │ │
│ │ │ • Policy enforcement │ │ │
│ │ └──────────────────────────┘ │ │
│ └──────────────────────────────────┘ │
│ │
│ Untrusted Code (OS, hypervisor) │
└──────────────────────────────────────────┘

Key Properties:

  • CPU encrypts enclave memory
  • OS/hypervisor cannot read enclave data
  • Remote attestation via Intel DCAP

Attestation Flow:

1. Enclave generates REPORT
2. Quoting Enclave creates QUOTE
3. Quote contains:
- MRENCLAVE (code measurement)
- MRSIGNER (signer identity)
- Security version number
- Custom data (nonce, pubkey)
4. Verifier checks against Intel certs

AWS Nitro Enclaves provide isolated compute environments on EC2.

┌────────────────────────────────────────────────────────┐
│ EC2 Instance │
│ ┌────────────────────────────────────────────────┐ │
│ │ Nitro Enclave │ │
│ │ ┌────────────────────────────────────────┐ │ │
│ │ │ Identity Sentinel Service │ │ │
│ │ │ • Key unwrap via KMS attestation │ │ │
│ │ │ • Sign/verify operations │ │ │
│ │ └────────────────────────────────────────┘ │ │
│ └────────────────────────────────────────────────┘ │
│ │ │
│ vsock only │
│ │ │
│ ┌────────────────────────────────────────────────┐ │
│ │ Parent Instance │ │
│ │ • No direct access to enclave memory │ │
│ │ • Communicates via vsock │ │
│ └────────────────────────────────────────────────┘ │
└────────────────────────────────────────────────────────┘

KMS Integration:

// Enclave requests key unwrap with attestation
const attestationDoc = await getAttestationDocument({
publicKey: ephemeralPubKey,
nonce: randomNonce
});
// KMS policy validates attestation
const unwrappedKey = await kms.decrypt({
ciphertext: wrappedMasterKey,
attestationDocument: attestationDoc
});
// Master key now in enclave memory only

Move Identity Sentinel from a local library to a TEE-backed service:

┌─────────────────────────────────────────────────────────────────┐
│ SAP TEE Architecture (Future) │
├─────────────────────────────────────────────────────────────────┤
│ │
│ ┌────────────────────┐ ┌────────────────────┐ │
│ │ Agent Runtime │ RPC │ TEE: Identity │ │
│ │ (untrusted) │─────────▶│ Sentinel Service │ │
│ │ │ │ │ │
│ │ • Planner │ │ • Master Key │ │
│ │ • Tools │ │ • Sign/verify │ │
│ │ • UI │ │ • Policy eval │ │
│ └────────────────────┘ └────────┬───────────┘ │
│ │ │
│ attestation │
│ │ │
│ ▼ │
│ ┌────────────────────┐ │
│ │ Verifier + KMS │ │
│ │ Key Release │ │
│ └────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────┘

Pattern: No Key at Rest

1. Enclave starts with NO secrets
2. Generate ephemeral keypair inside TEE
3. Request attestation document
- Binds ephemeral pubkey to measurement
4. Verifier validates attestation
- Check measurement against allowlist
- Check security version
- Check debug flags
5. Wrap Master Key to ephemeral pubkey
6. Enclave unwraps Master Key
- Key exists only in TEE memory
- Host never sees plaintext

For autonomous agents, attestation should cover the security-critical core:

ComponentInclude in Measurement?Reason
Identity Sentinel✅ YesKey handling, signing
Tool policies✅ YesSecurity boundaries
Build provenance✅ YesSupply chain
LLM weights❌ NoToo dynamic
Prompts❌ NoFrequently changing

Principle: Measure a stable Identity/Policy Kernel, not the entire agent.

1. TEE produces attestation evidence
2. Verifier validates, issues short-lived token
3. Token authorizes:
- Master Key unwrap
- Capability token requests
- Tool access
4. Re-attest periodically for long-running agents
ControlImplementation
FreshnessNonces/timestamps in attestation
Re-attestationPeriodic checks for long runs
RevocationDeny known-bad measurements
Rollback defenseExternal monotonic anchor
Target: Production-ready TEE deployment
Components:
- Nitro Enclave for Identity Sentinel
- KMS attestation-gated key access
- vsock RPC interface
Target: Portable across TEE backends
Components:
- Standardized evidence format
- Plugin architecture for SGX/TDX/SEV
- Unified verification interface
Target: Tool access requires attestation
Components:
- Capability tokens from verified workloads
- Per-tool attestation requirements
- Audit trail of attested operations
ThreatTEE Mitigation
Host OS compromiseEnclave memory isolated
Admin accessCannot read enclave secrets
Memory inspectionHardware encryption
Code tamperingMeasurement verification
LimitationReality
Side channelsPossible (research ongoing)
Physical accessDepends on threat model
Supply chainNeed signed builds
Bugs in enclave codeLogic errors still possible

TEEs are risk-reducing, not magic. They protect key custody and provide attestation, but don’t prevent logical vulnerabilities.

// Inside Nitro Enclave
const { getAttestationDocument } = require('aws-nitro-enclaves-nsm-api');
async function getMasterKey(wrappedKey) {
// Generate ephemeral key for this session
const ephemeralKey = crypto.generateKeyPairSync('x25519');
// Get attestation document binding our pubkey
const attestation = await getAttestationDocument({
publicKey: ephemeralKey.publicKey,
userData: Buffer.from('identity-sentinel-v1')
});
// Request KMS decrypt with attestation
const result = await kmsClient.decrypt({
CiphertextBlob: wrappedKey,
Recipient: {
KeyEncryptionAlgorithm: 'RSAES_OAEP_SHA_256',
AttestationDocument: attestation
}
});
// Unwrap with our ephemeral key
const masterKey = decryptWithEphemeral(
result.Plaintext,
ephemeralKey.privateKey
);
return masterKey; // Only exists in enclave memory
}