AWS Builder Center
A Verifiable Execution Environment for AI Agents: Check the Receipt

A Verifiable Execution Environment for AI Agents: Check the Receipt

TrustGate is a verifiable execution environment for AI agents. Agents run approved code inside an AWS Nitro Enclave and get back a signed proof receipt that anyone can check, so you do not have to just trust the output. Here is why we built it, how it works, and what it does not promise.

Jalahalli Bengaluru

The problem

AI agents are starting to do real work. They read files, run code, and give us answers. But when an agent says "I ran this code on this data and here is the result," how do we know it is true?
Right now, we mostly just believe it. The agent could have run the wrong code. The machine could have been changed. Someone in the middle could have swapped the input. We would not be able to tell.
The gap is not only the output. It is also the place where the code ran. If we cannot check that place, we cannot check the answer.
We built TrustGate to fix this. The idea is simple: do not ask people to trust the result. Give them proof of what happened.

What TrustGate does

TrustGate is a verifiable execution environment for AI agents. It is a small service. An agent sends it a job. The job is a WebAssembly program that has been approved ahead of time, plus some input.
TrustGate runs the program inside an AWS Nitro Enclave. This is a locked-down space on an AWS machine. Even the machine that hosts it cannot look inside. The program also runs with no extra powers unless we grant them, and with limits on how much it can use.
When the job is done, the agent gets two things:
  1. The result.
  1. A signed receipt.
The receipt says which code ran, on which input, and in which environment. It is signed with a key that is tied to the enclave itself.

Why an execution environment

Most tools for agents check what goes in and what comes out. TrustGate also checks where the work happened.
The environment has three parts:
  • Isolated. The program runs inside the enclave, and the host machine cannot look inside it.
  • Measured. The enclave image has a fingerprint. If the image changes, even a little, the fingerprint changes.
  • Attested. AWS signs a statement that says which image is running inside a real Nitro Enclave.
A receipt is the proof that a given job ran in this environment. The environment gives you a place you can check, and the receipt gives you the evidence.

How the proof works

The enclave can produce an attestation document. This is a message signed by AWS that says, "This exact software image is running inside a real Nitro Enclave." The image has a fingerprint, called a measurement.
TrustGate ties its signing key to this document. So when you look at a receipt, you can check four things:
  • The signature matches the receipt, so nobody edited it.
  • The attestation document is real, and it chains back to the AWS root certificate.
  • The signing key is the one named in the attestation.
  • The enclave fingerprint is the one you expected.
If any one of these fails, the receipt is rejected. We tested this on real Nitro hardware. Edited receipts, changed inputs, and wrong fingerprints all failed, as they should.

Checking from somewhere else

A server that checks its own receipts is a bit like a student who grades their own exam. So we also built a separate verifier that runs as an AWS Lambda function. It does the same checks, but from outside. There is a simple web page in front of it. You paste in a receipt and the fingerprint you expect, and it shows a tick or a cross for each check.
For jobs that always give the same output for the same input, you can also replay them. You run the same program on your own machine and compare the results.

Keeping data private

Some data is too sensitive to hand to anyone. For this, TrustGate has confidential jobs.
The data owner locks the input with a fresh key. That key is wrapped by AWS KMS. The lock is tied to one exact job: one program, one set of arguments, and one key that may read the result.
Only the attested enclave can open it. AWS KMS gives the secret to the enclave only if the enclave has the exact fingerprint we expect. Our own tests showed that the host machine's credentials were refused, and so was a modified image.
The result then goes back locked to the owner's key. We captured network traffic on the host machine during a locked job. It held none of the data or results. The same job without the lock did leak them, which shows the test can see the difference.

What it does not promise

This part matters most, so we want to be direct.
TrustGate proves what code ran, on which input, and in which environment. It does not prove that the result is correct. If an approved program has a bug, the receipt will still be valid. The receipt tells you what happened, not whether it was a good idea.
AWS Nitro is still the root of trust. This is verifiable execution, which means you can check it. It does not remove trust completely.
There are also things we have not finished:
  • We have not yet confirmed that rebuilding the enclave image from the same source always gives the same fingerprint. Until we do, each rebuild means updating the key policy.
  • The connection to the agent endpoint uses plain HTTP for now.
  • The host machine can still see metadata, like timing and sizes. It can also delay or drop jobs.

Try it

Agents talk to TrustGate through MCP, so any MCP client can use it. The project also includes a sample agent built with Strands and Amazon Bedrock.
You can run the whole flow on your own laptop with a development mode. In that mode there is no hardware isolation, so the verifier rejects those receipts by default.

Final thought

As agents get more power, "trust me" will not be enough. We think the answer is not blind trust or blocking agents completely. It is to let them work and to give everyone a way to check. A verifiable place to run, plus a receipt to prove it, is a small step in that direction.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article