Introduction

Continuous personal AI workloads present a fundamental security paradox. Devices like wearable audio recorders, ambient smart glasses, and persistent health sensors continuously capture sensitive personal data, stream it to cloud infrastructure, and rely on server-side large language models (LLMs) or multimodal models to generate real-time insights. From a system design perspective, processing this data off-device requires transferring raw telemetry, transcripts, and embeddings to remote compute nodes. Standard transport-layer security (TLS) protects data in transit, and envelope encryption with Customer Master Keys (CMKs) protects data at rest. However, traditional cloud architectures leave data vulnerable while in memory (data in use). System administrators, cloud operators, process engineers with root access, and malicious actors possessing elevated hypervisor privileges can theoretically inspect instance memory, extract plaintext payloads, or intercept transient decryption keys.

To solve this, Amazon's Bee project introduced an architecture enforcing Zero Operator Access (ZOA). The architectural goal of ZOA is absolute runtime data isolation: even the infrastructure provider operating the physical hardware and hypervisor cannot access user payload data, intermediate embeddings, or model context during execution. Achieving ZOA requires shifting trust from administrative identity and access management (IAM) policies to cryptographic hardware guarantees.

In this article, I analyze the mechanics of how the Bee team realized ZOA by decoupling compute execution from cryptographic attestation. I will dissect the reliance on AWS Nitro Enclaves and AWS NitroTPM, detail the key release and ephemeral derivation protocols, evaluate the concrete performance and operational trade-offs, and provide an implementation pattern for teams building privacy-preserving cloud execution environments.

The Architecture of Zero Operator Access (ZOA)

Traditional cloud hardware security relies on hypervisor-enforced isolation combined with logical role-based access control (RBAC). For continuous personal AI workloads, logical boundaries are insufficient. A hypervisor administrator or compromised host kernel can attach debuggers, dump memory pages, or inject malicious kernel modules into running virtual machines (VMs).

ZOA changes the dynamic by replacing administrator trust with verifiable physical hardware state. The foundation of ZOA rests on three architectural primitives:

  1. Isolated Execution Contexts (Confidential Computing): Stripping virtual instances of external network interfaces, persistent storage, interactive shell access (SSH/SSM), and direct operator access.
  2. Hardware-Rooted Attestation: Generating cryptographic proofs signed by a physical hardware Security Processor that measure the exact state of the hypervisor, kernel, system image, and runtime application.
  3. Attestation-Bound Key Release: Designing Key Management Systems (KMS) that decrypt secrets or release data-encryption keys (DEKs) only when presented with a valid, freshly signed attestation document proving the requesting enclave matches an exact, pre-calculated hash.

By decoupling the compute environment (where workloads execute) from the attestation and key release authority (where trust is granted), the architecture ensures that hardware can boot, request keys, process user data in isolated memory, and discard ephemeral state without exposing data to the host environment.

+-----------------------------------------------------------------------------------+
|                                AWS EC2 Host System                                |
|                                                                                   |
|  +----------------------------------+     +------------------------------------+  |
|  |     Parent EC2 Instance (Untrusted)  |     |   Nitro Enclave (Isolated Context) |  |
|  |  - Host OS / Kernel              |     |  - Custom Minimal Kernel           |  |
|  |  - Enclave CLI & Drivers         |     |  - AI Processing Engine (No SSH)   |  |
|  |  - Proxy Service (Forwarder)     |     |  - Encrypted Memory Space          |  |
|  +----------------------------------+     +------------------------------------+  |
|                 |                                          |                      |
|                 | Local VSOCK Bus                          | Attestation Request  |
|                 +------------------------------------------+                      |
|                                                            |                      |
|  +---------------------------------------------------------v-------------------+  |
|  |                     Nitro Security Chip / AWS NitroTPM                     |  |
|  |  - Signs PCR Measurements (PCR0, PCR1, PCR2, PCR3, PCR8)                     |  |
|  +----------------------------------------------------------------------------+  |
+-----------------------------------------------------------------------------------+
                                                             |
                                                             | Signed Attestation
                                                             v (over HTTPS via Proxy)
+-----------------------------------------------------------------------------------+
|                         Key Management Service (AWS KMS)                          |
|  - Verifies Nitro Root Certificate Chain                                          |
|  - Evaluates KMS Key Policy Constraints (kmshdr:RecipientAttestation:PCR0...)     |
|  - Releases Ephemeral Data Encryption Key (DEK) directly to Enclave Memory         |
+-----------------------------------------------------------------------------------+

