api reference
Intended Documentation
Policies API
The authority policy surface — evaluate an intent against policy with POST /authority/evaluate, manage policy sets, and run the draft → review → deploy → rollback lifecycle. All routes are fail-closed and tenant-scoped.
Policies API#
Policy is what the authority runtime consults to reach a decision. This page covers three related surfaces:
POST /authority/evaluate— run the modern policy engine directly against a structured intent and get a decision back, without minting a token or executing anything./authority/policies— read and upsert the policy sets the engine evaluates./policy/*— the governed draft → review → deploy → rollback lifecycle for promoting policy changes safely.
Warning
POST /authority/evaluate returns the modern enum ALLOW / DENY / REQUIRE_APPROVAL / ESCALATE. This is a different vocabulary from POST /intent, which returns APPROVED / ESCALATED / DENIED. They are produced by two different engines — keep your client mapping distinct. See the Intents API.
How the engine decides#
The policy engine loads the tenant's policy sets, matches rules by their bindings and conditions, and combines results most-severe-wins (DENY > REQUIRE_APPROVAL > ESCALATE > ALLOW). When no rule matches, it defaults to DENY. Interpretation-layer (LIM) signals can only upgrade severity — they never soften a decision. The risk score follows the same formula as /intent: baseRiskScore + (privileged?20) + (production?20) + (sensitive?15), capped at 100.
Evaluate an Intent#
Request#
Response#
| Field | Type | Notes |
|---|---|---|
decision | enum | ALLOW / DENY / REQUIRE_APPROVAL / ESCALATE. |
policySetId | string | null | The policy set that produced the decision, or null when defaulted. |
triggeredRuleIds | string[] | Ids of rules that matched. |
rationale | string[] | At least one human-readable reason. |
riskScore | integer 0–100 | Computed risk for this evaluation. |
requiredApproval | object | Present on REQUIRE_APPROVAL. |
escalation | object | Present on ESCALATE. |
| Status | Code | Cause |
|---|---|---|
400 | INVALID_AUTHORITY_EVALUATION_REQUEST | Body failed schema (issues[]). |
400 | TENANT_MISMATCH | tenantId ≠ intent.tenantId or context.tenantId. |
401 | UNAUTHORIZED | No valid credential. |
403 | FORBIDDEN | Missing authority:evaluate permission. |
403 | TENANT_MISMATCH | Body tenant ≠ credential tenant. |
Policy Sets#
The rules /authority/evaluate consults live in policy sets.
A policy set is { id?, tenantId, name, description?, enabled, version, defaultDecision, rules[] }. Each rule carries bindings (intentTypes, actions, targetSystems, tools, actorRoles, environments), optional confidenceThresholds / budgetCeilings / conditions, and an effect ({ decision, approvalRequirement?, escalation? }).
Policy Lifecycle#
For governed promotion, work through drafts rather than upserting policy sets directly. Every step appends to the audit ledger and requires authority:policy:write.
Read#
| Method | Path |
|---|---|
| GET | /policy/packs?tenantId=… |
| GET | /policy/packs/:pack/versions?tenantId=… |
| GET | /policy/drafts?tenantId=… |
| GET | /policy/drafts/:id?tenantId=… |
| GET | /policy/drafts/:id/impact-summary?tenantId=… |
Write#
| Method | Path | Body | Returns |
|---|---|---|---|
| POST | /policy/drafts | { tenantId, policyPackName, title, createdBy, policySet, description?, baseVersion?, metadata? } | 201 draft |
| PUT | /policy/drafts/:id | { tenantId, title?, description?, policySet?, metadata?, updatedBy? } | draft |
| POST | /policy/drafts/:id/review | { tenantId, submittedBy, comments?, simulationRunId? } | review state |
| POST | /policy/drafts/:id/approve | { tenantId, reviewerId, comments? } | approved state |
| POST | /policy/drafts/:id/reject | { tenantId, reviewerId, comments? } | rejected state |
| POST | /policy/deploy/:draftId | { tenantId, deployedBy, comments? } | deployed version |
| POST | /policy/rollback/:versionId | { tenantId, rolledBackBy, comments? } | rolled-back state |
Create a draft#
Impact summary before you deploy#
GET /policy/drafts/:id/impact-summary returns a semanticDiff, an impact projection (sample size, changed-outcome rate, approval-load and token-issuance deltas, confidence, a lowData flag), and a rolloutSafety checklist with a recommendedMode of shadow / review / enforce. Read it before promoting a draft.
Warning
Policy routes are fail-closed and tenant-scoped. Always send x-tenant-id matching the body tenantId, or the request is rejected with 403 TENANT_MISMATCH.
Info
The CLI exposes deploy as the flat command deploy-policy (an alias of policy-pack-install). There is no intended policy … command group — any older reference to one is wrong.
Next steps#
- Deploy a Policy — the operator workflow end to end
- Intents API — how these policies drive runtime decisions
- Authority Runtime Pipeline — the decision model in depth