Full architecture
Full architecture
What Runs in the Enclave
ArkLabsHQ/enclave is the runtime that hosts the operator’s signing inside the enclave. Its image packages the application, the runtime, and their fixed configuration, and it has a measurement, PCR0, that changes whenever any of them changes (image build). A PCR0 therefore identifies exactly which code holds the keys.
What the Enclave Guarantees
The runtime protects its secrets with an AWS KMS key bound to the PCR0. A fresh deployment creates its own secrets by asking KMS for a random 32-byte master seed. Because KMS encrypts the response to an attested enclave key, the deployer, the party that runs the deployment on AWS, never receives the seed in plaintext. From that seed, the runtime derives application secrets and its storage key through HKDF-SHA256. It also derives an ACME account key and creates an independent TLS private key inside the enclave (secret derivation). In a production enclave, the deployer can neither choose nor read these secrets, and the KMS key has no root recovery principal. Because the runtime checks the receipts before it decrypts state, the deployer also cannot swap in secrets it knows. Migrations preserve the same secrets, and restarts restore them from an attested S3 snapshot, where the runtime stores the encrypted seed and TLS key. Before it restores state, the runtime verifies the snapshot’s identity, receipts, and retention protection, and in production the KMS key permits decryption only with attestation for that generation’s PCR0 (state lifecycle). An application can also accept an existing secret, such as a key from an earlier system. In that case the image fixes its expected hash or public key, and the runtime checks that commitment before it accepts the supplied value. This check proves which secret the application uses, but previous holders can still know it (inherited secrets). These guarantees have limits. Attestation confirms which image runs, but it does not prove that the code is safe, and nothing in the enclave can make the operator sign. If the operator stops signing, owners fall back to the exit path.Verify the Enclave
A client must pin the expected PCR0 and verify attestation to confirm that responses come from an enclave that runs the trusted image. Theenclave CLI and the Go client verify the Nitro attestation against the expected PCR0. To try it, replace the URL and PCR0 below with the endpoint and the measurement of the image you trust:
Upgrades
For an upgrade, the new image identifies the version it will replace, and the deployer builds it before requesting access to the existing deployment’s secrets. The deployer then starts the new version alongside the current one. Once the current enclave has verified the new enclave’s attestation, it publishes a record of the proposed upgrade that identifies the new image by its PCR0. Before it can receive the existing secrets, the new version must wait through a cooldown, which starts when the upgrade record is published. Since the current image fixes the cooldown’s duration, the deployer cannot shorten it through runtime settings. During the cooldown, the current enclave reports the proposed image and when the handover becomes possible, and until then the upgrade can still be cancelled (upgrade process). After the cooldown, the current enclave encrypts the secrets for the new image’s measurement. Before accepting them, the new enclave verifies who sent them, the recorded upgrade, and the restrictions on decryption. The cooldown gives third parties time to inspect the proposed image before it can inherit secrets.Migration Records
The current enclave stores each upgrade record in Amazon S3, and a cancellation adds another record. The records preserve proposed migrations and cancellations, but they do not, by themselves, prove that secrets changed hands. In production, S3 Object Lock protects these records for ten years, so even the account’s root user cannot delete protected versions, overwrite them, or shorten their retention during that period. Before it accepts a record, the runtime verifies its attestation and retention protection, and it checks stored versions so that later uploads or delete markers cannot hide retained records (record verification). Check the current migration status through an attestation-verified connection to the enclave, such as the/enclave/v1/info request above.
The
ancestry fields let you audit where the enclave’s secrets came from, because each generation’s receipts name its predecessor. If an ancestor receipt is missing or invalid, the ancestry is marked incomplete. This response reports verified status, not the full migration log, and third parties do not need direct access to S3 to check it.
State and Recovery
The runtime writes no state to local disk. Instead, each generation’s attested S3 snapshot holds its encrypted seed and TLS key, while AWS Systems Manager Parameter Store (SSM) holds configuration, inherited secrets, and migration handoffs. A restart or replica with the same PCR0 verifies its snapshot’s receipts and decrypts that generation’s state. A migration preserves the predecessor’s access to its own state: it keeps its key and ciphertexts, so it can continue to serve or restart. Recovery requires that generation’s image, encrypted state, receipts, and KMS key. The ancestry report describes each ancestor key asexists, pending_deletion, deleted, or unknown, and a pending deletion can be cancelled. Only deleted confirms that KMS can no longer decrypt state with that key. An unknown status or an incomplete ancestry does not prove retirement.
Because a migration preserves the seed, recovering secrecy after the seed has been exposed requires a fresh deployment with a new seed.