ResearchAuditingNotary

Introducing Notary: Proving What Code a Cloudflare Worker Is Running

Cloudflare Workers are fast and scale on their own, but nothing lets a third party check what code a Worker is running. Notary pairs a Worker with TEEs so anyone can cryptographically verify the code that is live on a domain.

3 min read

On this page

At Multifactor, a lot of our backend infrastructure is either Cloudflare Workers or trusted execution environments (TEEs, also called secure enclaves). A TEE is special-purpose hardware that keeps the data processed inside it from leaking out, and lets anyone verify exactly what code is running inside through a signed cryptographic proof called attestation.

We use TEEs wherever we can so customers can verify their credentials are safe, even from us. They are also slow, expensive and harder to scale than Cloudflare Workers. So we asked ourselves: can we get the best of both worlds? The speed and scalability of Workers, and the verifiability of TEEs?

The answer is yes, and today we're introducing Notary. Say we have a Worker running at multifactor.surf. With Notary, anyone can ask our enclave for an attestation and verify the code running at that domain. We think this is pretty cool and could be useful in a lot of different applications.

What Cloudflare tells you

Cloudflare’s API reports a lot about a Worker. For any Worker you can ask which Worker serves a given URL, which versions are live and at what share of traffic, and what is in a version: its code*, bindings and settings. Here is what each answer looks like for a Worker of ours.

What Cloudflare’s API tells you

multifactor.surfcustom domainYour Workerserves the domain

Which Worker serves a domain, like multifactor.surf.GET /workers/domains?hostname=multifactor.surf

Your WorkerdeploymentsVersion 7f3c9e21…100% of traffic

Which versions are live, and at what share of traffic: here, one version serves 100%.GET /workers/scripts/{worker_name}/deployments

Version 7f3c9e21…one uploadCode · index.js*Bindings · SESSIONS (KV)Settings · compatibility date

What is in a version: the code*, its bindings and its runtime settings.GET /workers/workers/{worker_name}/versions/7f3c9e21…?include=modules

Illustrative values. Paths sit under api.cloudflare.com/client/v4/accounts/{account_id}.

* What comes back is the compiled bundle, not our source, and compiled output can change from one build to the next. That makes it hard to match to a commit just by rebuilding it.

How Notary works: two TEEs, two proofs

Notary's goal is to prove that a worker at domain <X> is running code <Y>. We can achieve this proof by using a TEE in two places:

  • TEE #1 deploys the Worker. It builds the commit, uploads it and signs a record of exactly what it uploaded.
  • TEE #2 calls Cloudflare's API on demand and checks the worker's state against the signed records from TEE #1.

TEE #1 builds, uploads and signs

The enclave fetches the commit, builds it itself, uploads the result to Cloudflare, reads back the version Cloudflare created, and signs a record tying the commit to that version.

  • Request
  • Response
GitHubcommit C, publicTEE #1: deployWaiting for a commitCloudflareWaiting for an uploadRecord storeWaiting for a recordcommit C

TEE #2 checks what is live

Switch the scenario to see what happens when someone deploys around TEE #1, from a laptop, CI or the Cloudflare dashboard.

  • Request
  • Response
  • Refused
YouWant proof of what is liveTEE #2: observerWaiting for a requestFrom Cloudflarenothing yetFrom record storenothing yetCloudflareLive versionsRecord storeRecords from TEE #1nonce

If the enclave code and the Worker code are open source, anyone can verify by attestation that both enclaves do what we describe, and anyone can check that the commit in the claim is the code they are reading.

What Notary proves, and what it doesn’t

TEE #2's attestation proves:

  • The code live at the domain was built from a specific commit, by TEE #1.
  • No other version of the Worker is live at that domain.
  • The answer is fresh, made when you asked.

It does not prove:

  • That Cloudflare runs the code its API reports. We still trust Cloudflare for that.
  • That the commit is safe. Someone still has to read the code.
  • Anything outside the Worker’s versions, such as values in Cloudflare’s Secrets Store.

Making the Web more Verifiable

We think Notary is extremely powerful. Here are some interesting use cases:

  1. Connecting external KMS to a Worker. Keep an encryption key in a key management service that hands it only to a Worker running a specific commit. If someone deploys different code, the key stays locked.
  2. Shared code, no shared trust. Several companies can use one Worker-based service, such as a fraud-signal exchange between banks. Each member can check that the operator hasn’t swapped in different logic.
  3. Verifiable tool calling. An AI agent verifies the code behind a tool server before it calls it, and sends its credentials only if the code is something it trusts.

We’re planning to open source Notary soon and can't wait to see what you build with it.

We're redefining zero-trust — so you can protect your accounts with confidence.

Identity is your first and last line of defense, and the root cause of most application security breaches. Multifactor's provably secure zero-trust solutions cryptographically guarantee that only authorized users can access sensitive data, turning identity into your greatest asset in the fight against cyber threats. Learn more about our research, or reach out to explore working together.

Related Posts

Mapping the actions behind Amazon’s website

Mapping the actions behind Amazon’s website

2026-09-17

How we approached coverage, request classification, and parallel exploration while building a map of Amazon’s user actions.

Introducing Checkpoint: A Better Way to Share Online Accounts

Introducing Checkpoint: A Better Way to Share Online Accounts

2025-07-07

Checkpoint uses novel cryptographic techniques to enable easy revocable, non-repudiable, and fine-grained sharing of any online account resource.

Lock-In Week: four days, five engineers, and a swarm of coding agents

Lock-In Week: four days, five engineers, and a swarm of coding agents

2026-09-10

We cleared four days, cancelled every meeting, and gave five engineers unlimited agent credits. Volume got cheap immediately. Direction, shared context, integration and verification did not.