What a TEE can actually prove about an AI API router
An AI API router sits in an awkward place. It needs to read a request to select an upstream account, enforce permissions, and calculate usage. That also gives its operator opportunities to change parameters, misuse crede
An AI API router sits in an awkward place. It needs to read a request to select an upstream account, enforce permissions, and calculate usage. That also gives its operator opportunities to change parameters, misuse credentials, or report a different price from the one the client expected.
Publishing the router's source helps people inspect those decisions. It leaves another question unanswered: is that the program handling my request?
I am building TeeRouter, an open-source router that explores this question using trusted execution environments and independently verifiable receipts. This is a case study of its public implementation at commit 5c89b551, rather than an independent audit or verification of a live deployment. The interesting part is how narrow the useful guarantees need to be.
Start with the connection
Suppose a service presents a valid hardware attestation report. If the report is unrelated to the TLS connection carrying your prompts, it tells you very little about where those prompts go. An untrusted frontend could show evidence from a legitimate enclave while processing requests somewhere else.
TeeRouter binds its current TLS certificate and a client-generated challenge into the attestation report. The binding in the channel implementation is:
REPORT_DATA = SHA512(
UTF8("teellm:attested-channel:v1\0")
|| nonce32
|| SHA256(certDER)
)
The nonce gives the verifier a freshness challenge. The certificate digest connects the evidence to the certificate used for TLS. The protocol label separates this purpose from other uses of attestation data.
This only works if the client actually checks that binding and uses the corresponding authenticated connection. Downloading a report, displaying a green badge, and then sending traffic to an unrelated endpoint would discard the useful property.
A hardware signature is only the beginning
An authentic report can still describe a program you should not trust. A verifier needs an independently chosen policy defining which measurements and security state it accepts.
For the TDX path, the project checks certificate chains, revocation and trusted computing base information, measurements, the relevant event sequence, and the report-data binding. The security document makes the independence requirement explicit: evidence supplied by the server cannot also be the sole authority deciding what counts as trustworthy.
There is an operational consequence here. Updating the router is also a trust-policy problem. A client must have a defensible reason to accept the new measured software. Automatically trusting every measurement announced by the service would weaken the point of checking measurements at all.
The application also matters. A correctly attested program with a credential-export endpoint would still export credentials. TEE isolation does not repair bad authorization logic, unsafe dependencies, or mistakes in the approved code. It reduces particular infrastructure trust assumptions under its hardware and software threat model; it does not remove the need for review.
Separate the administrator from the person making a request
A router administrator needs to change balances and permissions. That does not mean the administrator should be able to impersonate a user and spend their balance.
The current user authentication protocol requires a client-owned Ed25519 signature as well as a valid Bearer credential. A user ID is derived from the public key; the signing seed stays with the client.
The signature covers the exact body bytes, method, path and query, relevant headers, a timestamp, a random nonce, and the router's boot ID. Including authorization and routing headers prevents someone from preserving the body while silently changing the account-pool selection or other signed instructions. Including a boot ID makes proofs from an earlier process invalid after a restart.
This is a deliberately limited separation of powers. An administrator can still deny service, change permission settings, or alter externally managed balances. What administrator authority alone cannot do, under the verified implementation, is produce a valid signature for the existing user's key.
Preserve the request, including the expensive details
AI requests carry more financially significant settings than a model name. Cache controls, service tiers, reasoning options, and tool definitions can all affect behavior or cost.
TeeRouter's documented forwarding boundary preserves native generation parameters instead of silently adding its own cache or retention choices. Account egress is explicitly configured, official upstream HTTPS certificates remain checked, and a failed proxy is not supposed to fall back to a direct connection. These are application properties to inspect in the approved version, not properties hardware provides automatically.
There is also a boundary the router cannot cross: the upstream provider still receives the prompt. Attesting an intermediary does not attest the provider's internal inference service, prove which model weights it ran, or establish how it retains requests. A router can preserve a requested parameter; it cannot turn that parameter into independently observed behavior inside another company's infrastructure.
Evidence needs more than one status flag
The project also signs consumption batches. Its standalone verifier distinguishes signature verification, record verification, and TEE verification.
That distinction is useful beyond this project. A mathematically valid signature says that a key signed particular bytes. Hardware evidence and an approved reference policy can establish more about that key's origin. Neither result alone establishes that every request appears in the supplied history or that the latest batch has been disclosed.
For someone assessing a deployment, I would want separate answers to these questions:
- Which software and reference policy did I approve?
- Is this evidence fresh and bound to the connection I am using?
- Which operations remain possible for the administrator?
- Which data and decisions still depend on the upstream provider?
- Which failures can interrupt availability or leave accounting incomplete?
Those answers are more useful than a single βTEE verifiedβ label. The practical value is being able to inspect a specific program, verify a connection to an accepted instance, and understand exactly which remaining promises still require trust.
Writing disclosure: This article was drafted by an AI assistant from the linked public source code and protocol documentation. The account owner maintains TeeRouter.
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.