Join our Newsletter — 33% off our NHI Course
Authentication, Authorisation & Trust

Non-Expiring Token

← Back to Glossary
By NHI Mgmt Group Updated November 26, 2026 Domain: Authentication, Authorisation & Trust

A Non-Expiring Token is an access token or API key issued without an expiry time, so it stays valid until someone revokes it. A stolen one gives an attacker persistent access with no natural cutoff. Defenders inventory these tokens, set maximum lifetimes, rotate or revoke them, and alert on use from unfamiliar locations.

What a non-expiring token actually changes

A non-expiring token changes the security model from time-bound access to purely revocation-bound access. If the token is copied, logged, or otherwise exposed, the attacker can keep using it indefinitely until the organisation finds and revokes it, so the risk is not just theft but duration of compromise.

This is why non-expiring tokens are treated differently from short-lived credentials. Their value is operational convenience, but their downside is that they remove the natural cutoff that limits replay, stale access, and forgotten integrations.

Why long-lived validity is dangerous

The main danger is persistence. A stolen token behaves like a standing pass, so compromise often continues quietly across systems, environments, and automation workflows until the token is invalidated. That makes these tokens attractive for data theft, lateral movement, and abuse of trusted integrations.

In practice, the risk is amplified when the token is reused across multiple services, stored in scripts or CI pipelines, or granted broad scopes. If a token can access production data or admin functions, a single leak can become a durable incident rather than a short-lived one.

For identity and access governance, the token itself is the access boundary. Service Account Security Guide is useful here because the same failure pattern often appears in non-human accounts, where long-lived credentials outlast the business need that created them.

How organisations should assess and reduce exposure

Exposure starts with inventory. Teams need to know where non-expiring tokens exist, who owns them, what they can do, where they are stored, and whether they are still required. That usually means scanning code, vaults, CI/CD systems, documentation, and application configs for API keys, access tokens, and similar secret material.

Risk reduction comes from replacing indefinite validity with a defined lifetime wherever possible, then narrowing scope so each token can do only what the integration truly needs. If a system cannot tolerate a short expiry, the design should justify that exception explicitly and add compensating controls such as tighter monitoring and stronger storage hygiene.

When the subject is token lifecycle and rotation, Deleted but Not Revoked is directly relevant because simply removing a token from a file or repository does not make it safe. Guide to NHI Rotation Challenges also helps explain why rotation planning, dependency mapping, and fallback handling matter when tokens support automation at scale.

Detection, revocation, and post-exposure review

Detection should focus on behaviour that does not fit the normal use pattern, such as requests from unfamiliar locations, unusual hours, new user agents, or access to resources the token never needed before. Because the token may remain valid for a long time, log review is often the only way to distinguish legitimate automation from abuse.

If misuse is suspected, revocation should be immediate, but response should not stop there. Teams need to review whether the token was used to read data, change configuration, mint other credentials, or create persistence through additional integrations. A durable token often means the attacker had time to do more than a single API call.

External guidance on token hardening is also valuable. RFC 9700: Best Current Practice for OAuth 2.0 Security and RFC 9449: OAuth 2.0 Demonstrating Proof of Possession (DPoP) both support stronger token handling by reducing replay value if a token is stolen.

Safer design patterns for token use

The safest pattern is to avoid non-expiring tokens unless there is a clear operational reason and a compensating control story. Shorter lifetimes, refreshable flows, sender-constrained tokens, and audience restriction all reduce the window in which a stolen token stays useful.

Where non-expiring tokens cannot be eliminated immediately, organisations should isolate them, document ownership, and make revocation easy. That includes explicit expiry caps where the platform supports them, regular review of token usage, and removal of dormant or duplicate credentials.

For the broader control model, OWASP Non-Human Identity Top 10 frames the common failure modes, while NIST SP 800-57 Key Management is useful when the token or key lifecycle needs to be treated as a formal managed asset.

Risk and Threat Considerations

Non-expiring tokens are dangerous because they turn one secret leak into open-ended access. The attacker does not need to race a short expiry window, so compromise can remain active long after the original exposure is discovered.

Failure mechanism: The token is copied from code, logs, a build system, or a repository, then reused until someone finds and revokes it. If the token has broad scope or is embedded in automation, the attacker can blend into normal traffic and keep using the same trusted path.

Impact: Persistent unauthorised access can expose data, alter configurations, or let an attacker establish further footholds through additional credentials or workflows. The longer the token remains valid, the greater the chance that the compromise spreads beyond the original system.

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 addresses the attack and risk surface, while NIST SP 800-57 and NIST SP 800-53 Rev 5 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP Non-Human Identity Top 10NHI-07 — Long-Lived SecretsNon-expiring tokens are long-lived secrets with open-ended replay risk.
NHI-02 — Secret LeakageStolen or exposed tokens remain usable until revoked, matching secret-leakage risk.
Recommendation — Replace indefinite token validity with bounded lifetimes and documented revocation paths. Scan for exposed tokens and revoke them before relying on deletion or cleanup alone.
NIST SP 800-57SC-12 — Cryptographic Key Establishment and ManagementToken and key lifecycle control depends on managed issuance, rotation, and revocation.
Recommendation — Manage token lifecycle with explicit rotation, revocation, and retention rules.
NIST SP 800-53 Rev 5IA-5 — Authenticator ManagementThis control addresses credential lifecycle, including issuance, expiration, and revocation.
AC-2 — Account ManagementToken ownership, lifecycle oversight, and removal of unused access align to account governance.
Recommendation — Enforce expiry, rotation, and revocation for authenticators and shared secrets. Inventory token owners and disable stale access paths promptly.

Practitioner Guidance

Why practitioners should care: Treat non-expiring tokens as exception credentials, not the default. Their convenience is easy to overvalue because the operational pain shows up later, while the security debt accumulates immediately.

What to watch for: Pay special attention to tokens with no owner, no inventory entry, broad scopes, or no documented rotation path. Those are the ones most likely to survive long after the system that created them has changed.

Practitioner takeaway: If a token does not need to live forever, make it expire, and if it must remain long-lived for now, make revocation, monitoring, and ownership explicit before it is accepted into production.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

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