Auth0 Management API access tokens last 24 hours by default and cannot be revoked once issued, so keep lifetimes short. The long-lived secret is the application's client secret, which you can rotate in the Dashboard or through the Management API.
Auth0 key types
| Type | Prefix | Secret? | Scope | Expiry |
|---|---|---|---|---|
| Management API access token Cannot be revoked after issue. | — | Yes | The scopes granted per endpoint; audience `https://{yourDomain}/api/v2/` | 86,400 seconds (24 hours) by default, configurable per API |
| Application client secret Rotate in the Dashboard or Management API. | — | Yes | Lets the application request tokens | — |
How to create a Auth0 key
- Find the endpoint's required scopes in the Management API Explorer.
- Obtain a token with those scopes for the audience
https://{yourDomain}/api/v2/.
Limiting what the key can do
Each Management API endpoint needs specific scopes; check the Management API Explorer. Grant only those scopes to the application.
How to rotate a Auth0 key
- Rotate the application's client secret in the Dashboard or through the Management API.
- Update every service using the old secret.
Access tokens expire on their own; set short lifetimes since they cannot be revoked.
How to revoke a Auth0 key
- Access tokens cannot be revoked once issued. Refresh tokens can be revoked in the Dashboard, the Authentication API or the Management API.
If your Auth0 key leaked
- Rotate the client secret.
- Shorten the Management API token lifetime.
- Revoke any refresh tokens that may be affected.
Environment variables and CLI
Auth0's SDKs and docs read the key from AUTH0_DOMAIN, AUTH0_CLIENT_ID or AUTH0_CLIENT_SECRET.
Auth0 CLI (auth0): auth0 login uses a device flow for people; for CI and agents use client credentials with --domain, --client-id and --client-secret
Things that catch people out
- Issued access tokens cannot be revoked, so the 24-hour default is a leak window.
- Tokens for custom audiences count toward your quota and Management API rate limits.
Recent incidents that put Auth0 keys at risk
If you were affected by one of these, rotate your Auth0 keys using the rotation steps above.
- VS Code and Open VSX extensions leaked 550+ secrets, including tokens that could publish updates 2025-10-15
Using your Auth0 key with AI agents
A coding agent that can read your .env file or your shell history can read the key, and anything in its context can end up in logs, transcripts or a prompt-injected request. The safer pattern is to keep the key in a credential broker that performs the authenticated step for the agent and hands back only the result.
BotPassword works this way. For a Auth0 key, these intents fit:
| Intent | What BotPassword does |
|---|---|
run_with | Runs a command with the key injected as an environment variable or a 0600 temporary file, never on the command line, and redacts the key from the output. |
http_request | Makes an authenticated API call after checking the destination against the hosts this key may be sent to. The response comes back with credential-shaped values redacted, and one that holds the key itself is refused. |
cli_login | Lets git, Docker, the AWS CLI and kubectl log in through bpw's credential helper, so the token is fetched when the tool needs it and not written into its config. The helper hands the value to the tool, so the grant is always disclosing. Other tools use run_with; OAuth device logins are planned. |
rotate | Partly built: creates a new key, stores it as pending, verifies it, promotes it, then revokes the old key after a grace period. Today it works for Cloudflare tokens and AWS IAM keys you have set up, and an agent can start it only under a grant with autopilot; other providers cannot be rotated through their API yet. |
Auth0 also publishes its own MCP server. Whatever server the agent uses, keep the credential it authenticates with out of the agent's context.
Set it up in your agent: Aider · Amp · Claude Code · Claude Desktop · Cline · OpenAI Codex CLI · all agents
Frequently asked questions
How long does an Auth0 Management API token last?
24 hours by default, and you can change it per API.
Can I revoke an Auth0 access token?
No. Keep lifetimes short; only refresh tokens can be revoked.
How do I log the Auth0 CLI in without a browser?
Use client credentials with auth0 login --domain --client-id --client-secret.
Can an AI agent use my Auth0 key without seeing it?
Yes, if the key never enters the agent's context. Instead of pasting the key into a chat or leaving it in a .env file the agent can read, keep it in a credential broker that injects it into the command or request on the agent's behalf. BotPassword does this with run_with, http_request, so the agent gets the result and never the value.