Author a policy through your agent
Author an Agent Intent Policy (AIP) by working with your own agent, from a brief to a ratified policy, without leaving your agent. The agent does the legwork: it reads your brief, runs the interview and prepares the checks. You decide, and nothing takes effect until you approve the ratify call.
You need an agent with the OpenLatch plugin installed, which brings the MCP connection and the openlatch-autonomy-zones skill, and the editor role or higher. Write an Agent Intent Policy describes the same steps in the console, and Intent policies explains the model.
From a brief to a ratified policy
Section titled “From a brief to a ratified policy”Ask your agent to write a policy, and tell it the zone the policy is for. The agent follows the skill’s steps with these tools:
| Step | What the agent does | What you do |
|---|---|---|
| Start | Reads the limits with drafts_read, then creates a draft from text you paste with drafts_write, or from a built-in preset | Give the brief in your own words, or choose a preset |
| Interview | Shows each intent policy’s interview cards, with the recommended answer, and sends your answers with answer | Answer every card; the agent never answers one for you |
| Confirm | Asks Is that right? for each sentence and confirms it with patch_policy only after you say yes | Keep a sentence, change it, or leave it out |
| Zone and mode | Sets the zone and the mode with set_zones | Choose Monitor or Enforce; start in Monitor unless you already trust the policy |
| Prepare | Prepares the draft with prepare, polls the job, then reads the test cases and the replay with drafts_read | Read the failing cases and the replay |
| Ratify | Prints every sentence the call puts in force, then calls policies_ratify | Approve the call in your client |
A write that starts a job returns a job the agent polls with job; it never waits inside a call. The agent can start only from text and from presets. To upload a document or record a conversation as the brief, use the console.
Approve the sentences
Section titled “Approve the sentences”Ratifying sends the exact sentences it puts in force, in the sentences argument of policies_ratify. Your client shows that argument in its permission prompt, so you read what goes into force before you approve. The platform then checks the sentences against the draft inside the ratify itself:
| What the agent sends | Result |
|---|---|
| The draft’s sentences, copied word for word | The policy is ratified in its zone |
| No sentences | The tool refuses the call before it reaches OpenLatch; nothing changes |
| Any other sentences: a paraphrase, one missing, one from an earlier revision | Refused with SENTENCES_MISMATCH; nothing changes |
The comparison ignores the order of the sentences, extra whitespace and the way Unicode composes a character, and nothing else: a changed word is a mismatch. The refusal never repeats a sentence back.
OpenLatch marks policies_ratify as needing your interaction, and some clients shorten long arguments in the prompt, so the skill has the agent print every sentence, with its dimension, the zone and the mode, in its own message before the call.
If you set your client to allow policies_ratify without asking, there is no prompt. The check then proves only that the agent sent the draft’s current sentences, not that you read them. Keep the prompt on for this tool.
Edit a policy or restore a version
Section titled “Edit a policy or restore a version”| To | The agent does |
|---|---|
| Edit a ratified policy | Reads the policy with policies_read, then opens an edit draft with edit. The live policy keeps enforcing unchanged until you ratify the draft as a new version. One person edits a policy at a time, and the agent tells you who holds it |
| Restore an earlier version | Reads that version’s sentences with the version method of policies_read, shows them to you, then calls policies_ratify with restore and those sentences. The restore makes a new version and rewrites no history |
Both go through the same sentences check as a new policy.
Delete a policy or copy it to another zone
Section titled “Delete a policy or copy it to another zone”A policy keeps its Autonomy Zone for its whole life, so the agent never moves one.
| To | The agent does |
|---|---|
| Delete a policy | Calls policies_write with retire. After your approval the policy stops running and cannot be used again, and its history stays in Audit |
| Run a policy’s rules in another zone | Calls policies_write with copy and the target zone. It creates a draft in that zone, in Monitor, which you review and ratify as a new policy with its own history |
A call that names attach or detach is refused with OPERATION_REMOVED, and the agent is told to delete or copy instead. Nothing changes.
When a call is refused
Section titled “When a call is refused”| Code | What happened | What the agent does |
|---|---|---|
SENTENCES_REQUIRED | The ratify carried no sentences | Reads the draft, shows you its sentences and sends them |
SENTENCES_MISMATCH | The sentences are not the ones this call puts in force | Reads the draft again, shows you what it holds now and sends exactly those |
DRAFT_NOT_PREPARED | The draft was not prepared at this revision | Prepares it again, polls the job, then ratifies |
DRAFT_REVISION_STALE | The draft changed after the agent read it | Reads it again and shows you what changed |
EDIT_DRAFT_STALE | The ratified policy changed after the edit draft opened | Reads the policy again and opens a new edit draft if you still want the change |
DRAFT_EXISTS | Someone else holds an edit draft of the policy | Tells you who holds it |
AI_NOT_ENABLED | AI authoring is off for your organization | Starts from a built-in preset instead |
FORBIDDEN | Your role does not allow authoring | Tells you which role it needs |
Every code is listed with its status in the error catalogue.
Next, graduate the policy to Enforce once its record shows it is accurate.