Use JWTs as identity carriers, not as the place where access rules live. Put stable claims such as user ID, organisation, or a high level role in the token, then send that identity into a separate authorization layer that evaluates live state, relationships, and policy logic. This keeps tokens lightweight, avoids stale permissions, and lets access rules change without redeploying the application.
Why This Matters for Security Teams
JWTs often get overloaded because they are convenient: one signed token can travel across services and prove who or what is calling. The risk is that teams start embedding policy decisions inside the token itself, then discover that access rules have become stale the moment business context changes. That creates brittle authorization, larger blast radius, and difficult revocation. NHI Mgmt Group’s Ultimate Guide to NHIs notes that 97% of NHIs carry excessive privileges, which is exactly the kind of condition that turns a “simple” token design into a security problem.
The better pattern is to treat the JWT as an identity and session envelope, then hand that identity to a separate authorization layer that evaluates current state. That keeps the token lightweight, reduces the temptation to freeze access logic into claims, and makes it possible to adjust policies without reissuing every token. For teams designing governance around secrets and service identities, the principle aligns with broader guidance in the NIST Cybersecurity Framework 2.0: authenticate first, then authorize with controls that remain manageable as the environment changes. In practice, many security teams discover the misuse of JWT claims only after a permissions change has already failed to take effect.
How It Works in Practice
A clean authorization architecture separates three concerns. First, the JWT proves identity and carries only stable claims such as subject, tenant, issuer, audience, and perhaps a coarse role. Second, the application or gateway forwards that identity to an authorization service. Third, the authorization service evaluates policy against live context, not against embedded claims that may now be out of date.
That policy layer can check current group membership, resource ownership, environment, request time, device posture, or relationships between entities. It can also enforce constraints that JWTs are poor at expressing, such as “allow this service account only for this workload during this deployment window.” This is where short-lived decisions matter. If a token is valid for an hour but the underlying entitlement changes after five minutes, the policy engine should be able to deny the request without waiting for the token to expire.
Teams usually get better results when they:
- Keep claims minimal and durable, avoiding permissions lists inside the token.
- Use short token lifetimes where practical, especially for privileged access.
- Validate issuer, audience, algorithm, and expiry on every request path.
- Put business rules in policy-as-code or a dedicated authorization service.
- Log both the token identity and the policy decision for audit and incident review.
That approach is consistent with the lifecycle and governance themes in Ultimate Guide to NHIs — Lifecycle Processes for Managing NHIs, and it maps well to control families in NIST SP 800-53 Rev 5 Security and Privacy Controls where access enforcement must be both least-privilege and auditable. These controls tend to break down in legacy monoliths that make local authorization decisions from token claims because there is no clean way to centralize policy or react to live entitlement changes.
Common Variations and Edge Cases
Tighter token design often increases implementation overhead, so organisations must balance simplicity at the edge against control in the policy tier. That tradeoff matters most when teams support many APIs, service accounts, or delegated workflows that all need different access decisions.
There is no universal standard for how much should live in a JWT. Current guidance suggests keeping only information that is stable, low risk if exposed, and useful for routing or coarse identification. For some systems, a role or tenant claim is enough. For others, even role claims can become misleading if authorisation depends on resource-level relationships or ephemeral business context. In those cases, claims should be treated as hints, not authority.
Two edge cases deserve attention. First, offline validation can make JWTs attractive because services can verify signatures without calling back to an auth server. That is fine for identity proof, but it does not justify embedding policy. Second, microservice environments sometimes copy claims downstream to avoid repeated lookups. That can be acceptable for traceability, but only if downstream services still consult live policy for decisions.
For NHI-heavy environments, the operational lesson is the same as the broader security lesson in the Top 10 NHI Issues: when long-lived access assumptions are hidden inside credentials, revocation and governance both become slower than the attack surface. The safest pattern is to let JWTs say who the caller is, while the policy engine decides what that caller may do right now.
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, OWASP Agentic AI Top 10 and CSA MAESTRO address the attack and risk surface, while NIST AI RMF and NIST CSF 2.0 set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Non-Human Identity Top 10 | NHI-03 | JWTs often protect NHI access, so credential scope and rotation are central here. |
| OWASP Agentic AI Top 10 | A-04 | Autonomous services can chain JWT-authenticated actions, increasing policy bypass risk. |
| CSA MAESTRO | IAM-02 | MAESTRO emphasizes runtime identity and authorization for machine workloads. |
| NIST AI RMF | AI risk governance supports separating identity from decision logic in dynamic systems. | |
| NIST CSF 2.0 | PR.AC-4 | Least-privilege access enforcement depends on current authorization, not token content. |
Keep JWT claims minimal and ensure tokens never substitute for NHI policy or rotation controls.
Related resources from NHI Mgmt Group
- How should security teams implement fine-grained authorization at the API gateway layer without embedding policy logic in application code?
- How should security teams use trust signals without turning them into proof?
- How should security teams use policy as code without turning access governance into a black box?
- How should security teams use AI-assisted policy generation without weakening authorization controls?