In the Bee implementation on AWS, this pattern relies on AWS Nitro Enclaves. A Nitro Enclave is a standalone, isolated compute environment carved out of an EC2 instance. It has no persistent storage, no external networking interfaces (it communicates exclusively with the parent instance over a local virtual socket, or vsock), and no interactive users. Memory assigned to a Nitro Enclave is isolated from the parent instance's kernel and hypervisor using CPU-level memory encryption hardware.

Decoupling Compute and Attestation via NitroTPM and PCRs

To prevent an operator from running an altered enclave image that extracts data, the compute environment must prove its identity before receiving sensitive payload keys. This is accomplished through Platform Configuration Registers (PCRs) managed by the hardware security module (NitroTPM / Nitro Security Chip).

When a Nitro Enclave boots, the Nitro hypervisor measures the components loaded into the enclave and writes these cryptographic digests into specific PCR registers:

  • PCR0: Contains the SHA-384 hash of the enclave image file (EIF), including the kernel, RAM disk, and application binary.
  • PCR1: Contains the SHA-384 hash of the kernel bootstrap OS and setup code.
  • PCR2: Contains the SHA-384 hash of any application configuration loaded at boot.
  • PCR3: Contains the SHA-384 hash of the IAM role assigned to the parent instance.
  • PCR8: Contains the SHA-384 hash of the Enclave Image Signing Certificate (when image signing is enforced).

Decoupling compute from attestation means the compute runtime possesses no static credentials, access tokens, or private keys embedded within its deployment artifact. Instead, compute identity is dynamic and derived strictly from its execution state.

When an enclave requires access to incoming wearable data (for example, raw personal audio streams), it generates a local ephemeral public/private key pair (such as an RSA-4096 or X25519 key pair) entirely within its isolated memory. The enclave then requests an attestation document from the local Nitro Security Chip via a hypervisor call over vsock.

The Nitro Security Chip constructs an attestation document containing:

  1. The current values of PCR0 through PCR8.
  2. A user-defined public key payload (the enclave's newly generated ephemeral public key).
  3. A timestamp and nonce to prevent replay attacks.
  4. A digital signature generated by the AWS Nitro Root Certificate Authority (CA).

This attestation document is sent to AWS KMS or a custom Key Management Authority. Crucially, KMS evaluates the attestation document before authorizing any cryptographic operation.

A policy attached to the KMS Customer Master Key (CMK) enforces strict conditional access based on the attestation measurements:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "AllowDecryptOnlyToAttestedBeeEnclave",
      "Effect": "Allow",
      "Principal": {
        "AWS": "arn:aws:iam::123456789012:role/BeeEnclaveParentRole"
      },
      "Action": [
        "kms:Decrypt",
        "kms:DeriveSharedSecret"
      ],
      "Resource": "*",
      "Condition": {
        "StringEquals": {
          "kms:RecipientAttestation:PCR0": "a1b2c3d4e5f6...[SHA-384 hash of official EIF]...",
          "kms:RecipientAttestation:PCR1": "f6e5d4c3b2a1...[SHA-384 hash of enclave kernel]...",
          "kms:RecipientAttestation:PCR8": "1234567890ab...[SHA-384 hash of signing cert]..."
        }
      }
    }
  ]
}

When KMS validates the request, it verifies the Nitro CA signature on the attestation document, confirms the nonce matches, and validates that PCR0 matches the expected build hash. If an operator has modified the enclave code to log plaintext data or injected a debugging tool, PCR0 changes, KMS rejects the request, and key release fails.

Once verified, KMS encrypts the requested Data Encryption Key (DEK) using the ephemeral public key provided inside the attestation document. KMS returns the ciphertext to the enclave. The enclave decrypts the DEK using its ephemeral private key—which exists solely in enclave RAM and was never transmitted across any bus or network. The compute instance now has the decryption key, but no operator can read it, inspect it, or extract it.

Data Key Release and Ephemeral Derivation Mechanics

For continuous personal AI workloads, receiving individual keys per API call from KMS introduces unviable latencies and prohibitive KMS API costs. The Bee architecture balances zero-access guarantees with high throughput by implementing hierarchical key derivation using HKDF (HMAC-based Extract-and-Expand Key Derivation Function, RFC 5869) combined with short-lived session keys.

