Skip to main content

Roles and permissions

You can control who can access your Developer Platform resources and what they can do with them by assigning roles and scopes through permission policies. Each policy combines a role, which defines the actions allowed, with a scope, which defines where those actions apply.

For Developer Platform products, scopes can be set at three levels:

LevelScopeUse when
PlatformAll products on an accountYou want to grant access across Workers, R2, D1, KV, Durable Objects, Queues, Workers AI, Vectorize, Hyperdrive, and other Developer Platform resources.
ProductAll resources in one productYou want to grant access to all Workers, all R2 buckets, or all D1 databases, without granting access to other products.
ResourceOne resource inside a productYou want to grant access to a specific resource, such as an individual Worker or R2 bucket.

Roles

Assign one of these roles to define the level of permission you want to grant:

RoleWhat it allows
Metadata Read-OnlyView resource lists, settings, metrics, logs, and traces. Cannot view product content such as code, data, or stored objects.
Content Read-OnlyEverything in Metadata Read-Only, plus read product content such as Worker code, D1 database rows, or R2 objects. Cannot make changes.
EditorEverything in Content Read-Only, plus update product content and settings. Cannot create or delete resources.
AdminFull control, including creating and deleting resources.

Members, User Groups, and API tokens

Developer Platform permissions can be granted in two ways:

Grant typeBest forHow it works
Members and User GroupsPeople using the dashboard or APIPermissions are inherited when the member signs in to the dashboard or authenticates to the API.
API tokensCI/CD systems, automation, and service accountsThe token receives only the product and resource permissions selected when the token is created.

Members and User Groups

When you assign a role to a member or User Group, that permission applies whenever the user uses the Cloudflare dashboard or API.

For example, if you assign a member Metadata Read-Only at the platform level, they can view settings, metrics, logs, and traces for all Developer Platform products on the account — Workers, R2, D1, and everything else — but cannot view product content like code, data, or stored objects.

If you assign Metadata Read-Only at the Workers product level, they can view settings and observability data for all Workers on the account, but have no visibility into R2, D1, or other products.

If you assign Metadata Read-Only for a single Worker, they can only see settings and observability data for that one Worker. They will not see any other Workers or any other products.

Manage team access with User Groups

If several people on the same team or project need the same access, create a User Group instead of assigning permissions to each member.

Assign the permission policy to the group, then add the relevant members. Each member automatically inherits the group's policy.

API tokens

Use API tokens for CI/CD pipelines, agents, scripts, and other automated systems that need to access Developer Platform resources programmatically.

For example, create an API token with Workers Editor for a deployment pipeline that needs to update and deploy Worker code.

API tokens support product-level and, where available, resource-level permissions. They do not support platform-level permissions. To grant an API token broad Developer Platform access, select the product-level permissions for each product the token needs.

Use granular permissions with Wrangler

Note

The wrangler login OAuth flow does not currently support granular authorization.

To use granular permissions with Wrangler, authenticate with an account-owned API token.

To authenticate Wrangler with an account-owned API token, create a token with only the permissions you need, then set these environment variables:

export CLOUDFLARE_API_TOKEN="<YOUR_API_TOKEN>"
export CLOUDFLARE_ACCOUNT_ID="<YOUR_ACCOUNT_ID>"

Wrangler uses the token's permissions. If the token is scoped to a specific Worker, Wrangler can only perform actions allowed for that Worker.

Wrangler commands can require different permissions depending on what they manage:

What you want to doExample Wrangler commandRequired access
Deploy an existing Workerwrangler deployEditor scoped to that Worker, or Editor at the Workers product scope.
Create a new Workerwrangler deploy for a Worker that does not exist yetAdmin at the Workers product scope.
Tail logs for one Workerwrangler tailMetadata Read-Only scoped to that Worker, or Metadata Read-Only at the Workers product scope.
List KV namespaceswrangler kv namespace listDeveloper Platform Metadata Read-Only at a scope that includes KV.
Create a KV namespacewrangler kv namespace createDeveloper Platform Admin at a scope that includes KV.
Change Routes or Custom Domains during deploymentwrangler deployEditor for the Worker, plus Workers Routes Write for every affected zone.

Bindings

To deploy a Worker that has bindings to resources like Workers KV, R2, or D1, you need Editor access to the Worker. You do not need separate permissions on the bound resources to deploy the Worker.

Permissions on bound resources are only required if you need to access those resources directly, for example, reading KV keys, querying a D1 database, or listing R2 objects.

Common access patterns

Use caseScopeRole
View settings, logs, and metrics across all productsPlatformMetadata Read-Only
Read Worker code without modifying itWorkers productContent Read-Only
Deploy any existing Worker, no access to other productsWorkers productEditor
Change Routes or Custom Domains during deploymentWorkers product and each affected zoneEditor and Workers Routes Write
Rename an existing WorkerIndividual Worker or Workers productEditor
Create or delete WorkersWorkers productAdmin
Automated deployments from CI/CD or agentsAPI token with Workers productEditor
Automated deployments to one specific WorkerAPI token with individual WorkerEditor