Solution Architecture2 January 20277 min read

Ontology Before Autonomy — Part 5 of 10

Rules stop plausible errors becoming actions

An agent loop becomes dangerous when it can keep acting without checking state, authority, cost or completion. Part 5 of Ontology Before Autonomy turns the service meaning into executable rules, sets out six for a language-access service, and gives each one a rule card so it can be tested, owned and seen.

#Ontology#AI Agents#AI Governance#Policy as Code#Human Oversight

A machine-assisted session at an illustrative civil-registration counter has been running for some minutes. The applicant has explained that their name is misspelt on a document. The translation route has produced a correction request. The agent has drafted an updated record and, because the conversation seemed settled, it calls the tool that writes the corrected name to the case.

Each step was plausible. The transcript was good. The translation was reasonable. The draft matched what the applicant appeared to say. But nobody confirmed the spelling with the applicant, the translation was still provisional, and writing to the case record was never something a language session should do. The error was not one wrong answer. It was a chain of reasonable steps that nothing stopped.

A model will sometimes be wrong in ways that look right, so the rules that decide whether an output may become an action must be executable, testable and visible, and they must sit outside the model's instructions.

Part 4 gave the service meaning a home: entities, states, transitions and roles. This part turns that meaning into rules the system enforces.

Why a prompt is not a rule

Most agent designs contain rules. They are usually in the system prompt: "Never change official records." "Always confirm names and dates." "Escalate if unsure." Those instructions help. They are not controls, for three reasons.

They are not enforced. A model follows its instructions most of the time. When it does not, nothing in the system notices. A crafted input, a long conversation or a confusing turn can push it past an instruction it followed a hundred times before.

They are not testable on their own. A rule in a prompt can only be tested by running the whole model and hoping the test case triggers it. A rule in code can be tested directly, with every boundary case, every time anything changes.

They are not visible. An official, an auditor or a language specialist cannot easily see which rules apply, which version was in force and whether a given action passed them. A rule written once, in a place people can read, can be reviewed by the people who own it.

A policy document is not an executable rule makes the general case for moving rules out of prose. Keep deterministic authority deterministic explains why a decision that already has a rule should not be left to a model. This part applies both ideas to an agent that works with language.

What makes an agent loop dangerous

An agent works in a loop: read the situation, decide on a step, call a tool, read the result, decide again. You do not control the agent until you control the loop covers the runtime controls. The ontology adds four checks the loop must make before each consequential step:

  • State. Is the entity in a state where this action is valid? A collected document cannot be moved back to pending. A session that has expired cannot continue.
  • Authority. Does the actor hold the authority for this action? The agent may explain. It may not approve, correct a record or accept a declaration.
  • Cost. Is the loop still within its limits of steps, time and spend? A loop that retries a failing route without a limit is a cost problem before it is a quality problem.
  • Completion. Is there a defined condition under which the task is done, and has it been met? Without one, the agent keeps acting because it has not been told to stop.

Each check needs the ontology. "Valid state" means nothing unless the states and transitions are written down. "Authority" means nothing unless the roles are.

Six rules for a language-access service

These six rules come from the NalaTolika concept and apply to any machine-assisted interpretation service. NalaTolika is a CloudNala concept and reference architecture for governed language interpretation. It has no customers, deployments, pilots, data or results.

  1. A translation session cannot approve an application. The session's identity has no permission to call any approval or status-change tool. This is enforced in permissions, not in the prompt.
  2. A provisional translation cannot become the official record without confirmation. Every translation carries an approval state. Only a confirmed translation, confirmed by the applicant and, where the service requires it, by an official, may be written to a record.
  3. A missing or contradictory critical field requires clarification or escalation. Names, identity numbers, dates and document references are critical fields. If one is missing, or two turns contradict each other, the session asks or hands over. It never chooses.
  4. An interpreter handoff contains only the minimum required context. What has been confirmed, what is flagged, why the handoff happened and the language chosen. Not the whole transcript, and never unconfirmed text presented as fact.
  5. A session expires after inactivity or a configured maximum duration. On expiry, nothing pending is written, and the next interaction starts a new session.
  6. The system stops when provider confidence is unavailable or a route is not approved. If the language route cannot report the signal the release gate relied on, or the language direction has not passed its gate, the session goes to a person.

