G2 Tab invalidation channel
The channel is the device cookie itself; noBroadcastChannel, storage event
or push is used. A switch commits a new device generation and returns the new
cookie, which every tab of that browser shares. The next request from a tab
still rendered for the previous account carries that account’s
expectedSessionId, which no longer equals activeSid, so the device returns
account_mismatch and no data or credential of the new account. The adapter
answers with a full reload of the current route, which renders for the active
account. A tab that sends no request keeps showing data it already had. The
auth isolate’s read cache re-runs this check on every hit, so a cached
resolution never answers a stale tab for the new account.
G5 Revocation
Ordinary-read bound: risk decision
Decision proposed for the release authority: accept these bounds for
read routes only. The residual risk is that a holder of a stolen device
cookie keeps reading for up to 100 seconds after revocation and cannot write,
mint or step up. The alternative, an uncached Durable Object check on every
mounted request, adds one BrowserDevice and one UserSessions operation to
every request. The decision is not in force until the release authority
records it with its scope (P1, read routes) and a review date; until then G5
stays open and no reader leaves supabase.
Uncached authoritative checks
- Which. Every route the effect registry classes as
write,credentialorsecurity, every unknown route, every mint (mintCredential, realtime and access issuance), every step-up grant and consume, andRelyingEntry.livenessfor slice 2b’sSessionLivenessPort. - How. These calls never use the isolate’s 5-second cache or the device’s
30-second epoch cache. The isolate passes the request to
BrowserDevice, which reads its stored state and takes afreshepoch fromUserSessionsin the same call.requireLiveSession()in every adapter maps toWebEntry.requireLive. - Outage behavior.
Emergency kid denial, end to end
Run on staging with the real gateway, auth Worker, two mount Workers fed keys
by configuration, one realtime verifier, and a JWKS-fed verifier fixture that
honors Cache-Control. Record every timestamp in the acceptance receipt.
- Identity, realtime and access keys A are
activewith committed rows. For identity, anextkey C has been published for at least 7 days. Mint one token of each class with A and keep a long-lived mount render holding an A assertion. - At
T0, deploydeniedKids: [A]to every configuration-fed verifier and to the signer key set, and promote C toactive. - Assert that each configuration-fed verifier rejects A with
unknown_keyfrom the first request served by its new version, and record that version’s convergence time. - Assert that the JWKS document served after
T0omits A, that its response never carriesmax-ageabove 300 or anAgethat would extend past it, and that the fixture rejects A no later thanT0 + 305 s. - Assert from the
token.issuedaudit stream that no token withkidA is minted after the signer’s new version serves, and that identity minting resumes with C once the census holds C, with the gap recorded. - Repeat with no
nextkey: a security operator arms emergency key B through the keyguard operator Worker’sOperatorEntry; assert that B signs only after every registered deployment and the public JWKS report it, skipping only the 7 days, and that the identity outage lasts at most one census refresh plus configuration convergence. - Restart the auth Worker (deploy the same code) between steps 2 and 5 and assert that A stays denied and no cold isolate mints with A.
G8 Stop-fence modes
The fence record
SessionControl stores
{ mode, version, background, budgetParks, changedAtMs, actor, reason }:
mode is running, issuance_stopped or stopped; version increases by
one on every change and never decreases; background is running or
parked; budgetParks lists the accounting categories whose daily budget is
exhausted.
The effective mode is the stricter of the stored mode and
TTR_SESSION_FENCE_FLOOR, a Worker variable that an operator can deploy
without SessionControl and that new isolates and restarted objects read at
once.
- Readers. Only auth isolates read
SessionControl, at most once every 10 seconds each. An isolate passes its snapshot{ mode, version, readAtMs }into every object call. Objects never pollSessionControlon the request path; an alarm reads it once per wake. - Final issuance decision. The object that commits issuance (the
BrowserDevicecommit forsign_in,redeem_child,rotate,switch,grant_step_upandrecord_factors; the isolate immediately beforemintToken; theSessionCredentialsobject and the database function for credential mints) checks the snapshot it was given right before the commit. It refuses when the snapshot is older than 10 seconds or its mode forbids the operation, and the committed record and its audit event carry the fence version. A stop therefore stops new issuance within 15 seconds, including work already in flight. - Unavailable fence. Issuance fails closed when no snapshot younger than
10 seconds exists. While the snapshot is stale, resolution of existing
sessions applies the stricter of the last known mode and
TTR_SESSION_FENCE_FLOOR, so a floor deployed during aSessionControloutage takes effect at once. Five minutes after the snapshot’sreadAtMs, or at once in an isolate with no snapshot, resolution answersunavailablerather thansigned_out: the gateway returns its retry result,x-ttr-identity-status: unavailable, keeps the session cookie and never clears it, so the outage ends without signing anyone out. This 5-minute fuse turns aSessionControloutage into a retry page for every mounted request and is a release-authority acceptance item (see the rollout section). - Writes.
ControlEntry.setFence(mode, reason),parkBackgroundandresumeBackgroundwrite the record and append to the fence log in one transaction. Only the operator Worker holdsControlEntry’s caller key.SessionBudgetwrites onlybudgetParks, through two internal methods (see accounting below).
Allowed operations per mode
issuance_stopped keeps password change and revoke-all because both replace
or remove access during an incident; the generation each bumps replaces the
acting session’s cookie and adds no credential. It stops s2s mints and
background work with the rest of issuance; security cleanup keeps running.
No mode, switch or budget parks security cleanup. A legacy upstream grant
keeps authorizing until the provider revokes it, and a credential keeps
validating until its issuer holds the tombstone, so upstream revokes and
issuer tombstones must stay runnable for as long as either can still
authorize. Their spend is bounded per item by the attempt caps below.
background: parked is the switch for runaway background spend and parks
only the census, pruning, lease decisions and index touches. Parking the
census stops minting 300 seconds later; parked lease decisions leave claims
counting toward the 50-slot cap, which fails safe.
Parking and resuming
- A consumer that finds its work forbidden does not reschedule. An object
writes its id and the fence version into
ParkedWorkshardhash(objectId) mod 16, at most once per fence version, and deletes its alarm. The census and purge crons have no object id and skip the tick. The audit consumer is security cleanup and is never parked; its dead-letter queue is retained 14 days and replayed by the operator. - Attempt counters, cursors and deadlines are durable and are never reset by parking, a restart or a resume.
- When a fence change makes parked work allowed again,
SessionControlsets its resume alarm. Each wake reads at most 100 entries from each shard in turn, pokes at most 8 objects at a time to re-arm their alarms, deletes the entries it poked, and re-checks the fence before each page. A poke is idempotent. Any request to a parked object also re-arms it. - An entry whose version is older than the current fence and still parked stays until the fence allows it.
G17 Operation accounting and cost bounds
Accounting
Every Durable Object call, Hyperdrive query, Queue send and abuse-guard call writes oneSESSION_OPS data point:
{ category, method, outcome, entry, ingressClass, deploymentId, rowsRead, rowsWritten }.
The first four are the categories G17 names;
index, credential and keys
are kept apart from them so no one category hides another.
Budgets live in SessionBudget, never in SessionControl, so accounting
load and an accounting outage stay off the fence read that issuance fails
closed on. Each isolate keeps per-category counters and flushes them to
SessionBudget every 60 seconds; a failed flush is dropped, counted and
alerted, and never delays or refuses a request. When a category’s daily total
crosses its budget, SessionBudget calls SessionControl.addBudgetPark once
and alerts; its midnight UTC alarm calls clearBudgetParks once. A budget
park reaches consumers through the ordinary fence snapshot and parks only that
category’s background work. It never parks security cleanup and never sets
issuance_stopped or stopped, which stay operator decisions, so a flood
cannot stop sign-in for everyone.
Ingress classification before IP trust
The gateway classifies every request before any address is used:
The class is decided by the address alone.
CF-Worker is read only for an
address inside Cloudflare’s ranges, exactly as cloudflareWorkerZone in
packages/utils/src/abuse-protection/abuse-subject.ts does, which also
rejects the platform’s own zone; a client outside those ranges cannot choose
its class or bucket by sending the header.
The host compiles the published ranges once with compileCloudflareRanges,
which reports every entry that does not parse in invalid. Each
classification also reports droppedRanges, the compiled ranges that were
malformed when copied; an address such a range would have covered is classed
public. The host alerts on any invalid entry or nonzero droppedRanges.
Prefixes come from the fully expanded address, matching the IP identity rules
on the rollout page:
- Parse. A full IPv4 and IPv6 parser accepts dotted IPv4 and every RFC 4291
IPv6 text form, including
::in any position and an embedded IPv4 tail, and rejects zone ids, a second::and out-of-range groups. - Expand. An IPv6 address expands to eight 16-bit groups before any
prefix is taken. An IPv4-mapped address (
::ffff:a.b.c.d) is treated as that IPv4 address. - Aggregate. Limits use the IPv4
/24or the first four expanded groups as the IPv6/64. The assertion’sippclaim is a separate, coarser display prefix: IPv4/24or the first three groups as an IPv6/48in canonical RFC 5952 form, as the identity assertion profile requires. - Failure. An address that does not parse is not valid, so the request is
class
unknown, its limit key is the conservative shared bucketunknown, andippis unset.
getCidrSubjectKey in packages/utils/src/abuse-protection/reputation.ts
splits on : and drops empty groups, so 2001:db8::1 yields no key and
2001:db8:a::1 yields 2001:db8:a:1::/64 instead of 2001:db8:a::/64.
Implementing slice 4 fixes that helper to use the expanding parser, with
tests for each :: position, mapped and embedded IPv4 and rejected inputs,
so the gateway and the reputation module share one aggregator.
The class and both prefixes travel as resolveForMount arguments, which the
auth Worker trusts only after the gateway’s caller key passes. The auth Worker
never reads its own cf-connecting-ip, Web family callers pass the class the
gateway forwarded, and alarms, cron and Queue work carry system and no
address.
Forged cookies cost no Durable Object operation. Each isolate keeps an
in-memory counter per limit key and calls abuse-guard at most once per key per
10 seconds with the aggregated count, so a flood of bad MACs cannot multiply
abuse-guard operations either. A valid MAC with a wrong secret counts the
same way.
Operations per request
Alarm, cron and retry bounds
Every alarm checks the fence before background work and before rescheduling, sets only a
finite future deadline, deletes itself when no work remains, and catches its
own errors. The service-specific cost envelope, priced with current product
pricing, goes into the
Cloudflare adoption guidance
before P1 enables any write.
G18 First-adapter acceptance
Run against the first adapter that consumesx-ttr-identity, and repeat for
each later adapter family. The first adapter is Mail, mounted at
tuturuuu.com/mail through the gateway’s MOUNT_MAIL binding. Its
acceptance respects Mail’s live constraints:
-
mail.tuturuuu.comredirects navigations only; its API, webhooks, OAuth callbacks and/verify-tokenstay served there and stay outside the first-party reader until a reviewed step moves them. -
Mounted login keeps the shared return path through Web’s
/loginandcreateMountedAppAuth. -
Mount isolation holds: Mail never writes
__Host-ttr_sessionorsb-*, logout, refresh and minting answer409on the mount, and Web stays the only session writer. - Connected-account OAuth stays staff-gated, with its client secrets on the Mail Worker.
-
Mail releases are sealed artifacts published with
expect-current, so any binding the adapter needs is in the sealed profile and reviewed before the release. -
Emitted artifact. Build the adapter app in CI for the exact commit.
Assert from the emitted Worker’s module graph that
@tuturuuu/session,./verifyand the principal module each appear once. Run the emitted artifact (not source) in the local Workers runtime with a test key set and send a request whose assertion it must verify and convert throughprincipalFromAssertionthrough the public entry points the adapter imports; the response must carry the principal’s user id. A second module instance fails the brand check and the test. -
Real ingress. Against the staging gateway hostname, with a raw HTTP/1.1
and an HTTP/2 client rather than
fetch, prove: two separateCookiefields arrive as separate values or joined with;; two__Host-ttr_sessionvalues resolve to signed out with a clearingSet-Cookie; and a neighboring cookie value containing commas stays intact and does not split the session cookie. -
Key ingestion. Each verifier parses and validates its configured key set
at isolate start. An invalid document yields
keys_unavailableon every request and one telemetry reason, neversignatureorunknown_key.
Gates this slice closes
Tests and acceptance
- Unit and port tests (Vitest, in CI). Each port against the slice-3 and
slice-2a contract suites: the SQLite
DeviceStoreunder injectedconflictandunknown, the index under racing reserves and expired leases, the issuer stores under racing mint and revoke, the observation store’s insert-only rule and bootstrap election, and the captured-epoch margin at exactly 5 seconds, including a read whosereadAtMsdiffers from the isolate clock by exactly 5 seconds (passes) and by more (fails closed). - Entry and ingress tests. Every method of every entry point refuses a
wrong key, a missing key, a dropped previous key and an absent auth-side
secret with no downstream call; a
GatewayEntrycall with forged ingress values and no key is refused.WebEntryhas noadminRevokeUser, and the Web key presented toAdminEntryis refused. A call accepted with the previous value writes aprevious_keyaccounting point.CF-Workeron an address outside Cloudflare’s ranges is ignored, and a Cloudflare address with no or the platform’s own zone lands in the shared Worker bucket. - IPv6 aggregation tests.
2001:db8::1,::1,2001:db8::,2001:db8:a::1,2001:0db8:000a:0000::1and a full eight-group form each aggregate to the/64of their expanded address;2001:db8:a::1gives2001:db8:a::/64.::ffff:192.0.2.7aggregates as192.0.2.0/24. A zone id, a second::, a group overffffand an empty value land in theunknownbucket with noipp.ippis the expanded/48in RFC 5952 form. The same fixtures run against the fixedgetCidrSubjectKey. - Read cache tests. A failure is never cached, and a
write,credential,securityor unknown route never reads the cache. Each hit signs a new assertion whoseaudis the requesting mount, so an entry filled by one mount never returns another mount’s assertion. Post-switch stale tab: tab B switches to account 2 and fills the cache for the new cookie, then tab A sends the new cookie with account 1’sexpectedSessionIdto anaccountScopedroute and getsaccount_mismatchwith no assertion. Declaration change: an entry filled through a route declaredaccountScoped: falsewithexpectedSessionId: null, followed by a hit on a route declaredaccountScoped: truewith a null or differentexpectedSessionId, getsaccount_mismatch; the same hit with the matchingexpectedSessionIdgets an assertion. - Census and snapshot tests. A published entry that times out or is
missing fails its class, and so does a report for an unpublished entry; an
entry with two live versions passes only when both bundles hold the key.
A live gateway version binding a mount absent from the identity registry
artifact, an artifact naming a gateway version without traffic, and an
artifact with a lower
registryVersioneach fail the class. A version’s trafficpercentagemay be fractional (Cloudflare allows 0.01 to 100): the version and deployment texts read it as a canonical decimal in(0, 100], while every other control input accepts only safe integers. A tick capped at 40 calls completes only the classes it finished, and a429leaves every stored census unchanged. A cold isolate with a snapshot whose census is 300 seconds old mints, 301 seconds old does not, and a missing, bad-MAC or wrong-environment snapshot mints nothing. - Key guard tests. A document signed by the pin’s
previouskey passes and one by an unpinned key fails. A signature over non-canonical bytes, a duplicate member, a wrong environment and anissuedAtMsmore than 5 seconds ahead are invalid. A lowerlistVersionand equal-version different content are rejected, also after a restart and in a cold isolate. After a fetch error the held list stays in force at 300 seconds; at 301kidsreads empty andmintHaltfalse, whilegatewayVersionsandidentityBlockedkeep their values. A re-issued equal document with a newissuedAtMsrefreshes the held list and restores a servedmintHalt.mintHaltrefuses every class. The guard’s response carriesCache-Control: no-store.OperatorEntryandObserverEntrycalls with a wrong or absent caller key, and aGuardStatecall through a foreign Durable Object binding without the key, returnunauthorizedand change nothing; noObserverEntrymethod changeskidsor clears a halt; an operator Worker request without a valid Access JWT for its audience writes nothing; each operator write appends the operator’s identity and reason and incrementslistVersion. - Observer tests. Against a fake Cloudflare API and GitHub: a version
with traffic and no recorded deployment, a recorded version from a commit
not on
main, a variable, binding or secret name differing from the committed config, and a route ontuturuuu-autheach setmintHalt. An unlisted binding alerts without a halt. A run capped while another page exists endsincomplete. A429, an API error, a GitHub error and an incomplete auth check each alert and leavemintHaltunchanged. A gateway version recorded by another workflow, actor or version id is not accepted; a gatewayAUTHbinding to another script setsmintHalt; a standing Worker-wide grant marks the identity class blocked, for product-scoped Workers Admin and Editor, Developer Platform Admin and Editor, legacy Workers Platform Admin, Workers Scripts Edit, Workers Scripts Write, Workers CI Edit, Workers Observability Edit, Workers Observability Telemetry Edit, the account roleAdministratorand its legacy aliasAccount Administrator, each as an exactroles[].nameand as an account-scoped policy permission group, whileAdministrator Read Onlydoes not, a user-group grant, an account token policy, and an identity whose direct and group policies together give deploy rights on bothtuturuuu-authandtuturuuu-gateway, or ontuturuuu-authand a key-plane script, whileSuper Administrator - All Privilegesdoes not and an account-wide read token does not; an account token is classified on the union of all its policies, and upload or secret-put rights count the same as deploy; a gateway check that hits its cap with a page unread accepts no new id, removes no accepted id and does not fail the class; a grant run that hits its cap with unread pages is a failed read that keeps the block and does not move the success time; an id with no traffic is dropped fromgatewayVersions; two gateway versions with traffic and different mount maps fail the class. An unlisted binding totuturuuu-auth-keyguard, or a Durable Object binding toGuardStatefrom another script, is an inventory finding. For each key-plane script, a version with traffic and no deployment record, one recorded by another workflow, actor, script or version id, one from a commit not onmain, a config differing from the committed one, aworkers.devor preview URL, and an operator hostname outside the Access application each alert and set no halt. So does each of these key-plane records: one from a re-run (run_attempt2); one from aworkflow_dispatchofmain; one from aworkflow_dispatchof another branch; one whose payload nameskeyguard-cloudflare.yamland the version id but whose creator isgithub-actions[bot]; one whose latest status is notsuccess, or whose run id appears only in the payload; one whose statuslog_urlnames a run whosehead_shadiffers from the deployment commit or whose job never reached its deploy step; and a version whose module hashes differ from that run’skeyguard-<script>-manifest. A record stillin_progresswhile its run runs is pending, and alerts after 15 minutes. A record from the keyguard deployer App for a qualifying run, with matching config and module hashes, raises nothing. Restoring V1, a version with its own earlier Appsuccessrecord, alerts while V2’s later record is the latestsuccess, and also during a later honest job whose V3 record is stillin_progress. Until V3 reachessuccess, V2 stays the accepted version. A GitHub-generatedinactivestatus on an App deployment is ignored, and asuccessdeployment whose earlierin_progressstatus GitHub no longer returns is still accepted. - Key-plane deployment fields. Against a fake GitHub API, each App
deployment is created with
auto_merge: false,required_contexts: []and an explicitproduction_environment, and each App status carriesauto_inactive: false. A CI check fails when akeyguard-cloudflare.yamljob names an environment other than its script’s own per-stage environment, or reads another script’s deploy token. - Audit alert tests. Listed on auth Worker audit alert.
- Issuer tests. The AI token row keeps every payload field and the
device’s
resolvedAtMs, the required-MFA gate refuses on mint and on validate, and tombstone and watermark lifetimes equal theissuer.tsfunctions for each store. The racing mint and revoke test runs against thecross_app_tokensSQL functions, including a first mint for asidwith no fence row, a nullsid, andEXECUTErefused toanonandauthenticated. - Runtime tests in the local Workers runtime through
@cloudflare/vitest-pool-workers, in CI: real Durable Object storage, alarms and RPC; an object reset betweenwriteand its acknowledgement; an alarm throwing never adding attempts; parking, restart and resume with attempt counters unchanged; a stop written while a sign-in commit and a drain wake are in flight; the floor variable applied to issuance and to resolution withSessionControlunreachable; resolution with a snapshot older than 5 minutes answeringunavailable, which the gateway turns intox-ttr-identity-status: unavailablewith the cookie kept;s2srefused underissuance_stopped; upstream and issuer revokes still running underbackground: parked,issuance_stoppedandstopped; and issuance unaffected whileSessionBudgetis unreachable. - Operation-count regressions. Each row of the per-request and alarm tables is a test that counts calls through instrumented stubs and asserts the exact number, including repeated wakes with persistent downstream failure, empty work, expired state and duplicate delivery. A change to a count needs a reviewed change to these tables.
- Local Wrangler run, when a defect needs it: the auth Worker, gateway and
one mount under
wrangler devwith isolated persistence on loopback, to reproduce multi-Worker binding behavior and the stop bound with a real clock. Setup, ports and cleanup go into the owning runbook. - Staging acceptance, before the hold is lifted: the G5 denial run, the
G18 ingress run, a 15-second stop measured from
setFenceto the first refused sign-in and mint, a census outage stopping minting at 300 seconds, the binding inventory diff run from CI against git with no finding and a complete run, an observer drill in which a staging auth version deployed by a dedicated drill job without a GitHub deployment record setsmintHaltwithin 5 minutes and an operator clears it, aGatewayEntrycall from an unlisted Worker without the key refused, an audit alert drill in which a staging key-plane script is edited with a token absent from the ledger, the Audit Logs v2 event shows contextapi_tokenand that token’sactor.token_idwithin 10 minutes, and the security on-call channel receives the alert within 10 minutes, a key-plane drill in which a staging key-plane version deployed outsidekeyguard-cloudflare.yamlalerts from the observer within 5 minutes, and, once the release authority sets a staging reader toshadow, a soak with mismatches logged by id.
Rollout
This slice adds no auth flag and flips none.TTR_SESSION_WRITER stays
supabase, every TTR_SESSION_READER_<APP> stays supabase, the fence starts
at running on staging, and production stays held in tuturuuu.ci.ts.
Provisioning the secrets, creating the key-plane scripts under a creation
waiver, minting their script-scoped tokens, enabling the audit alert,
attaching the operator Workers, lifting the hold and
any flag change are the release authority’s decisions, each with its own
rollback.
Release-authority acceptances
The release authority records each item with its scope and a review date before production leaves the hold. Until then the dependent gate stays open. Recorded decisions, scoped to the slice 4 auth Worker design: the auth Worker, keys and controls pages as of the commit that records these decisions, review date 2026-12-21. A later change to these pages needs its own decision for the items it touches:
The scoped gateway deploy token is in the Web release lane’s custody.
- G5 bounds. The ordinary-read bounds above (5, 35, 70 and 100 seconds)
for
readroutes only. - The 5-minute
SessionControlfuse. Past 5 minutes without a fence snapshot, every mounted request gets the retry result, with the cookie kept. - Key guard outage. Once the held list is 300 seconds old, a guard
outage removes only the 7-day skip and lapses
mintHalt. Accepted gateway versions andidentityBlockedkeep their last values, so identity minting stops during a guard outage only when a gateway version not yet accepted has traffic. A halt the guard is still serving stops every token class and turns every mounted request into the retry result until a security operator clears it. Only a positive mismatch sets a halt; API errors and incomplete checks only alert. - Key guard in the platform account. The key guard, its operator Worker
and the observer run in the existing platform account, and the weaker
isolation is accepted: an identity with Worker-wide edit rights there, or
whoever compromises
keyguard-cloudflare.yamland a key-plane deploy token, could redeploy the guard or the observer. The compensations are dedicated scripts for each that take changes only from their ownkeyguard-cloudflare.yamljobs, a script-scoped deploy token per script in its own per-stage keyguard environment limited tomainthat needs a security operator’s approval, deployment records written only by thetuturuuu-keyguard-deployerGitHub App and tied to a qualifying run, the observer’s provenance and module-hash check on all three scripts, the audit alert treating any other actor on them as positive, and the emergency list in aGuardStatecontrol record written only through the Access-gated operator Worker, so only security operators write it unless one of those two residuals occurs. Security operators are staffed to clear a real halt. - Procedures. Caller-key rotation in the order on the auth Worker page,
and CI-only changes to
tuturuuu-authand the three key-plane scripts, including secrets and rollbacks. A deployment record, for auth, a key-plane script or the gateway, counts only when its environment, creator, workflow and version id all match and its commit is reachable frommain; a key-plane record counts only when the keyguard deployer App created it, its latest App status issuccess, that status names a qualifying run, apushtomainon attempt 1 whosehead_shais the deployment commit, and it is the latest Appsuccessdeployment for that environment and script. A key-plane retry or rollback is a new commit onmain. - AI validation cost. One
SessionCredentialscall, plus one Hyperdrive query, on every AI token validation. - Budget exhaustion never stops sign-in. A budget park parks only that
category’s background work and never sets
issuance_stoppedorstopped. - Script-scoped, disjoint deploy tokens. The auth and gateway deploy
tokens are scoped to their own scripts and share no role. Creating a new
Worker uses a time-bounded product-level Admin waiver with id, scope and
expiry, published as a commit on
mainand removed before any auth version has traffic. No standing Worker-wide grant remains on members, user groups or account tokens, checked by the observer with Account Settings Read and Account API Tokens Read, and theSuper Administrator - All Privilegesrole is the only accepted standing residual. Short-lived user tokens minted with the cf CLI may deploy scripts other thantuturuuu-authand the key-plane scripts: script-scoped where Cloudflare allows it, expiring within 24 hours, and each entered in the append-only credential ledger, whose store stampsrecordedAt, before use. The observer cannot list user tokens, so a Worker-wide user token is invisible to it and is detected only by the audit alert after use, and neither can verify a token’s real lifetime or scope. The alert treats as positive a change to a watched script by a token outside the ledger, used before itsrecordedAtor past its expiry, or, ontuturuuu-auth, by anything other than its CI token inside a run of the auth job onmain, and on a key-plane script by anything other than that script’s CI token inside a qualifying run of its job. Waiving the split beyond a creation run waives slice 2a’s registry split and needs its own id, scope and expiry. - Global API keys. No deploy, CI job or Worker uses one, and each member’s key is disabled where the account allows it and otherwise rolled and left unused. The audit alert reports any watched change made with one.
APEX dependencies
APEX owns the gateway; these land in gateway releases before the dependent step:- Identity registry artifact. The gateway exports the
MountInventoryentry point described on the keys page. Without it the identity class has no registry and mints nothing. - No bypass before readers move. Before any app’s reader leaves
supabase, APEX moves that app’s direct zone routes behind the gateway and a CI check refuses a session-bearing app whose Worker configuration has a zone route, custom domain,workers.devor preview URL. No session-bearing path reachesWEB_ORIGIN. - One gateway version. The
AUTHservice binding, the gateway caller key and the JWKS dispatch ship in one gateway version. No public path forwards toAUTHbeyond the routes this design lists, the caller key is a secret carried through every later gateway write, and the write is serialized withexpect-currentlike every gateway change. - Scoped gateway token. The gateway workflow’s deploy token is an editor
on
tuturuuu-gatewayonly and has no role ontuturuuu-auth. Each gateway release records a GitHub deployment for its environment, created by the gateway workflow’s GitHub actor, with a payload naminggateway-cloudflare.yamland the exact version id, at a commit reachable frommain, so the observer can accept it. Two gateway versions with traffic and different mount maps fail the identity class, so a mount change finishes draining the old version before the census passes. - Retry result. The gateway sends
x-ttr-identity-status: unavailableand keeps the cookie when the auth Worker is unreachable or answersunavailable. - Expanded-address prefixes. The gateway’s ingress classification uses the expanding parser above.