In a glimpse¶
An agent that can act needs rules it has no way around. Xratu runs agents and workflows on a kernel that enforces compiled, signed policy in the execution path, and every run leaves evidence of which rules applied to which code. This page covers the problem, how a reusable capability block, a workflow, a policy bundle and an agent are written, what the kernel does with them, and what that changes about the cost of governance.
The risk changed when models started acting¶
A model that answers questions can be wrong, and you discard the answer. A model that acts is a different category of failure: it issues the refund, overwrites the record, sends the contract. There is nothing to discard. There is only a transaction to unwind, a customer to apologise to, and a regulator to explain it to.
That exposure sits with you. Not with the model vendor, not with the framework, and not with whoever wrote the system prompt.
Everything on the market asks the model to behave¶
Prompt instructions, guardrail wrappers, LLM-as-judge evaluators, post-hoc dashboards. Different shapes, one architecture underneath: probability supervising probability. Each inherits the same three weaknesses.
It can be talked out of the rule by a jailbreak, by context loss or by a long enough conversation. It cannot tell you what an agent will do, only what it has usually done. And it has to be re-established from scratch every time you change models, because behaviour shifts without warning.
Prompting is a suggestion. Enterprises need a law.
Xratu puts the rules in the execution path¶
An agent runs on Xratu the way an application runs on an operating system. The kernel runs the agents and enforces policies in the path, as the thing that decides what gets executed, not beside it as an observer.
Because the rules are compiled and signed before the run starts, the agent does not interpret them, cannot negotiate with them, and cannot drift away from them over a long session.
It starts with ordinary code¶
A reusable capability block is a Python function. You write it in whatever
library you already use (LlamaIndex, LangChain, a vendor SDK, plain requests),
and two decorators tell Xratu what it needs. Nothing about how you write the
function changes.
from sdk import xratu, xratu_auth
import stripe
@xratu(["stripe>=8.0"])
@xratu_auth(requires=["stripe.secret_key"])
def refund(customer_id: str, amount: float) -> dict:
"""Issue a refund against a customer's most recent charge."""
return stripe.Refund.create(customer=customer_id, amount=int(amount * 100))
@xratu declares the block's own dependencies, so nothing is inherited by
accident. @xratu_auth declares the secrets it needs by name. The values are
bound at runtime and never appear in your code, your repository, or an
environment variable.
The library is your choice, not Xratu's. A retrieval block written against LlamaIndex and a payments block written against a vendor SDK compose in the same workflow, with incompatible dependency versions, because each one runs in its own isolated cell with its own resolved environment.
from sdk import xratu
from llama_index.core import VectorStoreIndex
@xratu(["llama-index-core>=0.11"])
def retrieve(query: str, k: int = 5) -> list[str]:
hits = index.as_retriever(similarity_top_k=k).retrieve(query)
return [node.get_content() for node in hits]
Review once, reuse everywhere¶
Baking and publishing turn the block into an immutable artifact: sealed bytes, a content digest, and a typed interface. Security and compliance review that code once. Every later reference is to the digest, so "approved" means a specific set of bytes, not a name that somebody can quietly repoint at something else.
This is what makes governance cheap at the second agent and every one after it. The review cost is paid against the block, not against each workflow that happens to use it.
Composition happens in YAML, not in code¶
Workflows assemble published blocks. Control flow is structured and readable;
every step is either a call into reviewed code or a kernel primitive. There is no
third category: no inline scripts, no eval, nowhere for unreviewed logic to
hide.
Here the refund rules are written as part of the workflow, the way any engineer would write them.
flow: refunds.v3
expects:
customer_id: string
amount: float
reason: string
returns:
decision: enum[approved, denied, escalated]
steps:
- do: customer.lookup
bind: { id: $.customer_id }
save: $.customer
- if: $.amount >= 100
then:
- await: human.approval
from: role:finance_manager
timeout: 24h
on_timeout: { return: { decision: escalated } }
- try:
- do: payments.refund
bind:
amount: $.amount
customer: $.customer
retry:
max_attempts: 3
backoff: exponential
catch:
- kind: payments.gateway.unavailable
then:
- return: { decision: escalated }
- return: { decision: approved }
If the rules need to change only the YAML changes hence, no lengthy code review needed.
When the rule is not yours to write¶
A £100 approval threshold usually is not a product decision. It comes from the refund policy, and the person who owns it does not work on this workflow. Written the way it is above, that rule is invisible to them, unenforced anywhere else, and one pull request away from becoming £1,000.
So it moves. Compliance writes it as a signed bundle instead, in its own file.
bundle: org.acme.refund-governance
version: 2
rules:
- id: refund_human_approval
description: "Refunds of £100 or more require approval"
on: pre_call
applies_to: { action_class: financial.refund }
when: call.input.amount >= 100
effect: require_approval
effect_args: { approver: role:finance_manager, sla: 24h }
references: ["Acme Refund Policy v3 §2.2"]
- id: refund_hard_cap
description: "Refunds above £500 are denied"
on: pre_call
applies_to: { action_class: financial.refund }
when: call.input.amount > 500
effect: deny
reason: "Refund amount exceeds £500 maximum"
references: ["Acme Refund Policy v3 §2.1"]
And the workflow attaches it, losing the branch entirely.
flow: refunds.v3
expects:
customer_id: string
amount: float
reason: string
returns:
decision: enum[approved, denied, escalated]
policy:
attach:
- org.acme.refund-governance@2
- pci-dss-v4@1
steps:
- do: customer.lookup
bind: { id: $.customer_id }
save: $.customer
- try:
- do: payments.refund
bind:
amount: $.amount
customer: $.customer
retry:
max_attempts: 3
backoff: exponential
catch:
- kind: payments.gateway.unavailable
then:
- return: { decision: escalated }
- return: { decision: approved }
The approval still happens, and so does a £500 cap the engineer never knew about. Both now arrive from a versioned document that cites the policy it came from, and changing either one means governance publishing a new signed version rather than someone editing a number in a workflow. The same bundle attaches just as well across a whole workspace or the entire organisation, where every workflow inherits it without naming it at all.
The same law over an agent¶
A workflow is the right shape when you know the sequence in advance. Often you do not. The request arrives open-ended, and which block to call, in what order, and how many times is exactly the part you want the model to work out.
That is an agent, and it changes nothing about where the rules live.
agent: support.refund_agent
policy:
attach:
- org.acme.refund-governance@2
tools:
- customer.lookup
- payments.refund
- ticket.create
limits:
max_iters: 8
max_tool_calls: 16
tools: bounds what the agent can reach at all. limits: bounds how long it
may keep going before the run is cut. And policy.attach is the identical line
the workflow used, naming the identical signed bundle.
So the £100 approval and the £500 cap hold here too. Not because the agent was
told about them in a prompt, and not because a second model is grading the
first. payments.refund is the same sealed artifact at the same digest, the
rules are evaluated at the same gates inside the kernel, and the agent has no
route to that call which goes around them. It decides what to attempt. It does
not decide whether the law applies.
What the kernel does with all of this¶
The control plane resolves the workflow, the pinned block digests and the merged policy into a sealed run-plan, signs it, and hands it to your data plane. The data plane fetches the artifacts, verifies every digest against the plan, and starts the runtime. Nothing is interpreted at execution time: not the policy, not the versions, not the graph.
Then the kernel runs it:
- Each block executes in its own cell, a separate protection domain with its own dependency closure. Live objects never leave the cell that owns them; only typed values cross between them.
- Policy is evaluated at six fixed points: before a call, before a write to shared state, before an LLM invocation, before delegation, after a call completes, and before any event is emitted.
- Each evaluation returns one of nine deterministic effects: allow, deny, redact, require approval, route elsewhere, downgrade the model, require evidence, rate-limit, or retry. The kernel enacts the effect mechanically; it never interprets what a rule means.
- Every decision becomes evidence in an append-only, hash-chained graph, stamped with a run fingerprint over the workflow, the block digests and the policy.
That last part is what makes the claim checkable rather than asserted: after the fact you can prove exactly which law ran over exactly which code.
The same three moments, with and without a law¶
Where governance actually lands is the difference. Not the intent, but the moment of enforcement.
"always adhere to policy.pdf"
The model re-interprets it every session, from whatever context survives.
attach: refund-governance@2
level: workspace
Resolved and sealed into the run-plan before the first step executes.
evaluator: "is this safe?"
A second model grades the first. Confidence, not a guarantee.
on: pre_call
when: score.reliability < 0.80
effect: retry
Scores are computed from sealed telemetry and are enforceable, not merely charted.
dashboard: refund flagged
The money already left. You are reading a report, not making a decision.
pre_call: payments.refund
amount: £750
effect: deny
rule: refund_hard_cap
The call never executes, and the refusal is recorded with the rule that caused it.
What that buys you¶
| Probabilistic supervision | Xratu | |
|---|---|---|
| Enforcement | Asks the model nicely. Defeated by jailbreaks, drift, context loss. | The agent has no path to an action the protocol forbids. |
| Verifiability | You can show what an agent usually does. | You can prove which rules applied to which code, per call. |
| Model independence | Every model upgrade is a re-test of behaviour you never fully characterised. | New model, same enforced law. The rules do not live in the prompt. |
| Cost of scale | Each new workflow is a fresh review. More agents, more friction. | Blocks are approved once and reused. Review cost stops compounding. |
What that does to the cost of governance¶
Review cost normally scales with the number of agents, because each new workflow is examined from first principles. Pinning approval to the block instead of the workflow breaks that curve: the second agent reuses what the first one already had approved.
Compliance stops being the thing that blocks deployment and becomes the thing that makes it repeatable.
Where to go next¶
- Trust for what Xratu means by trust.
- The components for the parts each plane is made of.
- Get Started for your first reusable capability block, workflow, policy and run.
- Concepts for what every element is, and why it exists.
- Deploy & Install to stand the platform up.
- Architecture for how the control plane, data plane and kernel work.
- Develop to author blocks, workflows, agents, projects and models.
- Govern to author policy, attach it, and prove it held.