Each rule refers to entities and states in the ontology: session, translation, approval state, critical field, handoff, route. That is the link between the map and the controls. Without the map, the rules have nothing precise to refer to.

An executable rule gate. A proposed action from the agent loop enters a gate that runs outside the model. The gate first makes four loop checks: state, authority, cost and completion. It then applies six rules for a language-access service: a translation session cannot approve an application; provisional text is not the record; a missing or contradictory critical field requires clarification or escalation; a handoff carries the minimum context; a session expires on inactivity or a maximum duration; and the system stops when confidence is unavailable or the route is not approved. Each rule records its ontology terms, trigger, check, owner, version and tests. The gate has four outcomes: pass and act or explain; clarify or confirm; escalate to a person; or stop and log.AGENT LOOPProposedactionRULE GATE, OUTSIDE THE MODELStateAuthorityCostCompletion1 No approval by atranslation session2 Provisional text isnot the record3 Missing critical field:clarify or escalate4 Minimum contextin a handoff5 Session expires oninactivity or limit6 No confidence orunapproved route: stopEach rule: ontology terms, trigger, check,where enforced, owner, version and testsPass: actor explainClarify orconfirmEscalate toa personStop andlogBlocked attempts are logged with the rule and its version. Repeated blocks point to a fault upstream.
Rules do not make a model correct. They make some of its errors stoppable, and every blocked attempt becomes evidence. CloudNala analysis; rules from the NalaTolika concept design.

The rule card

The decision tool for this part is a rule card. Every rule that can stop an action gets one. If a rule cannot be written on a card, it is not yet a rule.

FieldRule 2 as an example
RuleA provisional translation cannot become the official record without confirmation
Ontology termsTranslation, approval state (provisional, confirmed, corrected), Record
TriggerAny tool call that writes translated text to a case or record
CheckTranslation approval state is "confirmed", with the confirming party recorded
Enforced whereThe write tool's input validation, outside the model
On failureBlock the write; ask the applicant to confirm; log the blocked attempt
Test casesProvisional text; corrected but unconfirmed text; confirmed by applicant only where an official is required
OwnerService owner, with the language specialist for confirmation wording
Version and effective dateRecorded with the rule and in every trace that applied it

Three things on the card matter most. Enforced where must name a place outside the model. On failure must name a safe action, usually to ask, hand over or stop, never to continue with a guess. Test cases must include the boundaries, because rules fail at their edges.

Make the rules visible

A rule that blocks an action should say so, in words the people involved can understand. The applicant should hear that the system needs them to confirm a spelling, not that something went wrong. The official should see which rule stopped the action and why. The trace should record the rule, its version and the result, including every blocked attempt.

Blocked attempts are evidence. If the agent keeps proposing an action that a rule keeps refusing, something upstream is wrong: the mapping, the instructions or the tool design. Test the rule, test the model, test the whole decision sets out how to test each layer. The Machine-Readable Policy and Accountable Decision Systems series goes deeper on rule authority and conflicts.

Rules do not make a model correct. They make some of its errors stoppable. The others still need evaluation, retrieval of approved knowledge and people.

Next in the series: Ontology is a guardrail for agent loops. All parts are on the series page.

Sources and limits: this article is CloudNala analysis. The four loop checks, the six rules and the rule card are CloudNala frameworks; the six rules come from the NalaTolika concept design. The counter scenario is illustrative and does not describe any department, organisation or real incident. NalaTolika is a concept with no deployments, customers or data. Executable rules reduce the chance that a model error becomes an action; they do not eliminate model errors.

How CloudNala can help

CloudNala writes a rule card for every action your agent can take. We find the rules that live only in prompts, decide where each one should be enforced, write the boundary test cases, and connect each rule to the entities and states in your service map so that a blocked action can be explained to the applicant, the official and the auditor.


Work with CloudNala

CloudNala helps organisations move from technology ambition to practical execution across cloud, AI, data, platform engineering and digital services.

Whether you are exploring AI, modernising your cloud environment, building a public-sector digital service, or turning an idea into a working MVP, we can help you shape the roadmap and deliver the next step.

Book an Ontology and Agent Governance Assessment or write to us at consult@cloudnala.co.za

Found this useful?

Share