Before you start
Identifiers
KORDIO_AGENT_KEY is the test agent’s key. A policy belongs to one agent, so the two agent ids
matter: rolling out means writing the rules against the live agent once they behave.
The amounts here assume the agent’s starter policy is disabled, as the
quickstart does in step 2. Leave it on and it holds anything over $100 for
a person before your own rules get a say.
1. Preview the draft against nothing
policy_previews evaluates a policy you have not saved, on a request that never happened:
200 OK
rule_id is minted for that one
evaluation and thrown away, so it will not match the id the rule gets when you save it. imports resolve against the modules the
workspace really has, so a draft that builds on a saved module previews honestly.
session_budget_cents sets the synthetic budget and defaults to 100000. Previewing needs only
the read capability, deliberately, because it changes nothing.
Two things preview will not tell you. It evaluates the draft alone, so it says nothing about how
the draft interacts with the agent’s other active policies, and window rules read the agent’s
real recent usage rather than a clean slate.
2. Let a test agent run into it
Save the draft against the test-mode agent:201 Created
simulate, which
records an action.simulated audit event and reserves nothing:
200 OK
3. Read what it held, test agents only
Held intents can be narrowed to one agent mode, so a live queue is not polluted by a rehearsal:200 OK
agent_mode accepts live or test, and anything else is a 400
rather than a silent full listing, because answering a narrowed question about held money with
every intent in the workspace is the wrong way to be wrong. The same filter works on
payment_intents.
4. Promote it to the live agent
Write the proven rules against the live agent. Create it turned off, check it reads the way you expect, then flip it:201 Created
disabled policy is still validated when you save it, and is left out of evaluation entirely.
Turn it on when the diff reads right:
200 OK
Next steps
Give an agent a budget for one run
The other half of a safe first run.
Require a person above a threshold
Resolve the holds this rollout produced.
Writing a policy
The rule kinds, modules, and the preview endpoint in full.
How a decision is reached
Evaluation order, and why the first denial wins.