Skip to main content
Early Access Feature: Policies beyond connectors are in early access and are not enabled for workspaces by default. Contact your Runlayer team to turn them on. Until then, connector policies keep working as they do today, and a policy on any other resource answers 409 with code unified_policy_engine_inactive. So does a connector policy the connector format can’t express, such as a rate limit or a team principal. Owners and sharers may get 403 instead.
Connector policies decide who can call which tools. The same policies extend to everything else in Runlayer: agents, skills, plugins, artifacts, agent accounts, teams, and the organization itself. Sharing an agent, giving someone an admin permission, and letting one person rotate an agent account’s secret are all policies, decided by the same rules as connector access. For copy-paste examples covering every resource type, see the Access Control Cookbook.

How It Works

Every policy answers one question: who can do what to which resource, and under which conditions. Shares you create in the share dialog, the access a resource’s owner has, and the permissions that come with each role are stored as policies of the same shape. You don’t write those yourself; Runlayer keeps them in step as you share, transfer, and assign roles.

Evaluation

Policies combine the same way as connector rules: no access by default, allows add up, and deny wins. Two details matter more once policies cover every resource:
  • Deny beats everything. A matching deny removes the action even from the resource’s owner, from anyone it was shared with, and from resources shared with the whole organization. “Everyone except group X” is an org allow plus a group deny.
  • Actions are flat. No action implies another. Granting manage_access does not grant view, so list every action the principal needs.
Super admins are the organization’s root account. To restrict one, have a policy administrator write the deny on the resource. That is the only kind of deny certain to apply to a super admin. Don’t rely on a deny written by a resource’s owner or sharer, or on an organization permission deny. A few checks run before resource policies are evaluated and are not subject to them. A connector’s owner, or its creator while it’s still a draft, and holders of the connector-management permission open the connector without a policy check. Calling its tools still goes through connector policies, and editing an active connector or deleting one takes the connector-management permission. Role permissions, such as Manage security policies, come from your roles and from organization permissions, not from policies on a single resource.
Enforcement is live on every open, run, call, and download. List pages don’t yet subtract deny policies, so a resource shared with everyone that you’ve been denied can still appear in a list; opening it answers 403.

Writing a Policy

Policies are managed in Settings → Policies and through POST /api/v1/policies, the same endpoint as connector policies. Instead of the connector format’s action and scope, they name an effect, a resource, and the actions it covers. The examples on this page use the RUNLAYER_URL and API_KEY conventions from the access control recipes.
To change a policy, send the fields you want to change to PUT /api/v1/policies/{policy_id}. To remove it, call DELETE /api/v1/policies/{policy_id}.
Connector policies you already have keep working unchanged. A policy in this format on one connector, naming a user, group, role, agent account, attributes, or Everyone, is saved as a regular connector policy when its actions follow the connector layout, so it also works before early access is turned on. An allow or approval lists view, use, then call_tool: entries, then read_resource: entries, with at least one of each of the last two. A deny lists the call_tool: and read_resource: entries, and starts with view and use only when it covers call_tool:* and read_resource:*. Like any connector policy, it needs the security-policies permission.

Resource Types and Actions

Every resource type except agent accounts, sessions, and the organization carries the shared actions: Each type adds its own actions:
Connectors are the exception to owner access. Owning a connector grants view only; who can call its tools comes from connector policies. Administrators with the security-policies permission write any of them. Once early access is on, someone an administrator has granted share on the connector can also write the ones the connector format can’t express, such as policies naming a team, the organization, or owners, and rate limits, within the actions they hold. A policy the connector format can express, such as one naming users or groups, needs the security-policies permission.

Agents

Agent accounts

Agent accounts aren’t shared like other resources. Each management task is its own action, so you can hand someone exactly one responsibility for one account. The account’s owner holds all of these. An edit grant alone reaches neither the security settings nor rotation, and someone who can only disable an account can’t re-enable one a security team turned off.
rotate_credentials returns a new client secret, which lets its holder act as the account. Grant it, and edit_security, only to someone you would trust with the account’s credentials.
Identity attributes stay with agent account administrators. They decide which attribute-based policies the account matches, so no grant or ownership changes them. Who can create agent accounts is an organization permission, create_agent_account.

Organization permissions

