Skip to content

State sentences as a policy

POST/api/public/v1/policies/stated

Grounds each stated sentence in a read_ground job, then ratifies every sentence that is grounded or deferred into zone_ids — one Autonomy Zone (409 ONE_ZONE_PER_AIP for more) — in the mode; the caller is recorded as its ratifier, and a refused sentence creates nothing. Answers 202 with the job to poll; its result names the AIP (policy_public_id, null when every sentence was refused). A sentence is a string (dimension security) or {sentence, dimension}. An agent (OAuth) caller is refused with 403 AGENT_AUTHORING_VIA_DRAFTS: agents author intent policies through drafts.

Terminal window
curl --fail-with-body -X POST 'https://app.openlatch.ai/api/public/v1/policies/stated' \
-H "Authorization: Bearer $OPENLATCH_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"sentences":["Block a direct push to main."],"zone_ids":["<zone_id>"],"mode":"monitor"}'
Role in the organizationThis endpoint
ownerAllowed
adminAllowed
editorAllowed
viewerNot allowed

A key carries the role its owner holds in the organization. See Authentication.

API key scope: policies:write

ParameterTypeDescription
Idempotency-Keystring or nullOptional. Makes the request safe to retry: the same key and the same request, within 24 hours, returns the stored response with Idempotent-Replayed: true and runs once.
FieldTypeDescription
languagestring or null
modestring — one of disabled, monitor, enforceRequired.
sentencesarray of one of: string, objectRequired.
sentences[] (StatedSentenceIn).dimensionstring — one of quality, economics, security, safety, compliance
sentences[] (StatedSentenceIn).sentencestringRequired.
zone_idsarray of string (uuid)Required.
FieldTypeDescription
dataobjectRequired. `202 for a job-starting operation: poll GET /aip/jobs/{job_id}`.
data.job_idstringRequired.
{
"data": {
"job_id": "3f6c1a2e-8b4d-4c1f-9a7e-0d5b2c8e4f10"
}
}