Overview
Policies give your organization fine-grained control over which actions run, which require review, and which are blocked outright. They complement built-in high-risk connector checks and are managed through the authenticated dashboard REST API (TEAM plan required).
API
All endpoints require operator dashboard authentication (jwtAuth with TEAM plan). Successful responses use this envelope:
A policy returned by the API has this shape:
List policies
Create a policy
apiNamePattern and action are required. condition is optional, and enabled defaults to true.
Update a policy
Toggle policy enabled status
Delete a policy
API name matching
apiNamePattern supports exact names, wildcard suffixes, and a full wildcard:
Payload conditions
Add an optional condition to apply a policy only when a payload field matches.
Supported operators: eq, neq, gt, gte, lt, lte, contains.
Evaluation and approval behavior
When more than one enabled policy matches, the most restrictive result wins:
BLOCK>REQUIRE_APPROVAL>ALLOW
Enforcement Mechanism
BLOCK: When logged to POST /sessions/:id/actions, records the action as FAILED upon logging and returns HTTP 403 with error type policy-blocked.
REQUIRE_APPROVAL: When logged to POST /sessions/:id/actions, transitions the action to PENDING_APPROVAL with an after-execution approval request. If a reviewer approves, action becomes SUCCESS. If rejected, single-action rollback is executed.
ALLOW: Permits the action to proceed normally.
Server Enforcement Boundary: Server-side policy results are recorded and enforced as far as the SDK cooperates. An agent that bypasses the AgentRein SDK and invokes external APIs directly is not blocked by the server. AgentRein does not expose a pre-execution authorize endpoint.