Skip to main content
Ask for only what the current step needs. A sign-in step might request an email, while checkout might request a name and address. You name those fields in your rules, as a scope. A step-up that names the scope tells the agent which fields to share and why, and a credential that shares anything else is refused. This page covers naming a scope and checking what a credential shares. Setting the rules is in Set Your Rules.

How a Scope Moves Through the Flow

  1. You name a scope in your rules, with the fields it shares and the reason you ask.
  2. A rule’s step_up requirement names that scope and the keys the credential must prove.
  3. When a request meets that rule, your server or baselayer.js answers with a step-up. It carries the requirement, with the scope’s purpose and fields.
  4. The agent asks its person to approve sharing those fields, and gets a credential minted with exactly them.
  5. Your token route checks the presented credential against the requirement. It holds every required key and shares exactly the scope’s fields, or it is refused.

Name a Scope

Scopes are part of your policy. Each has a name, a purpose the person reads on the consent screen, and the fields it shares:
A requirement names it with "scope": "contact". See Scopes for the limits and the errors a replace can return.

Fields a Scope Can List

These are the details a credential can carry. The technical name is what a scope’s fields and disclosed_fields use. A scope names person fields only for now. The business fields are for minting a business credential.
When a platform mints a business credential, the business details go in disclosed_fields and the acting person’s details go in actor_disclosed_fields, using the person field names.

Readable Values or Hashes

A credential can share a detail in one of two ways. The platform sets the mode when it mints:
  • CLEARTEXT_AND_HASH (default) shares the requested paths. These can be readable values, like email or address.postal_code, and matching hashes, like hashes.email.
  • HASH_ONLY shares only matching hashes. Each requested field is swapped for its hash:
    • email → hashes.email
    • given_name → hashes.name
    • address.* → hashes.address
    Left out: address.usps_validated, address.address_type, and details with no hash (birthdate, birth_year, residency).
A matching hash is sha256: followed by a hex digest of a normalized value. A site can compute the same hash from its own records and match a customer without ever receiving the value.

Which Fields Your Keys Can Back

The keys a requirement asks for decide which fields its scope may hold. The Level 3 keys back every field. Otherwise only a Level 2 field whose key is among them: GET /acceptance/policy lists every field a scope may name in available_fields, with the key that proves it. A policy that names a field the keys can’t back is refused with field_not_backed_by_keys.

Ask for the Fields

When your rules step up a request, answer with the step-up for that rule. Its requirement carries the scope’s purpose and fields:
The agent mints a credential for those fields and sends it to your token route with the nonce.

Enforce the Requirement

The credential the agent presents back must hold every required key and share exactly the scope’s fields:
  • The shared fields are checked against the requirement. A requirement with no scope shares nothing beyond the keys.
  • A credential is refused with scope_violation if it lacks a required key or shares any field other than the scope’s fields. Answer with the step-up again, naming the keys it lacked in missing_keys.
  • The whole credential is refused, so you only ever read what your step asks for.
  • After the check, confirm the fields your step needs are present, then make your site’s decision.
On your pages, baselayer.js runs this check. To run it in your own code, see the Credential Format Reference.

Read the Fields

The shared fields are the credential’s disclosures, each at its dotted path, such as hashes.email. To decode them, see Disclosures.