Skip to main content

Command Palette

Search for a command to run...

Security

Trusted issuers

A trusted issuer is a server you run that signs tokens Cursor accepts. Your server signs a short assertion with its private key, and Cursor exchanges it for a short-lived access token that acts for one member of your team or organization.

An admin sets up the issuer once and chooses its scopes and token lifetime. Members don't approve anything. A token works only inside the team or organization that owns the issuer.

Cursor holds only your public keys. Your private key never leaves your server, and there is no client secret or refresh token to store.

When to use a trusted issuer

Use a trusted issuer when your server and the people it acts for belong to the same team or organization. Use an OAuth application when your application serves users outside it, and each user must approve access.

Trusted issuerOAuth application
Best forYour own backend, acting for members of your own team or organizationAn app that users from any team can connect
Who approves accessAn admin, once, when they set up the issuerEach user, on a Cursor consent page
Who it can act forMembers of the team or organization that owns the issuerAny user who approves the app
Client proofA JWT signed with your private keyA client secret
TokensShort-lived access tokens, no refresh tokenAccess tokens and rotating refresh tokens

How it works

Loading diagram...
  1. An admin creates the issuer, chooses its scopes and token lifetime, and registers its public keys in the dashboard.
  2. When your server needs to act for a member, it signs two JWTs and posts them to the token endpoint.
  3. Cursor verifies them, checks that the member belongs to the issuer's owner, and returns an access token.
  4. When the token expires, your server signs a new pair and exchanges again.

Before you start

  • Role. You need permission to manage API keys for the owner: a team admin for a team's issuers, or an organization admin for an organization's issuers.
  • A signing key. Create an RSA or EC key pair on your server. See Signing keys.
  • Members only. An issuer acts only for members of the team or organization that owns it. Its tokens never reach a member's Personal account or another team.
  • Personal API keys allowed. Cursor treats tokens from an issuer like the member's personal API keys. If a team turns off personal API key creation, its members can't receive tokens.

Manage issuers

Issuers live under Trusted issuers on the API Keys page of the dashboard. Cursor may ask you to sign in again before you create or change an issuer.

Create an issuer

1

Open the create page

Under Trusted issuers, select Create issuer or New trusted issuer. Either one opens the Create trusted issuer page.

2

Enter the details

Enter a Name, such as "Production token issuer".

3

Choose scopes

Under Scopes, select the scopes the issuer can request. Choose the smallest set that works.

4

Choose the token lifetime

Set how long each access token lasts. Choose the shortest lifetime that covers the work.

5

Create the issuer and copy the client key

Select Create issuer, then copy the Client key into your issuer's configuration. Client keys start with authority_client_.

6

Register a public key

Select Manage keys in the issuer's menu, or Register key on the issuer. Paste one public JWK or upload a JWK file, then select Register key.

Issuer settings

SettingRequiredRules
NameYesIdentifies the issuer in the dashboard.
ScopesYes1 to 32, from the same catalog as OAuth application scopes. A token can carry only these scopes.
Token lifetimeYesHow long each access token lasts. See Token lifetime and scopes.
Public keysYes, to exchangeUp to 5 active keys. See Signing keys.

Cursor verifies your JWTs against the public keys you register. It doesn't fetch keys from a JWKS URL or a discovery document, and there is no issuer URL or claim mapping to configure. The issuer, audience, and subject values are fixed. See Sign the JWTs.

Signing keys

AlgorithmKey typeRequired JWK members
RS256RSA, 2048 bits or morekty, alg, use, n, e
ES256EC, curve P-256kty, alg, use, crv, x, y
  • Set use to sig and alg to the algorithm in the table.
  • Leave out kid. Cursor assigns each key a key ID and shows it in the issuer's key list. Put that ID in the kid header of every JWT you sign with the key.
  • Register the public key only. A JWK with private key members, or with members other than those listed, is refused.

An issuer can hold more than one key, so you can register a new key before you stop signing with the old one.

Edit an issuer

Open the issuer's menu and select Edit issuer, or select Edit on the issuer. You can change the name, scopes, and token lifetime. The client key stays the same.

Changes apply to new exchanges. If you remove a scope, new tokens no longer include it.

Disable or delete an issuer

Each issuer has these actions in its menu. Revoke key is in the issuer's key list.

ActionEffect on the issuerEffect on existing tokens
Disable issuerExchanges are refused. Keys are kept. Enable issuer turns it back on.Tokens stop working while the issuer is disabled.
Revoke keyThe key stops verifying JWTs.Every token the issuer minted is revoked, including tokens signed with its other keys.
Revoke issuerPermanent. This is how you delete an issuer. It can't be edited or enabled again.Every token is revoked.

These actions apply to tokens that are already issued, not only to new exchanges.

If a signing key is exposed, revoke that key, register a new one, and resume exchanges.

Exchange an assertion for a token

Sign the JWTs

Your server signs two JWTs for each exchange, both with a key registered for the issuer:

  • The assertion proves the request comes from your issuer.
  • The subject token names the member and the scopes you want.

Both use the same header, with a different typ:

{  "alg": "ES256",  "kid": "YOUR_KEY_ID",  "typ": "authority-assertion+jwt"}

The subject token's typ is authority-subject+jwt.

Assertion claims:

