Skip to main content

Overview

At the edge, an agent acting for a verified customer can look the same as any other automated request. Most agent traffic carries no credential at all. Key challenges for edge and bot management teams:
  • Identifying agents acting for verified people
  • Checking that identity before the request reaches the origin
  • Passing a clear result to the origin without making it parse credentials
  • Preventing nonce reuse across every edge location
  • Adding identity to existing bot rules rather than replacing them
KYA lets an agent present proof of the person it represents. The edge worker checks that proof in your own code and passes the result to the origin. Your existing bot rules still decide how to handle traffic without valid KYA proof. What you can learn about an agent, weakest to strongest:

Run it at the edge

Run the credential check in your own Worker. It answers the nonce and token routes, checks credentials as the Credential Format Reference describes, and passes the result to your origin. See Install Options for other ways to add Baselayer. Your site must be in your own Cloudflare account (zone), since hosted site builders can’t run a Worker on your main domain.

What happens to a request

These steps are for agents that carry a KYA credential.
1

The agent asks for access

The edge answers 401 with a step-up that names the keys the credential must prove and the fields the site asks for.
2

The agent gets a nonce

The edge issues a one-time nonce from a store shared across all locations.
3

The agent presents its credential

It sends the credential and its signed proof to the token endpoint.
4

The edge checks the presentation

The worker checks the credential, agent signature, audience, nonce, expiry, revocation status and the requirement. See Order of Checks.
5

The edge passes the result to the origin

It removes any matching headers from the incoming request, then adds trusted headers with the result.
6

The origin decides

It applies its own access and risk rules. It doesn’t need to parse the credential.

What the edge deployment requires

  • Signing keys and revocation lists cached per worker instance
  • One nonce store shared by every location
  • An atomic check-and-spend for nonces
  • Result headers agreed between the edge and origin teams
  • The edge strips those headers from every incoming request before adding its own, so an agent can’t claim it already passed
  • A log-first rollout before the result changes traffic handling

What each component sees

What a refusal means

A credential either passes or fails with a typed reason, such as credential_expired, credential_revoked, audience_mismatch or nonce_replayed. A failure says only that the credential or presentation couldn’t be accepted. The edge or origin decides how to handle the request. Each nonce works once, and each credential works only for the site it was minted for and only with the agent key it was bound to. A credential copied off the wire can’t be replayed. See Handling Failures for every code.
Nonce store
  • A store in one process’s memory works within that process only.
  • Spending a nonce must check and spend it in one atomic step: in Redis, use GETDEL. Workers KV can’t do this, so pick another store.

Next steps