Subscribe to the Non-Human & AI Identity Journal

JSON Web Encryption

JSON Web Encryption is a standard for encrypting JSON-based security objects so only the intended recipient can read the payload. In identity systems, it is used to keep claims, scopes, and other sensitive data confidential even when messages travel through intermediaries.

Expanded Definition

JSON Web Encryption, or JWE, is the encryption layer of the JOSE family used to protect the contents of a JSON-based security object so that only the intended recipient can decrypt it. It is distinct from signing, which proves integrity and origin but does not hide the payload.

In NHI and IAM workflows, JWE is most useful when claims, scopes, policy decisions, or token-bound metadata must pass through brokers, gateways, or event pipelines without exposing sensitive details. The practical value is confidentiality in transit and at rest across shared infrastructure, especially when tokens may be inspected by intermediaries that should not read the underlying data. The specification is maintained through the IETF JOSE standards track, while operational controls are usually aligned with broader guidance such as NIST Cybersecurity Framework 2.0.

Definitions vary across vendors when JWE is discussed alongside JWS, nested tokens, or proprietary token wrappers, so implementation guidance should be read carefully rather than assumed. The most common misapplication is treating encryption as a substitute for authorization, which occurs when teams encrypt a token but still expose it to systems that should never receive the claim set.

Examples and Use Cases

Implementing JWE rigorously often introduces key-management and processing overhead, requiring organisations to weigh stronger confidentiality against added latency and operational complexity.

  • A service issues encrypted access tokens to hide role claims from API gateways that only need to forward traffic.
  • An identity provider wraps sensitive consent or attribute data in JWE before handing it to downstream applications.
  • A federation flow protects tenant-specific claims so intermediaries cannot infer customer relationships from token contents.
  • An AI agent exchange encrypts tool instructions or scoped data when payload visibility should be limited to the receiving workload.
  • A platform team pairs JWE with Ultimate Guide to NHIs guidance to reduce exposure of service-account metadata in distributed systems.

These use cases matter because JWE is often selected when a token must survive transit across services that are trusted to route data but not trusted to read it. That is especially relevant in zero trust designs discussed in NIST Cybersecurity Framework 2.0, where data protection is enforced continuously rather than assumed after authentication.

Why It Matters in NHI Security

JWE reduces unnecessary disclosure of secrets-adjacent data inside identity traffic, which is important because NHI environments frequently overexpose credentials, tokens, and service metadata. NHI Mgmt Group research shows that 96% of organisations store secrets outside of secrets managers in vulnerable locations including code, config files, and CI/CD tools, and encrypted token contents can help limit what an exposed intermediary can learn from that sprawl. For broader NHI governance context, the Ultimate Guide to NHIs is a useful reference point.

For practitioners, the key risk is assuming encryption makes a token safe to distribute everywhere. If recipients, key stores, or decryption boundaries are poorly controlled, JWE only shifts the exposure point rather than eliminating it. That is why JWE should be considered alongside key rotation, audience restriction, and workload identity governance rather than as a standalone safeguard. Organisations typically encounter the need for JWE only after a token leak, proxy inspection issue, or integration review reveals that sensitive claims were visible to systems never meant to read them.

When used well, JWE supports least disclosure in NHI traffic and helps keep sensitive identity data confined to the smallest possible trust boundary. For mature programs, it complements the confidentiality goals described in NIST Cybersecurity Framework 2.0 and strengthens the case for protecting non-human credentials as carefully as human ones.

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

Framework Control / Reference Relevance
OWASP Non-Human Identity Top 10 NHI-07 Covers token handling and exposure risks for non-human identities.
NIST CSF 2.0 PR.DS-1 Protects data in transit and at rest, which matches JWE confidentiality goals.
NIST Zero Trust (SP 800-207) SC-7 Zero trust requires minimizing trust in intermediaries that route identity traffic.

Treat encrypted tokens as one layer and still enforce strict audience and boundary controls.