{  "iss": "YOUR_CLIENT_KEY",  "sub": "YOUR_CLIENT_KEY",  "aud": "https://api2.cursor.sh/auth/authority/token",  "iat": 1767225600,  "exp": 1767225660,  "jti": "UNIQUE_ASSERTION_ID",  "subject_token_sha256": "BASE64URL_SHA256_OF_SUBJECT_TOKEN"}

Subject token claims:

{  "iss": "YOUR_CLIENT_KEY",  "sub": "USER_SUBJECT",  "aud": "cursor-authority-mint:api2.cursor.sh",  "scopes": ["team.members.read"],  "iat": 1767225600,  "exp": 1767225660,  "jti": "UNIQUE_SUBJECT_ID"}
ClaimAssertionSubject token
issThe issuer's client key.The issuer's client key.
subThe issuer's client key.The account subject identifier of the member. It's the value OAuth token introspection returns as sub.
audThe token endpoint URL, as one string.cursor-authority-mint: followed by the host of the token endpoint.
iat, expRequired. Keep the lifetime at 60 seconds or less.Required. The lifetime can't exceed 5 minutes.
jtiRequired. Accepted once.Required. Accepted once.
subject_token_sha256The SHA-256 hash of the subject token string, base64url-encoded without padding.Not used.
scopesNot used.An array of the scopes to grant. Each must be one of the issuer's scopes.

Both JWTs follow these rules:

  • The header can contain only alg, kid, and typ.
  • Each JWT can be at most 8 KiB.
  • Cursor allows 30 seconds of clock skew.
  • A jti can't be reused. Sign a fresh pair for every exchange.

Token request

Post the pair to POST /auth/authority/token as a form:

curl -X POST https://api2.cursor.sh/auth/authority/token \  -d grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer \  -d client_id=YOUR_CLIENT_KEY \  -d assertion=SIGNED_ASSERTION_JWT \  -d subject_token=SIGNED_SUBJECT_JWT \  -d expires_in=900
FieldRequiredDescription
grant_typeYesMust be urn:ietf:params:oauth:grant-type:jwt-bearer.
client_idYesThe issuer's client key.
assertionYesThe signed assertion JWT.
subject_tokenYesThe signed subject JWT.
expires_inNoA shorter token lifetime than the issuer's setting, as a positive whole number of seconds.

Token response

{  "access_token": "ACCESS_TOKEN",  "token_type": "Bearer",  "expires_in": 900,  "scope": "team.members.read"}

scope is a space-separated list of the scopes the token carries. Send the access token as a Bearer token on API requests:

curl https://api.cursor.com/teams/members \  -H "Authorization: Bearer ACCESS_TOKEN"

Token lifetime and scopes

  • An admin sets the token lifetime on the issuer. Set expires_in in the request to ask for a shorter one. Read expires_in in the response for the value you got.
  • A token carries only the scopes in the subject token, and each must be one of the issuer's scopes.
  • A token reaches only the team or organization that owns the issuer. It never reaches a member's Personal account.
  • There is no refresh token. Exchange again when the token is close to expiry.

Ask for the shortest lifetime that covers the work.

Errors

Errors use the OAuth 2.0 error format:

{  "error": "invalid_scope",  "error_description": "DESCRIPTION"}

The wording of error_description can change, so branch on error.

StatuserrorCauseWhat to do
400invalid_requestclient_id, assertion, or subject_token is missing, or expires_in isn't a positive whole number.Fix the request.
400unsupported_grant_typegrant_type isn't the JWT-bearer grant.Fix the request.
400invalid_grantA JWT has a bad signature, wrong claims, an expired lifetime, or a reused jti. Or the user is unknown, or isn't a member of the team or organization that owns the issuer.Check your claims and clock, then sign a new pair. Check that the user still belongs to the team or organization.
400invalid_scopeThe requested scopes are empty, or include a scope the issuer isn't registered for.Request fewer scopes, or ask an admin to add the scope to the issuer.
401invalid_clientThe client key is unknown, the issuer is disabled or revoked, or it has no registered key. The response carries a WWW-Authenticate: Bearer header.Check the client key, the issuer's status, and its keys.
403access_deniedA team the user belongs to has turned off personal API key creation.Ask that team's admin to allow it, or stop exchanging for this user.
403team_ip_allowlist_violationThe request came from an address that isn't on the IP allowlist of one of the user's teams, or of their organization.Call from an address on that list, or ask its admin to add your issuer's egress addresses.
403tenant_restriction_violationYour network adds a tenancy restriction to the request, and it doesn't allow the user's account.Exchange for an account the restriction allows, or update the restriction.
429Too many requests.Slow down, then retry with backoff.
503temporarily_unavailable or team_ip_allowlist_unavailableCursor couldn't complete a check.Retry with backoff.

invalid_grant returns the same description for every cause, and invalid_client does the same. Check the JWT rules and the issuer's status when you see them.

Operate an issuer safely

  • Keep the private key in a KMS or HSM. Sign through the key service, and never export the key.
  • Request narrow scopes. Ask for the scopes one task needs in each subject token, not everything the issuer allows.
  • Keep tokens short. Choose a short token lifetime on the issuer, set expires_in to match the work, and don't store access tokens.
  • Sync your clock. A drifting clock causes invalid_grant.
  • Call from known addresses. Each exchange is checked against the IP allowlists of the teams and organization of the user the token is for. Make sure your issuer's egress addresses are on those lists.
  • Review the audit log. Each exchange is recorded for the issuer's owner. See Audit logs.