Permissions and access tokens
Look up permission targets, actions, organization roles, supported instance types, and access-token commands.
Permissions define what a credential can do. Use this reference when choosing API-key permissions, creating an access token, or assigning a workload role. The same permission syntax appears in all three places, but each accepts different grants.
Permission syntax
A permission is resource:target:action, such as android:android_euna_01h455vb4pex5vsknk084sn02q:all or asset:name/releases/app.ipa:read.
The fields have these meanings:
| Field | Meaning |
|---|---|
resource |
A resource name from the tables below. Organization admin roles can also grant *:*:all. |
target |
A resource ID, * for all resources of that kind in the organization, name/<name-or-pattern> for assets, or name/<name> or name/<folder>/* for instances. Each credential type restricts which targets it accepts. |
action |
An operation such as read or upload. all includes every action for that resource. The action wildcard is spelled all, never *. |
Use IDs exactly as the API returns them. The first and last colons separate the fields, so an asset name can contain colons. Names are literal, without percent encoding. Asset patterns support case-sensitive * and ?, including across slashes and colons. See asset permission targets.
Instance types
Each instance type has its own permission resource. Xcode IDs start with xcode_ or sandbox_, and both use the xcode permission resource.
| Instance type | Permission resource | ID prefix | Access-token grant |
|---|---|---|---|
| iOS simulator | ios |
ios_ |
ios:<instance-id>:stream or ios:<instance-id>:control |
| Android emulator | android |
android_ |
android:<instance-id>:stream or android:<instance-id>:control |
| Xcode sandbox | xcode |
xcode_ or sandbox_ |
xcode:<instance-id>:control |
| Gradle sandbox | gradle |
gradle_ |
gradle:<instance-id>:control |
Instance actions have different uses and issuance rules:
| Action | Instance types | What it permits | Accepted by access-token create? |
|---|---|---|---|
read |
All four | Read instance records and supported persisted logs or snapshots, without control credentials. | Yes. |
stream |
iOS, Android | Interactive screen streaming and supported viewer actions. | Yes, for an instance ID or *. |
control |
All four | Read the instance and use its runtime endpoints, without creating, updating, or deleting instance records. | Yes, for an instance ID or *. |
create |
All four | Create an instance. The response includes a control token for the new instance. | Yes, with target *. |
update |
All four | Update instance labels, role, secret references, or an Xcode cache key. Changing the role also requires authority over every supplied permission. | Yes, for an instance ID or *. |
delete |
All four | Delete an instance. | Yes, for an instance ID or *. |
all |
All four | Every supported instance action, including control and lifecycle management. | Yes, for an instance ID or *. |
work |
Xcode, Gradle | Start a sandbox as a remote build worker, without general sandbox control. | Yes. |
tunnel |
iOS, Android | Access the instance’s destination tunnel endpoints, without device control or streaming. | Yes. |
The instance action tunnel differs from the resource permission tunnel:<tunnel-id>:connect, which lets a connector join a private tunnel. See Private tunnels.
Using reuseIfExists also requires control on the matched instance. A create-only credential receives 403 if a matching instance exists. Binding an Xcode cache key after creation requires xcode:<instance-id>:update; the default instance token cannot bind it.
The default status.token grants <resource>:<instance-id>:control. It can operate that instance and read its record, but cannot create, update, or delete instance records. read, update, and delete alone do not return control credentials. Existing all grants retain their full access.
An access token can use the same operations as an API key when its permissions cover the operation. A named instance grant permits only its specified action on that instance. control includes reads, runtime endpoints, streaming, and the applicable work or tunnel action. An ios:*:all grant also permits listing and creating iOS instances. Updating a role additionally requires authority to delegate its permissions. For example, ios:*:update cannot add secret:name/signing:read unless the caller also holds that secret permission. Secret references do not grant access themselves. A client that can run code in an instance can use secrets already granted to that instance. Member-session requirements for organization administration still apply.
For iOS and Android, stream grants interactive streaming: screen viewing, touch, typing, and other supported viewer actions. It does not grant app installation, explicit app launch or termination, the device API, or ADB. Supply the instance’s status.endpointWebSocketUrl alongside the token to a streaming client. A stream grant does not permit fetching the instance record to discover this URL. control and all include stream.
The instance response also includes status.streamToken for streaming-only access. Use the returned expiry fields to determine its lifetime. Xcode and Gradle have no device screen stream.
Instance name targets
An instance grant can target instances by name instead of by ID. Names work like folder paths, such as ci/checkout, so a target is either one name or a whole folder:
| Target | Covers |
|---|---|
android:name/ci/checkout:all |
Every Android instance named exactly ci/checkout. |
android:name/ci/*:all |
Every Android instance whose name lies inside ci/, at any depth, such as ci/checkout and ci/nightly/run-1. It does not cover ci itself or cid/checkout. |
A name target takes no other wildcards; /* is valid only at the end. Each segment holds lowercase letters, digits, dots, underscores, or hyphens, and starts with a letter or digit. A name is at most 256 characters and a folder target at most 208, so a default name inside it still fits. A name target accepts read and all, and also stream and watch for iOS and Android.
Names are not unique. A name grant covers every instance with that name, including instances created after the grant, while an ID grant covers only its own instance. It also does not limit how many instances a credential creates: a create without reuseIfExists starts another instance with the same name.
Name targets apply to the instance management API:
readlists and reads the covered instances. Lists leave out other instances, and an instance outside the grant returns404, as if it did not exist.allalso creates, updates, and deletes instances inside the target, and instance responses include each instance’sstatus.token. A create with ametadata.nameoutside the grant returns403.
A create without metadata.name names the instance after its ID, inside the credential’s default folder:
- A credential that acts for a person, such as a login session or personal API key, uses
users/<user-id>. - Any other credential that can create every instance of the type, such as
android:*:all, usesshared. - Otherwise, a credential that can create in exactly one folder uses that folder. With no single folder, the create returns
400and must setmetadata.name.
Instances created before names existed have no name and match only their ID or *.
Instance endpoints, such as status.apiUrl and streaming URLs, do not check names, so they reject a token that holds the instance only through a name target. To hand a client a token those endpoints accept, use the instance’s status.token or status.streamToken, or create an access token for the ID with a credential that holds the instance through its name. For example, a credential holding android:name/ci/*:all and accesstoken:*:all can create android:$INSTANCE_ID:control for an instance named ci/checkout.
To create an access token with a name target, the caller must hold *, the same name, or a folder containing it. API keys hold * targets only, so name targets come from access tokens and workload identity federation bindings.
Access-token permissions
POST /v1/access_tokens, lim access-token create, and lim.accessTokens.create() accept the following permissions when called with an API key, login session, or access token. Every permission must be covered by the caller’s grants. The caller also needs accesstoken:*:all to create or revoke access tokens.
| Resource | Accepted target | Accepted actions | What the token permits |
|---|---|---|---|
ios |
iOS instance ID, name/<name>, name/<folder>/*, or * |
read, control, create, update, delete, stream, watch, tunnel, all |
control operates the instance; lifecycle actions manage instance records. |
android |
Android instance ID, name/<name>, name/<folder>/*, or * |
read, control, create, update, delete, stream, watch, tunnel, all |
control operates the instance; lifecycle actions manage instance records. |
xcode |
Xcode instance ID, name/<name>, name/<folder>/*, or * |
read, control, create, update, delete, stream, work, all |
control operates the instance; lifecycle actions manage instance records. |
gradle |
Gradle instance ID, name/<name>, name/<folder>/*, or * |
read, control, create, update, delete, stream, work, all |
control operates the instance; lifecycle actions manage instance records. |
asset |
Asset ID, name/<name-or-pattern>, or * |
read, create, upload, update, delete, all |
Perform the asset operations described below. create requires a name target or *. |
device |
* |
install |
Start physical-device installation sessions. Also requires asset:<target>:read for the asset being installed. |
applerelay |
* |
connect |
Open the Apple Account authentication relay. Apple credentials remain separate. |
remotecache |
* |
read, all |
Read Bazel cache entries and blobs; all also permits writing cache entries and blobs. |
remoteexecution |
* |
all |
Run actions through the Bazel remote execution service. |
Instance grants accept concrete IDs, name targets, or *. A name target accepts only read and all, plus stream and watch on iOS and Android. Access tokens also accept secret, tunnel, and accesstoken grants when held by the caller. Asset permissions apply to assets used by any instance type. device refers to installation on physical devices, not iOS simulators or Android emulators. The cache and remote execution permissions belong to the organization’s Bazel service, not to one sandbox.
These are the asset actions:
| Action | Effect |
|---|---|
read |
Read asset metadata and obtain download URLs. Listing requires a grant covering the requested selection. |
create |
Create an asset record at a name that does not yet exist. Does not permit uploading bytes by itself. |
upload |
Obtain upload URLs and upload bytes to an asset. Add create if the asset may not exist yet. |
update |
Change asset metadata, such as its display name or expiry. |
delete |
Delete the asset. |
all |
All asset actions for the target. |
Delegating an asset name pattern containing * or ? requires asset:*:<action> or a broader grant. A credential holding only a name pattern can delegate matching concrete names, but cannot delegate another pattern, even an identical one.
Create and revoke
The CLI supports repeated --permission flags:
lim access-token create \
--permission "android:$INSTANCE_ID:control" \
--ttl-seconds 900 \
--json
lim access-token revoke "$TOKEN_ID"
# Or pass the token itself:
lim access-token revoke "$ACCESS_TOKEN"
--json returns the API response, including id, token, permissions, and expiresAt. Save id for revocation. --quiet prints only the token value; --quiet --json keeps the JSON response. CLI revocation accepts either the ID or the lim_st_... token value. For a token, it extracts the JWT jti and sends that ID to the API, authenticated with your API key or login. Tokens without a jti, such as status.token and status.streamToken, cannot be revoked this way. The SDK and REST revoke methods still take an ID.
To grant only interactive streaming, use stream for an iOS or Android instance:
lim access-token create \
--permission "ios:$INSTANCE_ID:stream" \
--ttl-seconds 900 \
--json
The TypeScript SDK exposes the same operations:
import Limrun from '@limrun/api';
const lim = new Limrun(); // Reads LIM_API_KEY.
const access = await lim.accessTokens.create({
permissions: [`xcode:${instance.metadata.id}:control`],
ttlSeconds: 900,
});
// Supply instance.status.apiUrl and access.token to the sandbox client.
// When this credential is no longer needed:
await lim.accessTokens.revoke(access.id);
For REST clients, create with POST /v1/access_tokens and revoke with DELETE /v1/access_tokens/{id}. Authenticate both calls with your customer credential in the Authorization: Bearer ... header. The create body uses permissions and optional ttlSeconds.
Lifetime and revocation
Tokens created with an API key, login session, or access token default to 3,600 seconds and cannot outlive that credential. ttlSeconds accepts integers from 1 through 14,400. Limrun instance identity exchanges default to 600 seconds and accept only shorter lifetimes. External federation uses the binding lifetime, capped by the source JWT expiry.
Revocation applies to the individual token ID. It leaves the minting API key, other access tokens, and running instances unchanged. Already-issued child tokens remain valid, but each descendant is capped by its parent’s expiry. Repeated delegation cannot extend the original token’s lifetime. Repeating a revoke call is safe.
The management and registry APIs reject revoked tokens once the revocation has propagated. Instance endpoints verify tokens offline and do not check revocation. They continue accepting an otherwise valid access token until it expires or the instance terminates. Revocation does not close an existing connection. Choose the lifetime with these limits in mind.
A token can revoke itself with DELETE /v1/access_tokens at https://sts.limrun.com, using that token in the Authorization Bearer header. Self-revocation requires no accesstoken permission. Revoking another token by ID requires that permission.
Organization roles and API keys
Organization membership has three built-in roles: admin, member, and viewer. Admin has *:*:all. The following table lists each role’s grants; all includes read where supported. A dash means the role has no grant for that resource.
| Resource | What it governs | Admin | Member | Viewer |
|---|---|---|---|---|
ios, android, xcode, gradle |
Instance records, lifecycle, control, and supported logs or snapshots | all |
all |
read |
asset |
Asset metadata and stored files | all |
all |
read |
secret |
Stored signing secrets; read lists metadata, all also reads secret contents and writes or deletes secrets |
all |
all |
— |
apikey |
List, create, and delete API keys | all |
all |
— |
accesstoken |
Create and revoke access tokens | all |
all |
— |
device |
Physical-device installation | install |
install |
— |
applerelay |
Apple Account relay connections | connect |
connect |
— |
remotecache |
Read or write the organization’s Bazel cache | all |
all |
read |
remoteexecution |
Execute Bazel actions | all |
all |
— |
support |
Organization support tickets: open tickets, read conversations, and reply | all |
all |
read |
analytics |
Usage analytics | read |
read |
read |
organization |
Organization settings, domains, SSO, provisioning, and webhooks | all |
read |
read |
member |
Organization members and invitations | all |
read |
read |
billing |
Grants no access. Billing access comes from billing account roles, not organization roles | all |
— | — |
tunnel |
List private tunnels; all also creates, updates, deletes, and issues connector tokens |
all |
read |
read |
nodepool |
List node pools; all also creates, resizes, and deletes them |
all |
read |
read |
API keys and CLI login credentials receive their creator’s permission bundle without organization, member, billing, or API-key administration permissions, or a requested subset. They use * targets; per-instance IDs belong to access tokens. Explicit stream and tunnel actions are not accepted in API-key permission requests.
API keys and access tokens use the same operation permissions. API-key administration and organization membership operations require a member session, and billing operations require a signed-in console session. An API key cannot administer other API keys just because its bundle contains apikey:*:all.
The tunnel:<tunnel-id>:connect permission authorizes a private-tunnel connector. Tunnel credentials come from private-tunnel create and rotate operations, not the access-token create endpoint. Issuing them requires an API key or member session with the required tunnel permission. Access tokens cannot issue these long-lived credentials, including during tunnel creation.
Workload roles
All four instance types accept an inline spec.role.permissions array. This grants the workload access to other resources. It does not limit a separate credential supplied to a process, and it does not change who can control the instance.
Workload roles currently accept only the asset permissions listed above. Named role references such as admin or viewer are not supported. An explicit role: { permissions: [] } grants nothing. Omitting the role uses the organization’s compatibility default, so use an explicit list to choose access deliberately.
Code inside a workload can exchange its identity for an access token carrying its current role or a nonempty subset. It cannot expand its role or renew using the access token alone. See Instance roles for creation, updates, and exchanges.
Compatibility names
Use accessTokens, /v1/access_tokens, and permissions in new integrations. The deprecated SDK property scopedTokens, REST path /v1/scoped_tokens, request field scopes, and permission resource scopedtoken remain compatibility aliases. They refer to access tokens. If a request supplies both permissions and scopes, their sets must match.