Beta

Create a tenant

A new tenant starts with its own users, OAuth settings, audit history and logs. You are its first Tenant Admin.

Where attributes come from

A rule is only as good as the attribute values it reads. Each value needs an authoritative source, a known freshness, whether it travels in a token or is looked up, and a safe answer when it is missing or malformed.

Who says so?

All names, domains and identifiers in these examples are fictional.

The photo service's download rules read subject.roles, resource.status, resource.embargo_until and environment.device.managed, and they believe every one of them. If a value is wrong, the rule makes the wrong decision while looking exactly right. The condition is correct; the input is not.

For each attribute, the question to ask is which system is responsible for knowing its value. That system is the attribute's authoritative source, and the decision should take the value from it, or from a copy that faithfully follows it.

At the photo service, employment and desk come from the HR system, where staff changes are recorded; license regions and embargo times come from the rights database. The library owns photo status, uploader, legal hold and current role assignments. Device management can supply managed-device status when the service has a trusted way to identify that device. The protected endpoint determines the requested action and actual resource. The service supplies current time and observed network context, with any trusted proxy handling explicit. A request field that says "managed", or that supplies its own clock, is only the caller's claim until something the service trusts confirms it.

A correct condition needs trustworthy inputs. Service observations, validated snapshots and caller assertions have different authority and freshness.

The diagram also shows what is left out. The photo service has a profile page where each person can fill in their desk, so colleagues know whom to ask about a picture. It is tempting to read subject.desk from there, since the value already sits in the service's own database. But a value the user can edit is only the user's claim about themselves. If the News library's rules read that field, anyone could move to the news desk by typing a word, and their access would follow. A value sent with the request, such as a form field saying desk=news, is self-asserted in exactly the same way.

Attributes carried in tokens

The diagram has one more input: claims in the access token. When Ivy, a picture editor on the sports desk, signs in, the authorization server at auth.photos.example can look up attributes and copy them into the token as claims. The photo API then reads them without asking anyone. Decoded, part of Ivy's token might look like this:

{
  "iss": "https://auth.photos.example",
  "sub": "user-1342",
  "aud": "https://api.photos.example",
  "desk": "sports",
  "employment": "staff",
  "iat": 1781523600,
  "exp": 1781527200
}

iat and exp are times in seconds. This token was issued at 11:40 UTC on 15 June 2026 and expires an hour later, at 12:40. Everything in it was true at 11:40.

Suppose Ivy moves from sports to news at noon and HR records it. A token containing "desk": "sports" does not update itself. A rule relying only on that claim can keep using the old desk while the token remains valid. Claims are a snapshot from token issuance, which may follow sign-in or a later grant. A new token helps only if issuance reads current authoritative data instead of copying stale claims forward.

Snapshots have real advantages. The decision needs no lookup, so it is fast, and it keeps working when the HR system is slow or down. For attributes that rarely change and can safely be an hour old, that is a good trade. A shorter token lifetime narrows the gap at the cost of more frequent token requests. Administering roles safely met the same delay when access is taken away.

Two other costs are easier to overlook. Every claim makes the token larger, and a token that lists every group and library a person belongs to can outgrow the request headers that carry it. And everything in a token is visible to whatever handles it. A JWT access token is usually signed but not encrypted, so a claim saying someone is a freelancer, or on the legal team, can be read by every API the token is sent to. An attribute belongs in a token only if every recipient may see it.

How an application asks an identity provider for particular claims was covered earlier, in Scopes and the claims parameter.

Looking attributes up

The alternative is to ask the source when the decision is made. In the same example, when Ivy opens a News library photo at 12:05, the photo service asks HR for Ivy's desk and gets news, five minutes after the change.

Freshness has a price. Each lookup adds time to the request, and a download that consults HR, the rights database and device management waits for all three. Each source is also a new dependency. If the rights database is unavailable, the decision has no embargo time, and the request has to be refused, for reasons the next section explains. The sources also take load they were rarely designed for, since few HR systems expect a question for every photo download.

Caching sits between the two. The photo service can keep Ivy's desk for ten minutes after looking it up, so most decisions skip the lookup, and the value is never more than ten minutes old. The cache lifetime is a deliberate trade between freshness and speed, and it is best made attribute by attribute rather than once for everything:

