Pseudonymous, identified, authorized: auth levels and pairwise subjects

How AAuth resource auth levels (pseudonymous, identified, authorized and none) control identity claims in auth+jwt tokens, how HMAC-SHA256 pairwise subjects prevent cross-API tracking, and why LumoAuth fails closed when consent evidence is missing.

When an AI agent acts for a person across several APIs, sending the user’s global ID and email to every endpoint lets those services link and track that person. AAuth separates permission to call an API from disclosure of the user’s identity through a per-resource setting called defaultAuthLevel. In LumoAuth, authorized (the default) releases the user’s real ID and profile claims only when explicit consent evidence exists for that user, agent and resource. Without that evidence, LumoAuth fails closed to a pairwise subject (sub) derived with a server secret and drops all other identity claims.

TL;DR

  • defaultAuthLevel controls which identity claims for the user appear in an auth+jwt when a user is bound and openid was granted. It does not control whether a user sees a consent screen.
  • LumoAuth supports four levels in token issuance: authorized (default, also applied to unregistered resources), identified, none (requires confirmation in the portal) and pseudonymous (honored when stored on a resource record).
  • Under authorized, explicit consent evidence is a redeemed authorization code for that exact (organization, user, agent, resource) tuple. Without one, LumoAuth emits only a pairwise sub and audits aauth.consent_record_missing.
  • Pairwise subjects use base64url(HMAC-SHA256(key, "aauth-pairwise|<org_id>|<resource_identifier>|<user_id>")) with a server-held key, producing a stable 43-character opaque string per resource.
  • Identity scopes (openid, profile, email, phone, address) never appear in scope, and a pairwise sub never escalates back to a real user across a multi-hop token exchange.

What defaultAuthLevel controls (and what it does not)

If you have not read the earlier posts in this series, start with What is AAuth? for the protocol overview and Why a stolen AAuth token is useless for how keys bind to tokens.

Teams often mix up two separate checks in AAuth:

  1. Must a user approve this request? The agent’s registration answers this during request_type=auth, based on its User-in-the-loop authorization switch and its Pre-authorized scopes.
  2. How much of the user’s identity goes into the auth+jwt? The resource’s defaultAuthLevel answers this at token issuance, after a user is bound and openid has been granted.

If no user is bound to the grant (machine-to-machine authorization), or if openid was not granted, defaultAuthLevel adds nothing. The issued auth+jwt carries no sub, no name and no email.

Identity scopes versus resource scopes

AAuth keeps identity scopes separate from resource scopes:

Scope requested Appears in scope claim? Claims added (only when real user identity is released)
openid No sub (real user ID, or pairwise pseudonym when pseudonymous or failed closed)
profile No name, given_name, family_name (each included only when set on the user)
email No email, email_verified
phone, address No Accepted and granted, but LumoAuth emits no claim for them
Resource scopes (for example email:read) Yes Space-delimited in scope

The four auth levels, side by side

When a user is bound and openid was granted, LumoAuth looks up the target resourceIdentifier in the organization. If the resource is unregistered (an external API), LumoAuth defaults to authorized so identity fails closed.

defaultAuthLevel Consent record required? sub claim profile and email claims Offered in portal form?
authorized (default; also unregistered resources) Yes — redeemed code for (org, user, agent, resource) Real user ID if consent record exists; otherwise pairwise pseudonym (43 chars) Included with consent record; suppressed without one Yes (recommended)
identified No Real user ID Included for granted identity scopes Yes
none No (states resource serves callers without an auth token) Real user ID if a token is requested anyway Included for granted identity scopes Yes (requires confirmation checkbox)
pseudonymous No (always pseudonymous) Always pairwise pseudonym (43 chars) Never included, even if profile or email was granted No (honored if stored on the record)

Notice the security boundary around none. Setting none tells LumoAuth that the API serves callers without requiring an auth token, so LumoAuth only handles calls where an agent asks for a token anyway. Because an issued token there carries user identity like identified, the portal displays a warning and requires an explicit confirmation box before saving none.

What counts as explicit consent evidence under authorized?

In LumoAuth, consent evidence is a redeemed (used = true) AAuthAuthorizationCode record that matches all four fields:

  • the organization
  • the user (userId)
  • the agent (agentIdentifier)
  • the target resource (resourceIdentifier)

