Join our Newsletter — 33% off our NHI Course

Refresh-Token Persistence

The condition where a stolen credential can be renewed repeatedly without repeated compromise of the endpoint. In NHI programmes, persistence matters more than initial theft because it extends the lifetime of access beyond the point where the original compromise was discovered.

Expanded Definition

Refresh-token persistence describes a failure mode in which a stolen refresh token, or a token chain anchored by one, can be used to obtain new access tokens for an extended period without needing to re-compromise the endpoint. In NHI and agentic AI environments, that means the attacker owns continuity, not just a momentary session.

This is different from simple access-token theft. An access token may expire quickly, but a refresh token can extend identity validity across many renewals unless rotation, revocation, binding, and anomaly detection are enforced. The concept is closely related to token lifecycle governance in NIST SP 800-53 Rev 5 Security and Privacy Controls, although no single standard governs refresh-token persistence as a standalone term. In practice, definitions vary across vendors because some focus on OAuth mechanics while others include session continuation in agents, CI/CD workloads, and API integrations.

For NHI programs, the issue is not whether a token was stolen once. The issue is whether that token can keep minting new authority after discovery, even when the original workload, pipeline, or application has already been inspected. The most common misapplication is treating refresh-token theft as a short-lived session event, which occurs when organisations monitor the first compromise but fail to model renewal chains and revocation lag.

Examples and Use Cases

Implementing refresh-token controls rigorously often introduces operational friction, requiring organisations to balance user or workload continuity against tighter renewal rules, shorter lifetimes, and more frequent reauthentication.

  • A CI/CD runner stores an oauth refresh token in a build artifact. After the runner is rebuilt, the attacker still renews access because the token was never revoked, echoing patterns seen in the Salesloft OAuth token breach.
  • An internal AI agent uses a long-lived refresh token to call a data platform and email service. If that token is copied from logs, the agent can be impersonated until the refresh chain is broken, a risk that aligns with the Guide to the Secret Sprawl Challenge.
  • A SaaS integration rotates access tokens every hour, but leaves refresh tokens valid for months. Security teams see no active compromise until the attacker starts silently minting new access tokens from another location.
  • A developer commits a refresh token into a private repository. The repository is cleaned up, but the token remains usable because the provider has no immediate revocation signal.
  • A shadow AI application requests repeated token renewal across multiple APIs. The organisation assumes endpoint hygiene is enough, but persistence survives because the credential is valid outside the endpoint boundary.

For implementation guidance, teams often compare token handling patterns against OAuth security guidance and RFC 9700, especially when deciding whether rotation, sender-constraining, or one-time-use refresh flows are required.

Why It Matters in NHI Security

Refresh-token persistence is dangerous because it turns one exposure into a durable access path. In NHI environments, that usually means secrets sprawl, weak offboarding, or overly broad token reuse across apps, pipelines, and agents. NHIMG research shows that 91% of former employee tokens remain active after offboarding in the 2025 State of NHIs and Secrets in Cybersecurity from Entro Security, which illustrates how often persistence outlives the original identity lifecycle.

That same persistence makes incident response harder. Detection of the original leak does not end the problem if the attacker can keep refreshing tokens from outside the compromised host. The result is often repeated access to SaaS data, internal APIs, or agent tooling long after the endpoint has been remediated. This is why Internet Archive breach and other token-driven incidents are studied not just for initial intrusion, but for how long identity remained usable after discovery.

Organisations typically encounter the consequence only after repeated suspicious renewals, at which point refresh-token persistence becomes operationally unavoidable to address.

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.

Framework Control / Reference Relevance
OWASP Non-Human Identity Top 10 NHI-02 Refresh-token persistence is a secret lifecycle and revocation failure in NHI programs.
NIST CSF 2.0 PR.AC-1 Persistent token reuse weakens access control and identity assurance.
NIST SP 800-63 Digital identity guidance informs session continuity, reauthentication, and credential renewal risk.
NIST Zero Trust (SP 800-207) ID.AM-5 Zero Trust requires continuous verification, not permanent trust from a cached token.
NIST AI RMF GV-4 AI risk governance must account for persistent agent credentials and replayable authority.

Shorten token lifetimes, rotate refresh tokens, and revoke them when compromise or offboarding is detected.