Skip to main content
POST
Create an enforcement policy

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
action
string
required
name
string
required
agent_scope
object | null

Omitted = all agents.

detection_engine_ids
string<uuid>[]
dry_run
boolean
mask_format
object | null

Partial-redaction shape; only valid with POLICY_ACTION_MASK.

mcp_targets
object[]
model_alias
string | null
principals
object[]
priority
integer<int32> | null
provider_ids
string[]
runtime_stage
string | null
target_kind
string | null

Response

The created enforcement policy

action
string
required
agent_scope
object
required
created_at
string
required
created_by
string
required
detection_engine_ids
string[]
required
dry_run
boolean
required
id
string
required
mcp_targets
object[]
required
name
string
required
org_id
string
required
principals
object[]
required
priority
integer<int32>
required
provider_ids
string[]
required
runtime_stage
string
required
target_kind
string
required
updated_at
string
required
updated_by
string
required
mask_format
object | null

The mask_format object stored on dlp.enforcement_policies.mask_format and carried on the admin REST surface. deny_unknown_fields so a typo in a client (or a future key an older server does not understand) fails loudly.

model_alias
string | null