The workflow functions across three distinct processing phases:

Phase 1: Ingestion and Envelope Encryption

When a wearable device streams continuous audio or sensor telemetry to the cloud ingestion endpoint, the ingestion tier (running standard untrusted EC2 or Container instances) does not hold decryption keys. It receives data encrypted at the client boundary using an ingestion public key or generates encrypted blobs using standard Envelope Encryption.

The device or ingestion proxy encrypts the payload using a symmetric key ($K_{payload}$), encrypts $K_{payload}$ using a master data key managed by KMS, and persists the encrypted payload to object storage (e.g., S3). At no point during ingestion does readable data touch disk or memory in an unencrypted state.

Phase 2: Attestation and Session Key Decryption

When an enclave worker processes a processing queue batch:

  1. The Enclave boots, initializes an internal state, and generates a transient keypair $(SK_{enclave}, PK_{enclave})$.
  2. The Enclave requests an attestation document from /dev/nitro_enclaves, embedding $PK_{enclave}$ as the public_key field in the hardware request.
  3. The Enclave sends a kms:Decrypt call to KMS, passing the encrypted master data key alongside the hardware-signed attestation document.
  4. KMS validates the signature chain back to the AWS Nitro Root Certificate and matches the PCR values against its policy.
  5. KMS re-encrypts the master data key using $PK_{enclave}$ and returns it to the Enclave via the local vsock proxy.
  6. The Enclave uses $SK_{enclave}$ to decrypt the master data key into memory.

Phase 3: Ephemeral Key Derivation and In-Memory Processing

To process thousands of continuous streams without repeatedly invoking KMS, the enclave uses the decrypted master data key as a Pseudo-Random Key (PRK) within an HKDF pipeline to derive ephemeral sub-keys for individual stream sessions ($K_{stream}$).

$$\text{PRK} = \text{HKDF-Extract}(\text{Salt}, \text{MasterDataKey})$$ $$\text{K}_{stream} = \text{HKDF-Expand}(\text{PRK}, \text{Info} = \text{SessionID} \parallel \text{Timestamp}, \text{Length} = 32)$$

The enclave decrypts incoming streaming chunks using $K_{stream}$, runs local model inference (or passes context to an internal local LLM execution engine), generates summary embeddings or responses, and immediately overwrites the plaintext memory buffers.

Upon completion of the processing window or termination of the enclave instance, $SK_{enclave}$, $K_{master}$, and all derived $K_{stream}$ instances are zeroized in RAM. Because the enclave has no persistent storage, rebooting or terminating the enclave completely destroys the cryptographic material.

Implementation Architecture and Code Pattern

To understand how this operates in practice, consider the implementation pattern below. It demonstrates the interaction inside a Rust-based enclave runtime that initializes a vsock proxy connection, queries the enclave attestation device (/dev/nitro_enclaves), binds an ephemeral public key to the attestation request, and submits the payload to KMS for verified decryption.

use std::fs::File;
use std::os::unix::io::AsRawFd;
use nix::ioctl_readwrite;
use aws_config::BehaviorVersion;
use aws_sdk_kms::types::RecipientInfo;
use aws_sdk_kms::Client as KmsClient;
use ring::rand::SystemRandom;
use ring::signature::{RsaKeyPair, RSA_PKCS1_SHA256};
use serde::{Deserialize, Serialize};

// Standard AWS Nitro Enclave IOCTL definition for attestation
const NITRO_ENCLAVE_MAGIC: u8 = 0xB7;
const NITRO_ENCLAVE_GET_ATTESTATION_DOC: u8 = 0x02;

#[repr(C)]
pub struct EnclaveAttestationReq {
    pub timestamp: u64,
    pub public_key_ptr: *const u8,
    pub public_key_len: u32,
    pub nonce_ptr: *const u8,
    pub nonce_len: u32,
    pub userData_ptr: *const u8,
    pub userData_len: u32,
    pub att_doc_ptr: *mut u8,
    pub att_doc_len: u32,
}

ioctl_readwrite!(
    get_attestation_doc,
    NITRO_ENCLAVE_MAGIC,
    NITRO_ENCLAVE_GET_ATTESTATION_DOC,
    EnclaveAttestationReq
);

pub struct EnclaveDecryptionEngine {
    kms_client: KmsClient,
}