That record is created only when the user approves that specific agent for that specific resource on the consent screen and the agent redeems the 60-second code.

When can an auth+jwt be issued for a user without a consent record for the target resource? The classic case is multi-hop token exchange (request_type=exchange). Suppose Alice approved Agent A to call Resource 1, and Agent A later exchanges its auth+jwt so Agent B can call Resource 2. Alice consented to (Agent A, Resource 1), never to (Agent B, Resource 2).

If Resource 2 is configured as authorized (or is unregistered), LumoAuth checks for a redeemed authorization code for (org, Alice, Agent B, Resource 2), finds none, and fails closed:

  1. sub is replaced with Alice’s pairwise pseudonym for Resource 2.
  2. name, given_name, family_name, email and email_verified are omitted completely, even if the upstream token carried them.
  3. LumoAuth writes a failure entry to the audit log: aauth.consent_record_missing, carrying agent, resource and user_id.

Compare the two token payloads side by side when openid and email were granted:

// With consent record (or defaultAuthLevel = identified)
{
  "iss": "https://app.lumoauth.dev/orgs/acme-corp/api/v1",
  "aud": "https://api.mailservice.com",
  "agent": "https://email-agent.aiservices.com",
  "scope": "email:read",
  "sub": "019a4f2c-8b3e-7d10-9c4a-6e2f1b8d3a50",
  "email": "alice@acme-corp.com",
  "email_verified": true
}
// Without consent record under authorized (or defaultAuthLevel = pseudonymous)
{
  "iss": "https://app.lumoauth.dev/orgs/acme-corp/api/v1",
  "aud": "https://api.mailservice.com",
  "agent": "https://email-agent.aiservices.com",
  "scope": "email:read",
  "sub": "w0T5iRrSXSg5aCi37GPGG1azJJRYrFHWibQOavkg0aM"
}

If Resource 2 is an internal API that genuinely needs Alice’s real identity across a multi-hop exchange without a second consent screen, register Resource 2 with identified instead of authorized.

How the formula for pairwise subjects works

OpenID Connect Core 1.0 section 8.1 defines pairwise subject identifiers so that two relying parties cannot correlate a single user across services. LumoAuth applies that design to AAuth resources with one formula:

input = "aauth-pairwise|" + org_id + "|" + resource_identifier + "|" + user_id
sub   = base64url(HMAC-SHA256(server_secret_key, input))

Three design choices make this formula safe:

  1. HMAC-SHA256 with a secret key, not bare SHA-256. With an unkeyed hash, an attacker with the organization ID, the resource URL and a list of user IDs could hash each string and test whether it matches sub. Using a secret key that only the authorization server holds stops dictionary and correlation guesses.
  2. Scoped to both organization and resource. Including org_id and resource_identifier means the same person gets a different sub at every API and across different organizations.
  3. Opaque base64url output (43 characters). Every SHA-256 HMAC is 32 bytes, which encodes to 43 base64url characters without padding. A resource must store and compare sub as an opaque string byte for byte, never parse it as a UUID.

Here is a small Node.js demonstration of how one user receives three unrelated, deterministic pseudonyms across two APIs and two organizations (using an illustrative key; in production only the authorization server holds the key):

import crypto from 'node:crypto';

function pairwiseSub(serverKey, orgId, resourceIdentifier, userId) {
  const input = `aauth-pairwise|${orgId}|${resourceIdentifier}|${userId}`;
  return crypto.createHmac('sha256', serverKey).update(input, 'utf8').digest('base64url');
}

const demoKey = 'demo-server-only-key';
const userId = '019a4f2c-8b3e-7d10-9c4a-6e2f1b8d3a50';

console.log('mail (org 42):    ', pairwiseSub(demoKey, 42, 'https://api.mailservice.com', userId));
console.log('calendar (org 42):', pairwiseSub(demoKey, 42, 'https://api.calendarservice.com', userId));
console.log('mail (org 99):    ', pairwiseSub(demoKey, 99, 'https://api.mailservice.com', userId));

Running the script prints three distinct 43-character strings:

