Join our Newsletter — 33% off our NHI Course
Home FAQ Architecture & Implementation Why do JWTs become risky when teams put…
Architecture & Implementation

Why do JWTs become risky when teams put roles into aud?

← Back to all FAQ
By NHI Mgmt Group Editorial Team Updated August 16, 2026 Domain: Architecture & Implementation

JWTs become risky because one claim then carries two unrelated meanings. Audience validation becomes harder to trust, while authorization logic becomes less portable and harder to test. In distributed systems, that ambiguity can lead to rejected tokens, incorrect access decisions, and integration failures across services.

Why This Matters for Security Teams

Putting roles into JWTs sounds convenient, but it turns one claim into two different trust decisions: who the token is for, and what the token is allowed to do. That muddling is risky because audience validation is meant to protect token scope, while roles are meant to inform authorisation. Once those meanings overlap, services begin interpreting the same token differently.

Security teams usually discover the problem when a new service rejects a token that another service accepted, or when a downstream API silently trusts a role claim it should never have relied on. Current guidance from the NIST Cybersecurity Framework 2.0 and NHIMG Top 10 NHI Issues points toward clearer separation of identity, audience, and privilege because ambiguity increases both integration risk and blast radius. In practice, many security teams encounter misuse only after an internal service trusts a token in a way the issuing system never intended.

How It Works in Practice

In a healthy design, aud identifies the intended recipient or resource server, while roles or scopes describe permissions in a separate claim or policy layer. That separation lets each service validate the part it owns: the token issuer proves authenticity, the resource server checks audience, and the application enforces authorisation. When roles are embedded into aud, those boundaries collapse.

The immediate operational problem is portability. A token with aud set to a role is no longer a clean statement of intended recipient, so libraries, gateways, and microservices may reject it or misapply it. The deeper problem is testability. Access logic becomes harder to reason about because a change in one service can break another service’s audience checks without changing any permission model.

  • Keep audience narrow and descriptive of the receiving service or API.
  • Put permissions in scopes, roles, or policy decisions, not in aud.
  • Validate issuer, audience, expiration, and signature before authorisation.
  • Use NIST SP 800-53 Rev 5 Security and Privacy Controls for access control discipline and map token checks to explicit controls.

For NHI-heavy environments, the risk is amplified because machine tokens are reused across services, automation jobs, and CI/CD paths. NHIMG’s Ultimate Guide to NHIs notes that 97% of NHIs carry excessive privileges, which means any confusion in token semantics can widen the impact of a single compromise. These controls tend to break down when one token is accepted by multiple APIs with different audience expectations because the same claim cannot safely represent both recipient and role.

Common Variations and Edge Cases

Tighter token semantics often increase implementation effort, requiring organisations to balance cleaner trust boundaries against migration cost. That tradeoff is especially visible in legacy systems, where teams use aud as a catch-all because it was the easiest field to propagate across services. Current guidance suggests that shortcut should be treated as technical debt, not a stable pattern.

There are a few edge cases. Some gateway patterns use audience-like routing hints internally, but those should not be confused with authorisation claims. In other environments, a token may carry both service targeting and coarse entitlement metadata, yet best practice is evolving toward separating those concerns so that routing, identity, and permission checks can be audited independently. That separation matters even more when external partners or third-party tooling consume the same JWT, because different verifiers may apply different assumptions.

NHIMG research shows how often NHI failures become visible only after damage occurs, not during design review. The 2024 ESG Report: Managing Non-Human Identities found that 72% of organisations have experienced or suspect a breach of non-human identities. That context helps explain why token design deserves as much scrutiny as credential storage. A role hidden inside aud may work until a new service, partner, or verifier interprets it differently, and then the failure becomes an incident rather than a code review comment.

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, NIST SP 800-63, NIST Zero Trust (SP 800-207) and NIST AI RMF set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP Non-Human Identity Top 10NHI-04Token misuse and claim confusion are core non-human identity risks.
NIST CSF 2.0PR.AC-4Access enforcement must stay distinct from authentication and token validation.
NIST SP 800-63JWT validation depends on precise identity and federation semantics.
NIST Zero Trust (SP 800-207)AC-4Zero Trust requires explicit verification of each request and claim.
NIST AI RMFPolicy clarity and traceability are needed when machine identities make access decisions.

Evaluate token audience and privilege at request time instead of assuming trust from issuance.

NHIMG Editorial Note
Reviewed and updated by the NHIMG editorial team on August 16, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org