AttributeSourceHow current it must beApproach
legal_holdPhoto libraryCurrent at the moment of the decisionRead from the library for every decision, never cached
embargo_untilRights databaseWithin a minute or twoLook up, and cache briefly
device.managedDevice managementWithin a few minutesLook up, and cache briefly
deskHR systemWithin the hourToken claim or cached lookup
Display nameDirectoryA day old is fineToken claim or long cache

Legal hold is the strict one. If the legal team places a hold at 14:02 because a court has asked about a photo, a deletion at 14:03 must see it. A hold that takes ten minutes to arrive leaves ten minutes in which the photo can be deleted. Fortunately it is also the cheapest attribute to keep current, because it lives in the same library that holds the photo. A display name sits at the other end. It appears beside a caption and plays no part in any decision, so a day-old value harms nothing.

When an attribute is missing

Sooner or later a decision arrives without one of its inputs. The rights database times out. A new freelancer's HR record has no desk yet. An agency photo arrives with no rights record at all. The rule has to do something with a value it does not have.

The safe answer is to refuse, to fail closed, and the detail that matters is that "unknown" is never the same as "false". Here is the legal hold requirement as a team might first write it, next to the permit that lets picture editors delete photos:

permit photo.delete
  when "picture-editor" in subject.roles

forbid photo.delete
  when resource.legal_hold is true

Suppose the lookup for photo 9062's legal hold fails, and the value is missing. resource.legal_hold is true is not true, so the forbid does not match. The permit does, and Ivy's deletion goes through, even though the legal team placed a hold an hour earlier. Nothing in the rules is wrong as written. The forbid simply protects nothing when its input fails to arrive.

Written the other way round, the same requirement fails safely:

permit photo.delete
  when "picture-editor" in subject.roles
   and resource.legal_hold is false

Now the permit needs a positive answer. With the value missing, the permit does not match, nothing else grants the request, and default deny refuses it. The forbid can stay as a plain statement of intent, but the permit is what makes a missing value safe.

The embargo forbid from Writing rules with attributes has the same weakness. If embargo_until is missing, it never matches, and the download permits let the photo out. The fix has the same shape: the rights database records "no embargo" as an explicit value instead of an empty field, and the download permits require a rights record to be present, so an agency photo with no rights record can't be downloaded at all.

Types and formats cause the same failure more quietly. The value arrives, but not in the form the rule expects: a legal hold sent as the text "false" instead of the boolean false, an embargo written as 2026-06-14 10:00 with no time zone, a time in milliseconds where seconds were expected, or a desk spelled Sports where the rule tests sports. Depending on the evaluator, the comparison may silently fail or, worse, succeed. Each attribute's type and format should be checked where it enters the decision, and a value that does not parse is treated as missing, never as a best guess.

A denial for missing data should still be useful. Ivy needs to know only that the photo cannot be deleted right now. The people who run the service need to know why, so that they fix the source rather than the rule:

decision: deny
action: photo.delete
resource: photo 9062
subject: user-1342
reason: attribute_missing
attribute: resource.legal_hold
source: photo library, no answer within 300 ms
policy_version: 14
request_id: req-4e18

From that record, an operator can see at once that the library was slow, not that Ivy lacks a role.

A missing desk for a new freelancer is a different kind of gap: the source itself is behind. Keeping directory attributes such as desk and employment current as people join, move and leave is the work of provisioning. In the governance lessons, Sources of truth covers how an organization decides which system owns each attribute, and Joining an organization and the lifecycle lessons after it cover keeping those attributes current.

Check your understanding

Try these questions before moving on. If an answer isn't right, use the feedback and try again.

A rule in the News library tests subject.desk. Where should the photo service get that value? 1 of 3

Choose one answer.

The lookup for a photo's legal hold times out, so resource.legal_hold is missing. A permit lets picture editors delete photos. Which way of writing the legal hold requirement refuses the deletion? 2 of 3
Ivy's access token says "desk": "sports" and was issued at 11:40. HR moves her to the news desk at noon. At 12:05 a rule reads the desk claim from that same token. What does it see? 3 of 3

Choose one answer.

Try it in the Lab

We value your privacy

We use cookies and similar technologies to enhance your browsing experience, and analytics to understand our traffic. By clicking "Allow all", you consent to optional analytics. Cookie Policy

Learn identity