Subscribe to the Non-Human & AI Identity Journal

How should security teams govern custom claims in API tokens?

Security teams should treat custom claims as governed access inputs, not convenient metadata. Every claim needs an owner, a source of truth, a freshness rule, and a decision boundary that says whether it can influence authorization. If a claim affects access, it should be reviewed like any other privilege-bearing control.

Why This Matters for Security Teams

Custom claims in API tokens are often treated as harmless convenience fields, but they can become privilege-bearing inputs the moment an application uses them to route access, approve actions, or suppress checks. That makes claim governance an identity control problem, not just a token-formatting issue. NIST’s Cybersecurity Framework 2.0 emphasises asset, identity, and access governance as operational disciplines, which is exactly where custom claims belong. NHIMG’s Top 10 NHI Issues also highlights how quickly identity decisions become brittle when metadata is allowed to drive security logic without ownership.

The core failure mode is drift. A claim starts as a product flag, then becomes a trust signal, then quietly becomes an authorisation shortcut. If no one owns the claim, no one can prove where it came from, how fresh it is, or whether the token issuer is still allowed to assert it. In practice, many security teams discover claim abuse only after an application has already treated stale or untrusted data as an access decision.

How It Works in Practice

Govern custom claims the same way you govern privileged attributes: define who can create them, where each value is sourced, how long it remains valid, and whether downstream services may rely on it for access decisions. A claim that influences authorization should be treated as a control surface, not as a developer convenience. That means the token issuer, the application owner, and the security team all need a shared policy for issuance, review, and revocation.

In operational terms, teams should separate claims into three buckets:

  • Informational claims, which help logging or telemetry but do not affect access.

  • Policy-relevant claims, which may influence routing, scope, or privilege and therefore need explicit approval.

  • High-risk claims, which can bypass checks, elevate role, or unlock sensitive actions and must be tightly scoped, short-lived, and auditable.

Use the issuer as the source of truth wherever possible, and avoid letting multiple services mint competing versions of the same claim. Pair that with freshness rules: if the claim reflects status, entitlement, or tenancy, it should expire quickly or be revalidated against authoritative data. Where possible, evaluate claims through policy-as-code at request time rather than hard-coding trust in the application path. That aligns well with guidance in the Guide to the Secret Sprawl Challenge, which shows how unmanaged credential-like material spreads when controls are fragmented, and it fits NIST’s access-governance approach.

Security teams should also log when a claim is used to grant access, not just when the token is issued. That audit trail matters when a claim is later reclassified, revoked, or found to be stale. These controls tend to break down in federated environments with multiple token issuers and loosely governed service-to-service trust, because no single team can enforce consistent claim semantics end to end.

Common Variations and Edge Cases

Tighter claim governance often increases implementation overhead, requiring organisations to balance access speed against assurance. That tradeoff is especially visible in customer-facing APIs, partner integrations, and internal platform teams that move quickly and resist heavy token review. Current guidance suggests keeping custom claims as narrow as possible, but there is no universal standard for which claims are safe to trust across services.

Edge cases usually appear when claims carry business context rather than pure identity data. For example, a tenant identifier may be acceptable if it is issued by a trusted IdP and verified on every request, but dangerous if downstream services infer subscription tier or administrative status from an unverified upstream field. Similarly, claims copied between systems can become stale even when the token itself is technically valid.

NHIMG research on the Salesloft OAuth token breach and the Guide to the Secret Sprawl Challenge underscores a practical lesson: once access-bearing data escapes clear ownership, revocation and review become much harder than initial issuance. The safest pattern is to treat every custom claim as temporary trust, not permanent truth.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP Non-Human Identity Top 10 address the attack and risk surface, while NIST CSF 2.0 and NIST AI RMF set the governance and control requirements practitioners need to meet.

Framework Control / Reference Relevance
OWASP Non-Human Identity Top 10 NHI-03 Custom claims can act like privilege-bearing NHI inputs and need controlled issuance.
NIST CSF 2.0 PR.AC-4 Claim-based access decisions map to identity and access governance outcomes.
NIST AI RMF GOVERN Governance is needed when dynamic claims influence automated access decisions.

Establish accountability, validation, and review for any claim used by automated policy decisions.