Authentication is a solved problem you can buy; authorization is a distributed data problem you have to design. The chapter on identity established who is calling. This one is about the harder question — may this principal do this to that object, right now — asked millions of times a second, answered from facts spread across a dozen services, and expected to change the instant someone clicks “remove”. The policy language is the easy part. The hard parts are where the facts live, how fresh they are, and what you do when a user asks for “everything I can see”.
The usual framing is a maturity ladder: start with roles, graduate to attributes, arrive at relationships. That framing hides what actually differs between the models, which is where the authorization-relevant facts are stored and who maintains them. In RBAC the facts live in role assignments, maintained by admins. In ABAC they live on the principal, the resource and the environment, maintained by whichever system owns each attribute. In ReBAC they live in a graph of relationships — owner-of, member-of, parent-of — maintained as a side effect of normal product actions: sharing a folder, adding someone to a team.
RBAC fails in a specific, predictable way. The moment access must be scoped — viewer of project 17, not viewer — the scope gets encoded into the role, and the role count becomes a product of dimensions: functions × scopes × regions × environments. Twelve functions across a thousand projects is twelve thousand roles, most of which are one assignment each. At that point the roles are not a policy any more; they are data wearing a schema’s clothes, managed through an admin UI that was built for a list of twenty. Access reviews become unreadable, and the “least privilege” audit finding is permanent because nobody can tell which of 12,000 roles are needed.
roles embedded in a JWT
~40 B per scoped role string, ×4/3 base64url
Common proxy defaults cap a header line at ~8 KB (nginx: 8k buffers). Past ~150 roles the token stops fitting, and it was stale from the moment it was minted.
The second-order failure is the fix teams reach for: put the roles in the token. It removes a lookup per request, and it works until users accumulate scoped roles. A few hundred role strings do not fit through default proxy header limits; well before that, the token is a cached copy of the permission set with a TTL equal to the token lifetime, and revocation waits for expiry. Section 3.6 puts numbers on that window.
ReBAC’s real advantage is not expressiveness — ABAC can express anything — but that it separates schema from data. The schema (“a document’s viewers include its folder’s viewers”) stays at a dozen relations as the product grows; scope lives in tuples, which are written by the same code path that performs the sharing action. That is also its cost: the authorization store is now a large, write-heavy, globally consistent database on the critical path of every request, with graph-shaped queries. ABAC keeps the evaluator stateless and pushes the data problem onto whoever supplies the attributes. Neither makes the data problem go away; they choose who owns it.
Architect's note · the hybrid everyone ends up with
Broken object-level authorization has topped the OWASP API Security Top 10 in both editions, and its mechanism is architectural rather than careless. The gateway authorizes the route — “users with role finance may call GET /invoices/:id” — and the handler loads invoice id without asking whose it is. Every layer did its job; the object check simply had no owner. The First American Financial exposure reported in 2019, where document URLs with sequential identifiers exposed hundreds of millions of records to anyone holding one link, is the pattern at its purest: the only check was “has a URL”.
The layers that are cheapest to centralise (edge, mesh) are the ones that know least about the object. The layers that know the object (handler, data layer) are the ones that are hardest to keep uniform. Every workable design pairs one of each.
The matrix explains why “centralise authorization at the gateway” keeps failing. The gateway knows the principal and the path but not that invoice 8812 belongs to tenant 44; to know that, it would have to load the object, which means it is now part of every service’s data model. The layers that know the object — the handler and the data layer — are exactly the ones that are distributed across teams. The workable pattern is two checks with different jobs: a coarse, uniform check at the edge (authenticated, tenant resolved, route allowed for this principal type) that is centrally owned and nearly impossible to forget, and a fine-grained object check at the point of load, enforced structurally — a repository layer that cannot return an object without a decision attached, rather than a convention that each handler calls authorize(). The Multi-Tenant SaaS track’s chapter Tenant Context & Data Isolation covers the data-layer half (row-level security and its session-variable traps); here the point is that RLS is a backstop for tenancy, not a substitute for per-object permissions, which are rarely expressible as a row predicate once sharing exists.
Two details decide whether the point-of-load check actually holds. First, decide on the loaded row, not on the requested ID. A check keyed only on invoice:8812 that runs before the load consults the authorization system’s copy of the object’s tenant and parent; the load then reads the database’s copy. If the object was moved between tenants or folders and the two copies disagree for a few seconds, the check approved one object and the handler returned another. Loading first and passing the loaded object’s owner, tenant and parent into the decision closes that gap and gives you a denial that is consistent with what you would have returned. Second, BOLA in mature codebases rarely lives on the obvious GET /invoices/:id, which everyone tests. It lives on the indirect paths to the same object: the GraphQL resolver for payment.invoice, the batch endpoint that accepts 500 IDs and checks the first, the export that selects by a filter rather than by ID, the webhook replay that re-sends a stored payload, the “related items” widget. Each is a new edge into the object graph, and a check that is attached to an endpoint rather than to the load path misses all of them. That is the practical argument for enforcement in the repository layer: the number of loaders is small and stable; the number of routes to them is not. Return 404 rather than 403 on an object-level deny unless the caller could already know the object exists — 403 turns a sequential-ID space into an existence oracle.
Service-to-service calls add the confused deputy. The mesh authenticates the caller as billing-service via its workload identity, and ledger-service authorizes billing-service, which is allowed to read every ledger. The end user who triggered the call — who may be allowed to read one ledger — has vanished from the decision. Any request-forgery or parameter-tampering bug in billing now reads every ledger. The fix is to authorize on both identities: the workload identity answers “may this service ever call this API”, and a propagated, verifiable end-user context (a token-exchanged, audience-restricted token in the RFC 8693 style, not a plain X-User-Id header any service can forge) answers “on whose behalf, and may they touch this object”. Background jobs are the same problem displaced in time: a job enqueued by a user should carry that principal and be re-checked when it runs, not execute later with the worker’s god-mode credentials.
Pitfall · the admin-service exception
Policy engines are sold on their languages, and the language is the least interesting property. OPA evaluates Rego, a Datalog descendant, over a JSON document of input plus loaded data; Cedar evaluates a deliberately restricted language over a request and an explicit set of entities. Both are fast — the evaluation itself is typically microseconds to low milliseconds. Both are, in effect, pure functions of facts they are given. The design question is therefore how facts reach them, and that choice decides freshness, latency, trust and blast radius.
caller supplies
JWT claims · Cedar entities in the request
PDP pulls at eval
OPA http.send · entity loaders · DB lookups
replicated into PDP
OPA bundles · Zanzibar-style tuple store
Real systems mix all three, per attribute. The design review question is not “which engine” but which column each fact lives in, and whether its failure mode is acceptable for the decisions that depend on it.
The three sourcing modes fail differently. Caller-supplied facts are fast and look clean in a diagram, but they move the trust boundary: the service asking the question also chose the evidence. If resource.owner arrives in the request body, a compromised or buggy caller can make any decision come out “allow”. Caller-supplied facts are fine when the caller is the system of record for them and is itself trusted for that decision; they are wrong for anything an attacker controls. Pulled at evaluation facts are fresh but make every source a tier-0 dependency of authorization — and authorization is a dependency of everything, so the availability arithmetic from the SRE / Reliability track applies with unusual force: a PDP that pulls from four sources at 99.9% each cannot beat ~99.6% before its own failures. Replicated facts are fast and available, but OPA bundles hold data in memory on every replica, so a bundle that includes per-object facts grows with the product until it no longer loads, and the replication lag is a revocation delay nobody chose.
Placement is the second decision, and it is usually argued on the wrong number. The case against a central PDP is always “an RPC per check”, but the per-check cost only dominates when the calling code issues checks serially, one per object — the authorization N+1. A handler that renders 25 objects and checks each in a loop against a 2 ms remote PDP (illustrative) spends 50 ms on authorization; the same handler using a bulk-check call spends one round trip. Fix the API shape before moving the engine. The case for local evaluation is availability and tail latency, and its costs are the ones nobody tallies up front: every replica holds the data, so a bundle carrying per-object facts turns into data × pods of fleet RAM, and every policy change is live on some pods and not others while it rolls. For an in-process library that skew lasts as long as the slowest team’s deploy cadence — which means a security fix to policy can take weeks to be universally in force, and nobody can say on which date it was.
central PDP service
shared fleet behind an RPC
sidecar / node agent
PDP per pod or per node, data replicated
in-process library
engine linked into the service
The central service loses on latency only when checks are serial and unbatched, which is an API-shape problem, not a placement one. The local shapes lose on fleet memory and version skew: the moment per-object facts enter the bundle, memory scales as data × pods, and a policy fix is live on some pods and not others.
A workable threshold: keep policy and data local only while the replicated data set is bounded by something other than product growth — tenants, roles, feature flags, service identities. Once it grows with objects or sharing events, the facts belong in a store the PDP queries, and the local component shrinks to a decision cache in front of it. Design review question: what is the largest bundle you will ship in three years, multiplied by the pod count you will run then?
Cedar’s restrictions are its real feature. No loops, no unbounded recursion, no side effects, forbid overriding permit, default deny: the language is designed so that policies can be analysed symbolically, and AWS’s published work on encoding Cedar (and, earlier, IAM via Zelkova) into SMT makes questions like “does this change grant anyone access they did not have?” answerable as proofs rather than tests. That changes how policy ships (section 3.7). Rego is more expressive and has partial evaluation — evaluate with the resource unknown and get back a residual condition you can translate into a query filter — which is the cleanest known route to list filtering with an ABAC engine, provided your policies stay inside the fragment that translates.
Explicit deny has a cost that is rarely priced in. A policy set with only permits is monotonic: adding a fact can only add access. Deny rules — IAM’s explicit deny, Cedar’s forbid, Zanzibar’s userset exclusion (“viewers except banned”) — make it non-monotonic: adding a tuple to a ban list revokes. Any cache or index that assumed “new tuples only grant, so only deletions need invalidating” is now wrong in the dangerous direction. Use deny for a small set of guardrails, and design the caching layer as if every write could revoke.
Architect's note · choosing an engine
Google’s Zanzibar paper (USENIX ATC 2019) is usually summarised as “relationship tuples plus a check API”. The parts worth studying are the ones that make it a database: how it keeps checks fast when the answer requires a graph walk, and how it keeps them correct when the graph is changing underneath.
> 2 trillion
ACLs stored (per the paper)
millions / s
authorization requests
< 10 ms
p95 check latency
> 99.999%
availability over 3 years
Data is a set of tuples object#relation@subject, where the subject can itself be a set — group:eng#member. Namespace configurations define userset rewrites: a document’s viewers are its direct viewers, union its editors, union the viewers of its parent folder. A check is a recursive expansion of those rewrites into reads of the tuple store, all evaluated at a single snapshot.
namespace rewrite
doc#viewer = this ∪ doc#editor ∪ tuple_to_userset(parent → folder#viewer)
branches this and editor are evaluated too, in parallel, and both miss
tuples read
doc:q3-plan#parent@folder:finance
folder:finance#viewer@group:finance#member
group:finance#member@group:fpa#member
group:fpa#member@user:bob
Latency is set by the depth of the dependent chain, not by the count of tuples. Width (a folder shared with 300 groups) turns into fan-out and hot keys; depth (groups nested eight deep) turns into serial round trips. Group-closure indexes such as Zanzibar’s Leopard trade write amplification for collapsing the depth to a set lookup.
That traversal is where latency comes from, and it is shaped by depth, not volume. Each hop depends on the previous one — you cannot read the folder’s viewers until you know the parent folder — so a check through a nested group chain of depth d costs roughly d sequential reads. At an illustrative 1 ms per read from a nearby replica, a document three folders deep shared with a group nested four levels deep is a double-digit-millisecond check before any queuing, and the p99 is set by the slowest read on the longest chain. Width hurts differently: a folder shared with 300 groups turns one hop into 300 parallel reads and a tail-latency lottery; a group like all-employees referenced by millions of objects becomes a hot key that every check touches.
The paper’s answers are each a distinct engineering trade. Leopard, a specialised index, precomputes the transitive closure of group membership so a deeply nested check becomes a set intersection — paid for with write amplification, because adding one group into another must update the closure for every member beneath it and every ancestor above it. The arithmetic is worth doing before you build one (illustrative numbers): nesting a 10,000-member group into a group that has 40 transitive ancestors changes up to 400,000 closure entries from a single tuple write, and a reorg that moves a few such groups is millions of index writes that must land before checks through the index are correct again. The index therefore needs its own snapshot semantics — Zanzibar’s Leopard serves reads at a timestamp and is kept up to date from the change stream — or it becomes a second, silent source of stale grants. Distributed caching of sub-problem results, keyed so that the same sub-check lands on the same server, lets hot intermediate results (“is Bob in all-employees?”) be computed once. A lock table collapses concurrent identical requests for a hot key into one in-flight evaluation, which is the same thundering-herd defence you would use for any hot cache miss. And request hedging trims the tail of the slow reads.
The open-source descendants — SpiceDB, OpenFGA, Ory Keto, Permify, and in-house systems such as Airbnb’s Himeji — inherit the model but not Spanner. What they deliver depends heavily on the datastore underneath: on a single-region Postgres, “globally consistent snapshot” means a local transaction snapshot, and the consistency story in the next section is only as strong as the store’s ability to give you a monotonic revision to hand back to clients.
What the paper takes for granted — because Google’s clients write ACLs to Zanzibar directly — is the write path. In most adoptions the share already exists as a row in the product database, and the tuple is a second write to a second store with no shared transaction. Every crash, timeout or deploy between the two writes leaves them disagreeing, and the direction of the disagreement decides whether you get a ticket or an incident. The arithmetic is sobering even with good engineering (illustrative): 20 million sharing changes a day at a one-in-a-hundred-thousand loss rate is 200 drifted tuples a day. If a third of those are lost revocations, that is roughly 24,000 stale grants a year, each permanent, each invisible in the product UI, and none bounded by any TTL in the revocation stack below.
share: DB then tuple
share row committed · tuple write lost
Bob cannot open what Alice shared
fails closed · loud · a ticket within hours
unshare: DB then tuple
share row deleted · tuple delete lost
Bob keeps access; UI says he has none
fails open · silent · no TTL ever expires it
delete object, tuples kept
object gone · tuples orphaned
a reused or recreated ID inherits old grants
fails open · latent · surfaces months later
Order the two writes so that every crash window fails closed: grants go to the tuple store after the domain commit, revocations go to the tuple store before it. A lost grant is a support ticket; a lost revocation is a permanent, invisible grant that no cache TTL bounds.
Three controls, in order of importance. Order for fail-closed: write grants to the tuple store after the domain commit and revocations before it, so the unrecoverable window always errs toward denial. Make the tuple write guaranteed with a transactional outbox rather than best-effort dual writes, with idempotent tuple operations so replays are harmless, and preserve per-object ordering in the relay — an unshare replayed before the share it follows resurrects the grant. And run a reconciler that diffs the domain’s sharing tables against the tuple store and pages on drift, because the outbox protects against crashes but not against a migration script, a manual database fix or a bug in the mapping code. Object deletion needs its own path: delete the object’s tuples (and, in hierarchies, the parent edges pointing at it) as part of deletion, and never reuse identifiers, or the next object with that ID inherits its predecessor’s grants. The drift rate the reconciler reports is the most honest health metric an authorization system has; teams that do not measure it are usually surprised by the first number.
Pitfall · modelling the org chart
The Zanzibar paper names a failure most home-grown systems do not notice until an incident: the new-enemy problem. Alice removes Bob from a document, then adds content Bob must not see. Two writes, correctly ordered by Alice. If Bob’s subsequent read evaluates the ACL at a snapshot older than the removal — a lagging replica, a cached decision — while the content is served at latest, Bob sees content written after he lost access. The same failure appears with a reordered pair: an ACL change and a content change committed in different systems with no common clock. Neither write was lost; the check and the content were simply read at different points in time.
The mechanism that fixes it is small and generalises well. When content is modified, the application performs a check (or write) against the authorization system and receives an opaque token — a zookie in the paper, a ZedToken in SpiceDB — that encodes the snapshot at which that operation was evaluated. The application stores the token alongside the content version. Later checks for that content pass the token and ask for a snapshot at least as fresh. The ACL snapshot used for the check is then guaranteed to be no older than the content being served, which is exactly the ordering Alice expressed. In Zanzibar this rests on Spanner’s globally ordered commit timestamps; the equivalent on another store needs a monotonic revision that the store can compare.
| mode | evaluates at | cache use | staleness bound | use for |
|---|---|---|---|---|
| minimize_latency | any cached snapshot | best | stale by cache TTL + lag | list views, UI affordances, low-value reads |
| at_least_as_fresh(token) | snapshot ≥ token | good; most requests still hit | never older than the content | reads of content with a stored token |
| at_exact_snapshot(token) | exactly the token | good for that snapshot | consistent across a page of checks | paginated lists, bulk exports |
| fully_consistent | latest committed | bypasses caches | none | permission-changing writes, admin UIs |
The important property is that consistency is chosen per request, and the default should be the weakest mode the use case can defend. Most checks do not need freshness at all: whether to render a share button, whether to show a document in a sidebar. A few need exactly bounded freshness: serving content whose token you stored. Permission-changing operations need the strongest: before Alice’s admin console lets her grant access, it should evaluate her own authority fully consistently, because a stale “Alice is still an owner” turns into a privilege-escalation path. Two additional details pay off in practice. First, paginated lists should pin a single snapshot for the whole traversal, or page 2 can contradict page 1. Second, tokens should be treated as minimums, never exact requirements for single checks — asking for an exact old snapshot defeats caching and can outlive the store’s garbage-collection window for old versions.
Be precise about what the token buys. It protects orderings that pass through the application that holds it: Alice’s ACL write completes, then her content write fetches a token, so the token is causally after the revocation. It does nothing for orderings the application never saw. If the ACL change is made through an admin API in one region and the content is written by an ingest pipeline in another, and nothing carries a token from the first to the second, the content’s token can predate the revocation and the check will legitimately evaluate at a snapshot where Bob is still a viewer. The fix is the same as for any cross-system causality problem: make the content write read the ACL system’s current revision (a fully consistent no-op check, or a “read revision” call) as part of the write, which costs one strongly consistent round trip per content write rather than per read. On a write-heavy content store that is the number to budget; on a read-heavy one it is nearly free, which is why the paper puts the cost on the write path.
Architect's note · where the token lives
Authorization caches cannot be invalidated precisely, and it is worth being clear about why. A decision for (doc, viewer, Bob) depends on every tuple along every path the traversal explored, including the ones that missed. When someone removes group:fpa from group:finance, the set of cached decisions that just became wrong is every decision whose proof went through that edge — which you only know if you recorded the proof for every cached entry. Nobody does. This is why snapshot-keyed caching beats invalidation: cache entries keyed by (check, snapshot) are never wrong, only old, and the consistency mode of each request decides whether old is acceptable. Quantising snapshots — evaluating at a slightly older, shared timestamp rather than “now” — is what makes such a cache hit at all; the grain of quantisation is directly your staleness-versus-hit-rate dial. SpiceDB exposes it as a revision-quantisation interval of a few seconds by default. The trade is easy to reason about: a check requested r times a second shares one evaluation among about r·q requests per window of q seconds, so its hit rate is roughly 1 − 1/(r·q) once r·q exceeds 1, and every token-less request can be up to q seconds stale. The counter-intuitive part is where the win lands. Hot keys hit at any reasonable q; the long tail is what quantisation buys. A check asked for 0.5 times a second (illustrative) almost never hits at q = 1 s, but at q = 5 s it hits about 60% of the time — and in most products the tail of (object, user) pairs, not the head, is where the PDP’s load comes from. So widening q is a load lever with a direct, stated cost in revocation seconds, which belongs in the SLO below.
The real revocation window is usually set somewhere else: by the stack of caches that each can answer without asking the layer below. Worst case, they add up.
request path, caches only
1 + 10 + 30 + 60 = 101 s
plus claims in the token
900 + 101 ≈ 16 min 41 s
open socket, no re-check
unbounded
A cache that stores an answer it got from a lower cache inherits that answer’s age. Stacked TTLs add in the worst case; nobody owns the sum unless you write it down as a revocation SLO.
The sum is the number to put in front of the security and product owners as a revocation SLO: “a removed user loses access to content within 60 seconds, and to open sessions within 5 minutes”. Once it is written down, the cache design becomes arithmetic rather than a collection of locally reasonable TTLs. Several design moves follow directly. Cache allows and denies asymmetrically: a stale allow is a security incident, a stale deny is a support ticket, so allows get the short TTL — but deny caching is still needed, because an object-ID enumeration attack produces almost nothing but denies and will otherwise send every request straight to the PDP. Put identity, not permissions, in the token, or at most coarse, rarely changing claims such as tenant and plan. Push revocation events to the long-lived holders — websocket gateways, streaming APIs, running export jobs — and have them re-check, because no TTL applies to a connection authorised once at handshake. And make the long-running operation re-check at checkpoints: a 40-minute export started before revocation should not finish afterwards.
Then there is failure. Authorization is on every request path, so its outage is everyone’s outage, and the pressure to fail open during one is intense. The defensible policy is asymmetric by operation class, decided in advance: reads of low-sensitivity data may be served from a cached decision beyond its normal TTL, bounded by a hard ceiling and flagged in logs for later review; writes, permission changes, exports and anything touching money or regulated data fail closed. A PDP that is deployed as a local sidecar or library with replicated data turns a network dependency into a replication-lag problem, which is almost always the better trade — provided lag is monitored and the replica refuses to answer beyond a staleness limit instead of silently serving a week-old graph.
Green is the normal path; gold is an availability concession with a hard ceiling and an audit trail; pink fails closed. The column that matters is the middle one: brownouts last longer than outages and are where improvised fail-open flags get added at 3 a.m.
How the brownout actually unfolds is worth rehearsing, because it is rarely a clean outage. The tuple store’s p99 drifts from 10 ms to 400 ms under a hot-key or compaction event. Callers with a 250 ms timeout start failing a slice of checks and retry; if the gateway, the service and the PDP client each allow three attempts (illustrative), a single user request can become up to 3 × 3 × 3 = 27 checks against the store that is already slow. Cache hit rate falls at the same moment, because timed-out evaluations never populate the cache, so the offered load rises on two axes at once. The first visible symptom is usually not an authorization error but request latency everywhere, since every endpoint waits on a check — and the first improvised mitigation is an environment flag that skips authorization “for reads, temporarily”, which is how fail-open ships without a review. The matrix exists so that the on-call engineer is choosing between pre-approved rows, not inventing policy. Mechanically that means: retries only at one layer, with a budget; request collapsing on identical in-flight checks; a stale-while-revalidate ceiling per operation class, enforced in code rather than by an on-call judgement; and a load-shedding order in which UI-affordance checks are shed first (the action is simply hidden), because they are the bulk of the volume and the cheapest to get wrong.
≤ 60 s
example revocation SLO · request path
101 s
4 stacked caches, worst case
16 min 41 s
same, plus claims in JWT
∞
socket authorised once
Pitfall · the retry that bypasses the cache
Every authorization system is built around check, and every product eventually needs list: search results, a dashboard of “my projects”, an audit of “who can see this”. The two obvious strategies have opposite cost curves. Post-filtering fetches candidates and checks each one; to fill a page of k results when the user can see a fraction p of objects, you need about k/p checks. Pre-filtering asks the authorization system for the visible set (SpiceDB’s LookupResources, OpenFGA’s ListObjects) and intersects; its cost scales with the size of that set, N·p.
Post-filtering is cheap when the user sees most things; enumerating the visible set is cheap when they see almost nothing. The crossover sits at p = √(k/N), and for realistic k and N there is a band where neither fits the budget — that band is where you need ACL-aware indexes.
The curves cross at p = √(k/N). With a page of 50 and a million objects, that is around 0.7% visibility, where both strategies cost roughly 7,000 operations per page — well beyond any sane per-request budget. Around the crossover there is a dead zone where neither works, and it is not an exotic corner: “a user in a mid-sized team inside a large tenant” lives there. Post-filtering in the dead zone has a nasty signature: pages come back short or empty while the server scans thousands of candidates, and the latency is set by how unlucky the user’s visibility pattern is. For the dead zone you need the ACL in the index: denormalise, for each document, the set of principals or groups that can see it, and filter by the user’s group memberships at query time. That is a Leopard-style closure moved into your search engine, and it re-introduces a revocation lag equal to the indexing pipeline’s lag — which is why it appears as its own line in the revocation stack. Keep a final post-filter check on the returned page as a safety net: it costs k checks and catches whatever the index has not caught up with.
Policy change is the other operational problem, and most outages in this area come from it rather than from the engine. A policy edit is a global configuration push to the most privileged code path in the company, and it deserves at least the rollout discipline of a config push: staged, observable, reversible. Three techniques do most of the work. Shadow evaluation: run the candidate policy beside the live one on real traffic and log every decision that differs, broken down by principal type, resource type and direction — allow→deny diffs are availability risk, deny→allow diffs are security risk, and they need different reviewers. Decision-log replay: keep a corpus of recent decisions with their inputs and re-evaluate it against the candidate in CI; a change that flips 0.3% of last week’s decisions is not a “small fix”. Symbolic analysis where the language allows it: for Cedar or IAM-style policies, ask the solver whether the new set permits any request the old one denied, and require a human to sign off each counterexample.
The gate criteria matter more than the tooling. A diff rate is meaningless without a denominator per slice: 0.01% of all decisions can be 100% of decisions for one resource type an attacker cares about, so gate on per-(resource type, direction) diffs, not on the global rate. Treat any unexplained deny→allow diff as a blocker regardless of volume, and allow→deny diffs as blockers above a threshold the product owner sets. Shadow for long enough to cover the business cycle, or replay a log that does — month-end finance jobs and quarterly access reviews exercise paths that a day of traffic never touches. And keep the previous policy version deployable in one step, because the rollback of an authorization change is also the only mitigation for a bad one.
For relationship systems the equivalent of a policy change is a schema change — adding a rewrite such as “editors of a folder can edit its documents” silently widens access for every existing tuple. Treat it like a database migration with a blast-radius estimate: count how many (object, subject) pairs gain access before shipping, using the store’s reverse queries, and stage the change behind a relation that is written first and read second.
Architect's note · the questions to ask in a design review
Where next