Skip to content

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.

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:

StepWhat the agent doesWhat you do
StartReads the limits with drafts_read, then creates a draft from text you paste with drafts_write, or from a built-in presetGive the brief in your own words, or choose a preset
InterviewShows each intent policy’s interview cards, with the recommended answer, and sends your answers with answerAnswer every card; the agent never answers one for you
ConfirmAsks Is that right? for each sentence and confirms it with patch_policy only after you say yesKeep a sentence, change it, or leave it out
Zone and modeSets the zone and the mode with set_zonesChoose Monitor or Enforce; start in Monitor unless you already trust the policy
PreparePrepares the draft with prepare, polls the job, then reads the test cases and the replay with drafts_readRead the failing cases and the replay
RatifyPrints every sentence the call puts in force, then calls policies_ratifyApprove 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.

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 sendsResult
The draft’s sentences, copied word for wordThe policy is ratified in its zone
No sentencesThe tool refuses the call before it reaches OpenLatch; nothing changes
Any other sentences: a paraphrase, one missing, one from an earlier revisionRefused 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.

ToThe agent does
Edit a ratified policyReads 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 versionReads 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.

ToThe agent does
Delete a policyCalls 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 zoneCalls 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.

CodeWhat happenedWhat the agent does
SENTENCES_REQUIREDThe ratify carried no sentencesReads the draft, shows you its sentences and sends them
SENTENCES_MISMATCHThe sentences are not the ones this call puts in forceReads the draft again, shows you what it holds now and sends exactly those
DRAFT_NOT_PREPAREDThe draft was not prepared at this revisionPrepares it again, polls the job, then ratifies
DRAFT_REVISION_STALEThe draft changed after the agent read itReads it again and shows you what changed
EDIT_DRAFT_STALEThe ratified policy changed after the edit draft openedReads the policy again and opens a new edit draft if you still want the change
DRAFT_EXISTSSomeone else holds an edit draft of the policyTells you who holds it
AI_NOT_ENABLEDAI authoring is off for your organizationStarts from a built-in preset instead
FORBIDDENYour role does not allow authoringTells 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.