AI Agents per Domain: Rules, Approvals and Evidence
How an AI agent enforces domain rules across several tool calls: with case state, checked plans, approvals and traceable execution.
An AI agent per domain connects the tools of a field of work with its rules, permissions and case state. What matters is not another chat but an executable path that checks related actions before they take effect. This article shows which responsibility lies with the model, with the tool and with the agent system you operate.
A constructed example: an agent is supposed to refund 740 euros as a goodwill gesture. Anything over 500 euros needs approval from the team lead. The tool call for 740 euros is rejected; two calls for 370 euros each, however, would pass a check that only looks at individual calls. Each call would be allowed on its own, but their combined effect would not. This is exactly the gap a rule over the whole case has to close.
Part 11 of the series “From Session to System” – the opening post is here.
The example describes a possible weakness, not an observed incident. Whether a model would actually propose two partial amounts is an open question. The architecture still has to prevent this kind of workaround: a rule about a case cannot be expressed as an isolated check of individual calls alone.
This installment thus keeps two promises the series has left open. The chronicle of my instruction files ended with the finding that only what the environment enforces is a rule. The last installment closed with the question of why binding rules lead to a dedicated agent tied to the domain – and what that agent has to be able to do. The credit note construction gives the short answer: rules need a place where the context is visible.
A tool sees the call, not the case#
A reminder of where the series stands: the last installment moved the domain from the prompt into the tools – typed operations whose names come from the domain language, whose inputs are validated and whose calls are authorized. The check now runs in the executable path instead of in the prompt: the 500-euro rule went from a recommendation the model can read and weigh to code that decides the same way on every call.
In this example, the check sees only one call. A tool can also load and check case state; what matters is that this responsibility is implemented explicitly. Without it, three things stay hidden.
The context. Domain rules are rarely rules about calls – they are rules about cases. “No more than 500 euros in goodwill” means per case, per customer, per period. Two credit notes of 370 euros for the same case violate the rule without any single call violating it. An authorization that only receives the input of the current call cannot notice this – not because the tool is technically incapable, but because it lacks the bound case state.
The effect. Some errors don’t show in a single step but only in the overall picture – in what will exist after twenty steps. If you only check after execution, you check too late; by then the credit note has already reached the customer.
The memory. Whether a pattern is suspicious is decided across sessions: the same invoice, three times in two weeks, triggered by two different people. The individual call knows nothing about that, and neither does the individual tool.
What the individual tool call lacks, the agent can bring together: the history, a materialized plan and persistent case state – provided these states are stored explicitly and bound to the case. That is why enforcement moves up one level – out of the tool and into the agent that runs the loop. The agent is then no longer an interchangeable accessory but the place where the binding rules of a domain live: an operated software system with a plan, permissions, approvals, evidence and clear ownership.
From proposal to evidence: five stations#
What does this enforcement look like? The core idea is old and doesn’t come from the AI world: separate building from executing. If you run infrastructure as code, you know it as terraform plan and terraform apply – first you get a complete preview of what would change, then you decide separately whether it actually happens. Between proposal and effect sits a check, and it doesn’t look at a single move but at the whole undertaking.
Applied to agents, the path from idea to effect has five stations.
It starts with the model proposal: a textual or structured output, as eloquent as it is non-binding. Whether the model delivers prose or fully formatted tool calls – at first it only produces a statement of intent without authorized effect. Second, this becomes an executable plan: an ordered sequence of typed operations with concrete parameters, stored as an immutable revision and bound to the checked state; the operations and parameters are machine-readable, while a rationale can remain free text. Third, domain authorization: the plan is checked as a whole against the rules of the domain. This is where two credit notes for the same case stand out, where sum and frequency rules apply, and where it is decided whether the undertaking is allowed, rejected or requires approval. Fourth, where the rules demand it, human approval: a confirmation by a domain role that the model can neither grant nor replace – it may make proposals but may not confirm a human decision itself. And fifth, evidence, in two forms: decision evidence for every rejection and every approval, and execution evidence for every operation actually executed – who, what, when, with what result, under which rule version.
flowchart LR
M["Model proposal<br/>textual or structured, non-binding"] --> P["Plan<br/>all planned operations"]
P --> R{"domain authorization<br/>rules of the domain"}
R -- "violated" --> N["Rejection<br/>justified and logged"]
R -- "requires approval" --> H["human approval"]
R -- "allowed" --> D{"bound state<br/>still current?"}
H -- "confirmed" --> D
H -- "rejected" --> A
D -- "yes" --> E["Execution"]
D -- "no" --> R
E --> A["Decision or execution evidence<br/>who · what · when · rule version"]
N --> AAnyone who works with coding agents knows this on a small scale: first the diff, then the commit. The difference is that there a human looks voluntarily – and on a Friday afternoon sometimes doesn’t. In an agent that is responsible for a domain, the check is not a habit but part of the path. It happens whether anyone remembers it or not.
A no that stays a no#
The second capability follows directly from the construction at the start. A model that runs into a rejection can rephrase, negotiate, look for detours. That wouldn’t be malice: searching on is exactly the behavior we appreciate elsewhere, when a model tackles a test failure three different ways until the build is green. Instead of trying to train this persistence away, you can give it a limit that is not up for negotiation.
For that, the approval has to live outside the conversation. An operation that requires approval waits until a human confirms it – and no text in the context, however eloquent, moves this gate, because the gate doesn’t even read the text. The model can propose its two 370-euro credit notes as often as it likes: the sum rule triggers on the plan, the approval stays pending, and the case sits with the responsible human. What matters here is who gives this yes: not “some admin” but a role from the domain – the team lead who decides on 500-euro goodwill payments even without AI. The approval maps an existing domain responsibility; it doesn’t invent a new one.
Sketched on the tool definition from the last installment, the extension looks roughly like this. The code block is a simplified, illustrative sketch: the API defineTool and the role billing_team_lead are freely chosen placeholders.
const issueCreditNote = defineTool({
name: "issue_credit_note",
input: z.object({
invoiceId: z.string(),
amount: z.number().positive(),
reason: z.enum(["complaint", "goodwill", "pricing_error"]),
}),
approval: {
required: ({ input, history }) =>
input.amount + history.totalCreditedFor(input.invoiceId) > 500,
approvers: ["billing_team_lead"],
},
audit: { record: ["user", "input", "approval", "result"] },
});
The crucial line is the one with history. The approval requirement doesn’t depend on the individual amount but on the sum across the case. The authoritative state lives in the domain, not in the conversation: the agent binds a checked state of the case to the plan and passes it as input to the authorization – exactly the view the isolated single-call check lacks. Binding alone isn’t enough, though: so that parallel calls can’t exceed the 500-euro limit after all, execution has to recheck the bound state against the current domain state beforehand and abort or reauthorize if it has changed in the meantime.
Evidence instead of memory#
The third capability is the least conspicuous: every execution leaves evidence behind. Who triggered the case, which plan revision was checked, what exactly was executed, with which inputs, what came out, who approved it – and, easy to overlook: which version of the rules applied. Domain rules change. 500 euros becomes 300, an approval path gets rebuilt. When someone asks three months later why a credit note went through back then, the answer has to be able to say: under the rules as of March it was allowed, here is the entry.
Such a log doesn’t exist because someone remembered to take notes. It exists because the path produces it – rejections included. The no leaves a trace too, and it is precisely the noes that show where rules are too tight or tools are cut too coarsely. Auditability is not a compliance exercise you bolt on afterwards. It is a property of the path, or it doesn’t exist.
Why per domain#
So far, I have argued why binding rules belong in checkable state transitions and authorization boundaries rather than only in prompt prose. The second part of the question from the last installment is still open: why a dedicated agent per domain – and not one big agent that can do everything?
Because each of the three capabilities requires domain knowledge. A plan check can only evaluate what it understands: that two credit notes belong to the same case, that a customer is in dunning, that “goodwill” and “pricing error” have different consequences – these are terms and relationships of a domain, not generic concepts. The approval needs roles that only exist there. The evidence has to be kept in the language in which someone will ask later. A generic agent can read files and run commands; it cannot know what an inadmissible credit note is.
Then there are the permissions. An agent that carries the tools of all domains may need a correspondingly broad set of permissions if rights are not delegated and limited per call – and with such permanent rights it becomes a worthwhile target. OWASP lists “Excessive Agency” among its top 10 risks for LLM applications: too many tools, too broad permissions, too much autonomy in a single system. With his “lethal trifecta”, Simon Willison named the most toxic combination – access to private data, exposure to untrusted content and the ability to communicate externally, united in one agent. Cutting along domains is therefore also a security decision – but it only becomes an enforceable boundary with separate identities, permissions, states and interfaces: few tools, narrowly scoped permissions, a clear blast radius. The credit note agent cannot trigger deployments, and the deployment agent doesn’t know any customer data.
And finally, knowledge. Curated insights, grounded answers, knowledge that survives the session – all of this always belongs to a particular domain. An agent that is responsible for a domain carries its sources, its conventions, its special cases. Not as a cross-domain grab bag, but as a maintained, manageable collection with owners.
This also closes the loop to the variance from the team part of this series. Back then, the finding was: results vary between people, tasks and sessions, and files with rules change little about that. The domain agent doesn’t solve this problem by making people the same. It moves the line below which variance can do damage. Above it, everything stays different: how someone phrases, explores, delegates, which path a session takes. Below it, everything is the same: whatever takes effect in the end goes through the same authorization, the same approval, the same evidence – for the experienced colleague just as for the intern, on Friday afternoon just as on Tuesday morning.
What your own agent has to be able to do#
With that, the question from the last installment can be answered compactly. An agent that is supposed to represent a domain in a binding way needs:
- tools in the domain language – typed, validated, authorized
- the separation of model proposal and effect, with a check of the whole plan instead of individual calls
- rules about cases: sums, frequencies, relationships across calls and sessions
- approvals in the path, outside the conversation, by roles of the domain
- evidence of every execution and every rejection – with plan revision, rule revision, approval decision, caller, result and error status
- the permissions of the respective caller instead of its own omnipotence – narrowly scoped, domain-specific
- curated knowledge sources of the domain, with owners and maintenance
Nothing on this list is something an experienced team wouldn’t have built long ago: validation, authorization, workflow, audit, permission model. The only new thing is what it’s for – not for a UI where people click, but for a loop in which a model acts. If you build an agent like this, you wrap ordinary, solid software around variable model proposals. That is exactly why the task is doable.
Doable doesn’t mean on the side. What emerges here is an operated software system with a lifecycle, not a weekend project – the counter-calculation from the last installment still applies, from maintenance effort to the risk of building, out of sheer caution, a form with a chat UI. And it doesn’t belong to anyone alone: the rules come from the business side, enforcement comes from engineering, and neither can take over the other’s part. Regardless of the implementation effort, the team has to clarify who may propose, check and approve such rules in the future – that is organizational work.
Where things stand#
The path of this series can now be told in three stations. Rules as prose: read, weighed, occasionally overruled – recommendations, the kind I spent half a year tightening in vain. Rules in the tool: checked on every call, reliable in detail, blind to the context. And rules in the path: a dedicated agent that knows the domain, checks plans before they take effect, obtains approvals no model can talk its way around, and produces evidence that answers the questions of the day after tomorrow. Only at this stage has the recommendation become a rule that holds even when nobody is looking.
What this installment deliberately leaves open: the path there. No installed product automatically ships the rules of a domain – they emerge from engaging with the domain itself, and that immediately raises practical questions. How does a team find out which rules belong in the path and which may stay prose? How do you cut the first domain without overreaching? Which concepts, methods and processes hold up – and which fads can you safely skip? The next installment is about these tools.
What SubKit contributes#
SubKit is my tool for recurring processes: an assistant designs the workflow, a person checks it and approves its scope. Execution follows the defined steps; permissions and results become traceable. AI clients can use approved workflows as tools via MCP.
This doesn’t replace modeling the domain. A case-based goodwill limit, shared case state and the handling of parallel requests have to be implemented explicitly in the respective process and the connected systems. SubKit doesn’t automatically supply the business rules for this. The use cases show possible starting points; the article MCP: When Software Offers Capabilities explains the role of the interface.
Further reading#
- Terraform: plan and apply – separating proposal and effect in everyday infrastructure work
- OWASP Top 10 for LLM Applications: Excessive Agency – too many tools, too broad permissions, too much autonomy
- Simon Willison: The lethal trifecta – why the combination of data access, untrusted content and external communication is dangerous
- Domain-Driven Design Reference (Eric Evans) – domain language and domain boundaries as design work
Revised and translated from German with the help of AI.