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
orgallow plus agroupdeny. - Actions are flat. No action implies another. Granting
manage_accessdoes not grantview, so list every action the principal needs.
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 throughPOST /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}.
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.
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 andownerprincipals, 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": ["*"].
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. Anapproval_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.
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.
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
shareon 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 withsharecan 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_accesson 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_permissionson 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 answers409. A policy naming several accounts is written by administrators with the security-policies permission. See Who can add a connector.
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.
Related Documentation
- Access Control Cookbook - Copy-paste recipes for every resource type
- Connector Access Control - Connector policies, conditions, and approvals
- Agent Accounts - Identities for autonomous agents and services
- Teams - Sharing resources with groups of people
- Roles & Permissions - Built-in roles and the permissions they carry