Organization permissions grant or take away a role permission for specific people without changing their role. They use { "type": "org" } with no ids. An allow adds the permission on top of what the person’s roles give them; a deny takes it away, even from someone whose role includes it. The capability matrix in Settings → Roles shows which roles hold each permission today. These actions each make up a whole permission, so an allow on its own grants it: These actions are one part of a broader permission. An allow grants the permission only when the person also holds the other parts, through their roles or other organization allows, and a deny on any one part removes the whole permission: create_agent is checked alongside using agents, and everyone who can use agents holds it by default. A deny stops a person creating agents and leaves using agents and creating artifacts alone. use_agents, use_teams, use_assigned_connectors, override_connector_access, use_procedures, and manage_procedures stand for role permissions that switch a feature on. They don’t reach any resource by themselves, but a deny takes the feature away: denying use_agents stops a person using and creating agents. view_metrics_own grants and denies nothing. Organization policies have a few rules of their own:
  • You can only grant or deny organization permissions you hold yourself, so a policy administrator can’t hand out manage_admins.
  • They take a user, group, role, team, attributes, org, or Everyone principal. Agent account and owner principals, and approval requirements, are refused.
  • A permission check has no tool call behind it, so a condition on tool arguments or request context reads as unknown: a deny with one still applies, and an allow with one grants nothing.
  • A change can take up to five minutes to reach every request.
  • You can’t change or remove an organization deny that applies to you unless you hold manage_admins.
  • Don’t rely on an organization deny to restrict a super admin.

Principals

team, org, and owner work only in the format on this page, not in the connector format with action and scope. These are the only spellings the API accepts: agent_account, all: true, and attrs principals answer 422, as does "ids": ["*"]; use agent for agent accounts and org or any for everyone. Responses echo the same spellings, except that a built-in every-user or every-agent policy reads back as "ids": ["*"].
Prefer group, team, or role over long lists of users. Membership changes from your identity provider apply on their own, without editing the policy.

Presets

Viewer, Editor, and Manager are named bundles of actions. The share dialog’s Can use level is Viewer and its Can edit level is Manager; Editor is an API bundle. They expand to raw actions, so writing the same actions by hand has the same effect. delete and transfer_ownership are never in a preset. Agent accounts, sessions, and organization permissions have no presets; list their actions.

Approvals and Rate Limits

Policies carry the same human approval rules as connector policies, plus rate limits. An approval_requirement pauses matching connector tool calls until someone approves them. It has no effect, and it applies to connectors only. Approval rules are in beta.
A rate_limit caps how many matching tool calls go through in a fixed window. window is minute, hour, or day. per is user, session, or org and decides whose calls share one count. Calls over the limit are refused and appear in the audit log as Tool Call Rate Limited.
Rate limits apply to connector resources and call_tool actions only. Both examples name any so they also cover agent accounts acting on their own; org covers only people, and agents acting for them.

Who Can Write Policies

  • Administrators with the security-policies permission write any policy, except organization permissions they don’t hold themselves.
  • Owners and sharers. The owner of an agent, skill, plugin, artifact, or team, or anyone granted share on it, writes policies on exactly that resource. A grant is bounded by what its author holds: the owner can grant any action, everyone else only the actions they hold. The owner can also deny anyone. Someone with share can deny only named users or agent accounts who don’t own the resource, and only actions they hold themselves. Owners and sharers can’t write policies on Runlayer-managed agents, or agent configuration rules.
  • Access managers. Anyone granted manage_access on a resource changes or removes others’ grants on it.
  • Agent accounts. An agent account isn’t shareable, so only administrators with the security-policies permission write policies on it.
  • Agent account connectors. An agent account’s connector policy (a connector-shape allow naming exactly one agent account, on one connector, without conditions) can also be written by agent account administrators and by anyone holding edit_permissions on that account, the account’s owner included. Unless they administer agent accounts or connectors, or own the connector, the tools are limited to the ones they can call themselves, and "*" is saved as that list. Writing one for an account and connector that already have one updates its tools; if that existing policy also covers other accounts or connectors, the write answers 409. A policy naming several accounts is written by administrators with the security-policies permission. See Who can add a connector.
Administrators with the security-policies permission can change or remove any deny; an organization deny that names them also needs manage_admins. Anyone else changes a deny only as the resource’s owner, or as its author when the deny doesn’t name them. Two guardrails apply to every write. The built-in role and owner policies are read-only. A change that would leave the organization with no super admin able to manage admins and security policies is rejected, so you can’t lock yourself out.