impl EnclaveDecryptionEngine {
    pub async fn new() -> Self {
        let config = aws_config::load_defaults(BehaviorVersion::latest()).await;
        let kms_client = KmsClient::new(&config);
        Self { kms_client }
    }

    /// Requests attestation from hypervisor embedding the ephemeral public key
    pub fn get_attestation_document(
        ephemeral_pub_key: &[u8],
        nonce: &[u8],
    ) -> Result<Vec<u8>, Box<dyn std::error::Error>> {
        let enclave_fd = File::open("/dev/nitro_enclaves")?;
        let mut att_doc_buf = vec![0u8; 8192];

        let mut req = EnclaveAttestationReq {
            timestamp: 0,
            public_key_ptr: ephemeral_pub_key.as_ptr(),
            public_key_len: ephemeral_pub_key.len() as u32,
            nonce_ptr: nonce.as_ptr(),
            nonce_len: nonce.len() as u32,
            userData_ptr: std::ptr::null(),
            userData_len: 0,
            att_doc_ptr: att_doc_buf.as_mut_ptr(),
            att_doc_len: att_doc_buf.len() as u32,
        };

        unsafe {
            get_attestation_doc(enclave_fd.as_raw_fd(), &mut req)?;
        }

        att_doc_buf.truncate(req.att_doc_len as usize);
        Ok(att_doc_buf)
    }

    /// Decrypts ciphertext blob via KMS attestation binding
    pub async fn decrypt_payload_key(
        &self,
        encrypted_dek: &[u8],
        ephemeral_pub_key: &[u8],
        nonce: &[u8],
    ) -> Result<Vec<u8>, Box<dyn std::error::Error>> {
        let attestation_doc = Self::get_attestation_document(ephemeral_pub_key, nonce)?;

        let recipient = RecipientInfo::builder()
            .key_encryption_mechanism(aws_sdk_kms::types::KeyEncryptionMechanism::RsaesOaepSha256)
            .attestation_document(aws_sdk_kms::primitives::Blob::new(attestation_doc))
            .build();

        let response = self
            .kms_client
            .decrypt()
            .ciphertext_blob(aws_sdk_kms::primitives::Blob::new(encrypted_dek))
            .recipient(recipient)
            .send()
            .await?;

        let encrypted_for_enclave = response
            .ciphertext_for_recipient()
            .ok_or("Missing recipient ciphertext from KMS response")?;

        Ok(encrypted_for_enclave.as_ref().to_vec())
    }
}

Operational Performance and Architectural Trade-Offs

Transitioning continuous AI processing workloads to a ZOA Nitro Enclave pattern incurs distinct computational, operational, and financial overheads. Software architects must weigh these constraints against privacy guarantees:

1. Attestation Latency and API Throttling

Fetching an attestation document from the hypervisor (/dev/nitro_enclaves) takes between 10ms and 50ms. Submitting that document to AWS KMS for validation adds network RTT and cryptographic verification overhead (typically 40ms–120ms total). For micro-chunked audio analysis (e.g., 500ms voice frames), calling KMS synchronously per frame is non-viable. The HKDF derivation pattern detailed above mitigates this by reusing session keys, amortizing attestation cost across hours of continuous streaming.

2. Resource Allocation Boundaries

Nitro Enclaves consume fixed vCPU and memory pools subtracted directly from the parent instance. Because enclaves do not support dynamic memory swapping or overcommit, memory sizing must accommodate peak LLM model context and execution state. If a model running inside an enclave triggers an Out-Of-Memory (OOM) fault, the entire enclave crashes and immediately purges all transient state from memory.

3. Observability Deficit

Traditional debugging tools (tcpdump, gdb, strace, APM agents) cannot run inside a production enclave. System logs must be carefully sanitized inside the enclave runtime before being written to the vsock channel to prevent leaking sensitive prompt data or intermediate token representations to host logs.

Explanatory diagram for Decoupling Compute and Attestation: How Amazon's Bee Implemented Zero Operator Access for Wearable AI Workloads

Conclusion

Decoupling compute execution from attestation via hardware-rooted primitives fundamentally shifts cloud security for continuous personal AI workloads. By enforcing Zero Operator Access through AWS Nitro Enclaves, NitroTPM measurements, and attestation-bound KMS release policies, Amazon's Bee project establishes a practical architecture where personal context is processed securely in memory without trusting host operators or administrative identities. Adopting this design ensures privacy guarantees remain enforced by cryptographically verifiable hardware bounds rather than logical policy configuration alone.