mail (org 42):     w0T5iRrSXSg5aCi37GPGG1azJJRYrFHWibQOavkg0aM
calendar (org 42): KBU9z5ix7hcWioUDLUOeKzVQJNlNMrW3hdo3uEvQn1I
mail (org 99):     Oof1bqMWwaTX9PWuWPbrQvatfvPkRMy6-YosMW9_n_8

Calling pairwiseSub again for mail (org 42) returns w0T5iRrSXSg5aCi37GPGG1azJJRYrFHWibQOavkg0aM every time, so the mail API can still associate returning requests with the same local profile.

What happens to a pairwise sub in multi-hop exchange?

A pairwise sub is a privacy boundary that works in one direction. When an agent presents an upstream auth+jwt to request_type=exchange, LumoAuth looks up the upstream sub as a local user only if it is a valid user UUID belonging to that organization.

Because a pairwise pseudonym is not a user UUID, LumoAuth resolves no local user for the downstream token:

  • The downstream auth+jwt receives no sub, name or email claim of its own.
  • The upstream pairwise sub stays inside act.sub so audit logs still trace the chain of hops.

Once an identity has narrowed to a pseudonym, no downstream exchange can turn it back into a real user ID or email address.

How LumoAuth does it

Configure each API’s auth level in the Organization Portal:

  1. Go to AI Agents → Agents (/portal/agents) and open the AAuth resources tab.
  2. Click Register resource (/portal/aauth/resources/create), or edit an existing resource.
  3. Under Authorization, choose Default auth level:
    • Authorized — an auth token is required (recommended): keeps user identity behind explicit consent and fails closed to a pairwise pseudonym when no consent record exists.
    • Identified — the agent’s identity is enough: releases real user identity for granted identity scopes without checking for a consent record.
    • None — the resource needs no auth token (needs confirmation): for public resources; requires ticking the confirmation box and shows a warning badge wherever the resource is listed.
  4. Watch Audit logs for aauth.consent_record_missing if an API registered as Authorized receives pairwise sub values during multi-hop exchanges when you expected real user IDs.

For the normative token claim rules, see AAuth 1.0 specification, section 2.3. For the full walkthrough of AAuth, see the AAuth overview.

Standards involved

The full list is on the standards reference.

FAQ

What is a pairwise subject identifier for an AI agent? A pairwise subject identifier is a per-resource, opaque sub value computed for one user at one API. The same user receives the same sub whenever an agent calls that API, and a different sub at every other API, so two services cannot join their logs to track that person.

Does defaultAuthLevel control whether a user sees a consent screen? No. Whether a user must consent during request_type=auth depends on the agent’s registration: whether user-in-the-loop authorization is on, and whether every requested scope is pre-authorized. The resource’s defaultAuthLevel controls which identity claims LumoAuth puts inside the issued auth+jwt.

What happens when a resource uses authorized and no consent record exists? LumoAuth fails closed on user identity. Instead of releasing the real user ID, name or email, it sets sub to the user’s pairwise pseudonym for that resource, drops all other identity claims, and writes aauth.consent_record_missing to the audit log.

Why does LumoAuth compute pairwise subjects with HMAC-SHA256 instead of plain SHA-256? Without a secret key, anyone with the organization ID, the resource URL and a user ID could compute the hash and match it back to the person. Using HMAC-SHA256 with a server-held secret prevents any resource or agent from computing or reversing the pseudonym.

Can an auth+jwt carry a user’s sub without the openid scope? No. LumoAuth adds identity claims for the user only when a user is bound to the grant and the openid scope was granted. Without openid, sub, profile and email claims are omitted completely, regardless of the resource’s auth level.

Why is pseudonymous not shown in LumoAuth’s portal dropdown for AAuth resources? The form in the Organization Portal offers Authorized (the default), Identified and None (with an explicit confirmation box). LumoAuth’s token service still honors pseudonymous whenever a resource stores that value, and Authorized without a consent record produces the exact same pairwise pseudonym.


Related: AI agent identity and token exchange and delegation on the solutions pages, What is AAuth? and Why a stolen AAuth token is useless on this blog.

Register your first AAuth resource with the AAuth quickstart.

Last updated .

Ship passwordless sign-in this week. Put guardrails on your agents today.

The Developer plan is free for 10,000 monthly users and ten agents, with no card. Everything uses open standards, so moving in or out is a config change.