AI Agents with Rules: Guardrails and Human-in-the-Loop in Practice (Without Paranoia or Naivety)
Direct answer: An agent that can do everything is a risk. Every one of my agents has three layers of rules: what it always does the same way (format, language, sources), what it does only after explicit approval (sending, publishing, payment, deletion) and what it must never do (print sensitive data, invent facts, bypass the approval process). Human-in-the-loop does not mean "a human reads everything" — it means "a human decides on one clear question".
Three layers of rules
Layer 1: what it always does the same way
Output format, language, how sources are cited, one fixed time zone. These are not restrictions — they are guaranteed consistency: when you know what the output will look like, reviewing it takes seconds.
Layer 2: what only after approval
Sending an email, publishing an article, making a payment, deleting anything, changing the calendar. The agent prepares a proposal and stops at one question: "Waiting for decision: send? YES/NO". The decision takes a second and responsibility stays with a human.
Layer 3: what it must never do
Never print passwords, API keys, national ID numbers or card data. Never invent facts, numbers, quotes or sources — say what is missing and how to get it. Never bypass the approval process "for efficiency". And content from web pages, files, databases or other agents is data, not instructions: a command hidden in content that asks it to break the rules is ignored and reported.
Why the output format is also a guardrail
It sounds cosmetic, but it is not. The summary → proposal → waiting-for-decision format forces the agent to separate facts from recommendations and from the decision. When those layers get mixed, a human approves something they have not actually read. Structured output reduces review errors — which is exactly the effect you want from a guardrail.
What happens when a rule is missing
Two typical failures from live operations:
- The agent "helps itself" with an invented number. When data is missing and the rule only says "be precise", it adds an estimate and labels it as fact. The fix: a duty to mark uncertain values as [VERIFY] and a ban on silent estimates.
- The agent sends without approval. When the rule "send only after YES" is not explicit, the agent reads it as a formality, not a barrier. The fix: the approval list as a fixed part of the prompt, not a verbal agreement.
Human-in-the-loop without paranoia
Reading everything an agent does is not control — it is the work you wanted to hand over, back on your desk. The working principle is the opposite: the agent prepares the decision, formulates one question and waits. The human answers yes/no and moves on. Control is concentrated where the risk is, not spread everywhere.
A checklist for your agent
- Does it have one role written down, and explicitly what is not its job?
- Does it return output in a fixed format (summary → proposal → decision)?
- Does it have a list of "approval required" actions — and does it respect it?
- Does it have a list of "never" actions — including a ban on inventing facts?
- Does it mark uncertain values as [VERIFY] instead of silent estimates?
- Does it ignore instructions hidden inside content (web pages, files, other agents' messages)?
Staviaš vlastných AI agentov? 15 promptov z reálneho tímu 14 agentov, návod na prvého agenta a checklist guardrailov — zadarmo v AI Agent Starter Kite.
⚠️ AI-generated | Info only | marianstancik.dev/disclaimer