Skip to main content
POST
Validate Rule

Authorizations

Authorization
string
header
required

A Barndoor API key, sent as Authorization: Bearer <key>. Keys are prefixed bdai_ and are opaque — do not attempt to decode one. Interchangeable with an OAuth 2.0 access token.

Scopes

openid

Issue an OIDC ID token identifying the caller.

profile

Read the caller's basic profile claims.

email

Read the caller's email address.

Body

application/json

A single rule: which principals may take which tool actions, optionally conditioned.

actions
string[]
required

Tool actions this rule matches, in the wire format tools/call:<tool_name> — for example tools/call:create_issue. Use * to match every action on the server. Tool names are specific to the target MCP server: enumerate the server's real tools rather than guessing names. A trailing :approve selects the Needs-Approval variant of a tool (tools/call:create_issue:approve), which requires per-call human confirmation; the plain action is Always Allow. Do not grant both twins of the same tool in one rule.

Examples:
name
string | null
default:""

Optional display name for the rule. Letters, digits, spaces, hyphens and underscores only — a colon or other punctuation is rejected with a 422, which is easy to hit because rule names tend to read like Security: view agents. Names must also be unique within the policy once punctuation is normalized, so My Rule and My-Rule collide.

Example:

"Engineering read access"

description
string | null

Optional human-readable description for the rule; has no effect on enforcement

authorized
boolean | null
default:false

Effect of the rule: True grants the listed actions, False denies them. Access is denied by default, so a tool that no rule grants is already blocked — an explicit False rule is only needed to carve an exception out of a broader allow. The effective model is tri-state rather than binary: Always Allow is True on the plain action, Needs Approval is True on the :approve twin (see actions), and Blocked is simply the absence of a grant.

active
boolean
default:true

Whether this rule is enforced. False keeps the rule on the policy but omits it from enforcement — use it to disable a rule without deleting it.

roles_groups
string[]

Principals this rule applies to, as PREFIXED entries: role:<role_name> for an IdP/Keycloak role, group:<group_name> for a user group, or the literal * for all users (the default). A bare name with no role:/group: prefix matches NOTHING. Retrieve the organization's real role and group names from GET /api/identity/public/v1/users/roles-groups. A principal set should appear on at most ONE rule in a policy — collect all of its actions there instead of spreading them over several rules.

Examples:
condition
PolicyRuleCondition · object | null

Optional CEL condition; the rule applies only when it evaluates true. Shape is {"match": <matcher>}. Omit entirely for an unconditional rule.

Response

Successful Response