# Keep an agent's tokens valid through a long or unattended run

> Keep an agent's tokens valid through a long or unattended run: 0 companies fully do it, 13 with a limit, 15 carry the tag. Every listing in Agent auth & delegated access with the reason and a source.

- Canonical: https://www.anchorterminal.com/niches/agent-auth.keep-session-alive/
- Markdown: https://www.anchorterminal.com/niches/agent-auth.keep-session-alive/index.md (~1,550 tokens)
- Slim: https://www.anchorterminal.com/niches/agent-auth.keep-session-alive/index.min.md (~380 tokens, same facts, less prose, for token-sensitive contexts)
- JSON: https://www.anchorterminal.com/niches/agent-auth.keep-session-alive/index.json (this page as data, same URL with Accept: application/json)
- Site index for agents: https://www.anchorterminal.com/llms.txt (the key docs and every listing in one file, at most 16 MB, about 4 million tokens: https://www.anchorterminal.com/llms-full.txt)
- API: https://www.anchorterminal.com/api/v1/index.json
- MCP: https://www.anchorterminal.com/mcp (the whole catalogue as tools, no key)
- DNS: dig +short TXT <slug>.grade.anchorterminal.com (the grade as a DNS TXT record, for a sandbox with no HTTP where names still resolve; also top., best.<category>. and <a>.vs.<b>. under the zone, and the same under grade.letme.dev)
- Licence: CC BY 4.0, credit Anchor Terminal and link this page (https://www.anchorterminal.com/terms/#data)
- Updated: 2026-11-15

No company's docs show a full fit yet. The listings below do the job with a limit, or not at all.

| Companies, full fit | With a limit | Carry the tag | Share of the category's work | First-hand accounts |
| --- | --- | --- | --- | --- |
| 0 | 13 | 15 | 19 | 9 |

## What counts as done

A run that spans at least two access-token lifetimes and two concurrent sessions completes with no re-consent and no 401 reaching the agent, and a refresh failure produces a typed reauth signal within one call.

How agents ask for it: why does the MCP connection expire every day; keep the agent connected overnight; refresh the token without asking me again

## Does the job, with a limit

It does the job, but something in the docs or a user's account will get in an agent's way. The limit is named in each row.

- **Aembit (Aembit, Inc.)**: The gateway refreshes upstream tokens per user, but the agent-to-gateway refresh token works once and relies on the MCP client refreshing; expiry shows as McpSessionExpiredOrRevoked in events, not as a typed reauth signal to the agent.
- **Amazon Bedrock AgentCore Identity (Amazon Web Services, Inc.)**: Stored refresh tokens are used automatically and an expired refresh falls back to a new authorization URL. Nothing addresses concurrent sessions, and AWS warns returned tokens may be invalid, so the agent can still meet a 401 and retry with forceAuthentication.
- **Arcade.dev (Arcade AI, Inc.)**: Provider configs carry a refresh_request, so Arcade refreshes for the tool, and a missing grant shows as status not completed with a URL. Rotation and two sessions refreshing at once are not covered in the docs read.
- **Auth0 for AI Agents (Token Vault) (Okta, Inc.)**: Auth0 refreshes the provider token from the vault on each exchange, but Token Vault does not support Auth0 refresh token rotation, and an open SDK issue says exchange errors are swallowed, so a failure may not arrive as a typed signal.
- **Cloudflare Workers OAuth Provider (Cloudflare, Inc.)**: Refresh tokens rotate with the previous one valid until its replacement is used, and grants last 30 days by default. An open issue reports rotation state racy under concurrent refresh on KV, so two sessions refreshing together can break.
- **Descope Agentic Identity Hub (Descope, Inc.)**: Descope refreshes vaulted tokens and the docs say to fetch on every tool run instead of caching; a missing connection raises a typed error with a connect URL. Concurrent sessions and rotation are not discussed.
- **Keycard (Keycard Labs, Inc.)**: Credentials are exchanged fresh per call, grants show as refreshable, and an expired subject token pauses a Pydantic AI run with a sign-in URL. Refresh behaviour across two sessions and token lifetimes is not documented.
- **Microsoft Entra Agent ID (Microsoft Corporation)**: Autonomous agents mint tokens by client credentials whenever needed, and refresh_token is supported for background OBO work. No typed reauth signal for a failed refresh is described, and Microsoft calls hand-written exchanges error-prone.
- **Nango (Nango Inc)**: Nango refreshes tokens before expiry, at least every 24 hours, and sends refresh-failure and recovery webhooks. Open issue 6136 reports GitHub App connections break about 8 hours after the first refresh because the rotated refresh token is never stored.
- **Scalekit AgentKit (ScaleKit, Inc.)**: Scalekit stores and refreshes tokens; an account that cannot refresh moves to EXPIRED and a connected_account.status_updated webhook fires. The next tool call still fails until the user reauthorises, and concurrent sessions are not discussed.
- **Stytch Connected Apps (Twilio Inc.)**: offline_access yields refresh tokens; public clients rotate them with replay detection, confidential clients do not rotate. Two sessions sharing one public grant risk replay detection, and no reauth signal beyond a 401 is described.
- **Vercel Connect (Vercel Inc.)**: Connect holds the refresh token and the SDK refreshes cached tokens 30 seconds before expiry; a lost grant raises NoValidTokenError or UserAuthorizationRequiredError. Behaviour with two concurrent sessions is not described, and a provider-rejected cached token must be evicted by the caller.
- **WorkOS Pipes and Agents (WorkOS, Inc.)**: Pipes refreshes OAuth tokens on each fetch and returns active false with needs_reauthorization when a grant breaks, a typed signal. Concurrent-session behaviour is not described, and on the inbound side an account shows Claude Code never refreshing AuthKit tokens.

- not this job: Clerk MCP server (Clerk, Inc.): It keeps only its own Clerk sign-in, which the client stores; nothing in the docs covers refresh for long runs or other providers.

## What stops agents finishing

- provider issues no refresh token (GitHub OAuth apps)
- refresh-token rotation with concurrent sessions invalidates the other session
- stored rotated refresh token never updated (Nango issue 6136)
- client does not call refresh on expiry, so the user reconnects daily

## Around it

Before: agent-auth.connect-user-account. After: notifications.push.

## Where this comes from

Weight 19 of 100 in Agent auth & delegated access: 9 of 33 accounts; Claude Code MCP issues alone carry four, with Cloudflare and Nango refresh bugs

As data: https://www.anchorterminal.com/api/v1/use-cases/agent-auth.keep-session-alive.json, or the MCP tool get_use_case with id agent-auth.keep-session-alive. Draft, read 2026-11-15 from public docs and first-hand accounts, not yet reviewed by a person.

---

Query this catalogue directly over MCP: https://www.anchorterminal.com/mcp (Streamable HTTP, no key). How: https://www.anchorterminal.com/agents/#mcp
