Which Actions Need a Human?
Sort agent tools by four questions (can the action be undone, how much money it commits, whether it touches regulated data, how far a mistake spreads) and turn the answers into a code policy that decides which calls run alone and which wait for a person.
Contentsand lesson path
On this page
- The Illusion of Full Autonomy
- Four Questions to Ask About Every Tool
- Verify Your Understanding
- Apply it
- Review Prompt
Lessons of Human-in-the-Loop Control
- Which Actions Need a Human? Concept · 15 min
- Interrupting Before a Risky Tool Call Worked example · 20 min
- Lab: Approve, Edit or Reject, Then Resume Lab · 25 min
- Approval Design and Approval Fatigue Concept · 15 min
- Escalation Paths and Override Metrics Worked example · 15 min
- Check: Human Oversight Scenarios Knowledge check · 8 questions
What you will learn
- Classify an agent's actions by risk and reversibility and decide which require approval, notification or neither.
Prerequisites: Agent Loops & ReAct
01. The Illusion of Full Autonomy
In demos, full autonomy looks like the goal: an agent receives a goal, picks tools, writes code, changes production databases and charges payment cards with no person involved. With synthetic test data this is impressive. In production, with real customers and real money, unlimited autonomy is a risk that most businesses cannot accept.
Every model makes mistakes. When an agent invents a refund amount, drops a database table, sends an unchecked legal document or buys cloud capacity that nobody approved, the cost of the error is far larger than the time it saved. A safe design therefore decides, tool by tool, which actions run on their own and which wait for a person to approve them.
02. Four Questions to Ask About Every Tool
This lesson sorts tools with four questions. They are not a formal industry standard; they are the questions that most approval policies come down to, and the code below turns the answers into risk tiers.
1. Can the action be undone? People sometimes call the two kinds two-way and one-way doors.
- Reversible actions (two-way doors) can be undone completely and cheaply: reading internal documents, saving a draft reply, inserting a temporary staging row, running a read-only SQL query. They can usually run without approval and be audited afterwards. If the agent drafts a poor email, a person can fix the wording before it is sent.
- Irreversible actions (one-way doors) cannot be undone without legal, reputational or data loss: sending an email to an external client, a hard delete such as
DROP TABLE, or calling an external webhook. They need approval before they run, with one deliberate exception: money tools such as small refunds are irreversible but low in value, so reviewed per-call and cumulative limits can replace an approval for each call. The policy below does this.
2. How much money or resource does it commit? Give every tool that moves money (refunds, cloud purchases, transfers) or starts expensive compute an explicit numeric limit. For example, the agent may issue credits of up to $50 per refund and $200 per customer per day; anything above either limit needs approval, and amounts over $500 might go to a manager. The cumulative limit matters as much as the per-call one: without it, an agent, or an attacker steering it, can drain an account with many refunds that each sit just under the threshold.
3. Does it touch personal or regulated data? Reading, changing or exporting personally identifiable information (PII), health records, unreleased financial results or privileged legal messages should not depend on the model behaving well. Put an approval or compliance check in front of these tools. In healthcare and financial services, exporting patient or customer records without an authorised person involved can breach laws such as HIPAA or the GDPR and lead to fines.
4. How far does a mistake spread? The blast radius is the number of users, services or downstream systems affected if the tool runs with wrong arguments. Restarting one isolated pod has a small blast radius; changing production routing tables, replacing TLS certificates or publishing a release has a large one and needs a person to approve it. Record the blast radius of each tool in the reviewed registry, so that a high-impact tool is classified HIGH and the router sends it to a person instead of letting the model decide.
from dataclasses import dataclass
from decimal import Decimal, InvalidOperation
from enum import Enum
from typing import Any, Dict
class RiskTier(Enum):
LOW = "autonomous"
MEDIUM = "autonomous_with_audit"
HIGH = "approval_required"
class InvalidArguments(ValueError):
pass
@dataclass(frozen=True)
class ToolPolicy:
read_only: bool
reversible: bool
max_per_call_usd: Decimal = Decimal("0") # 0 = no money moves
# A reviewed registry: people classify each tool; names prove nothing
REGISTRY = {
"search_orders": ToolPolicy(read_only=True, reversible=True),
"draft_email": ToolPolicy(read_only=False, reversible=True),
"refund_customer_account": ToolPolicy(False, False, Decimal("50")),
"drop_database_table": ToolPolicy(False, False),
}
DAILY_AUTONOMOUS_USD = Decimal("200") # per customer, across all calls
def parse_amount(args: Dict[str, Any]) -> Decimal:
raw = args.get("amount_usd")
if raw is None or isinstance(raw, bool):
raise InvalidArguments("amount_usd is required")
try:
amount = Decimal(str(raw))
except InvalidOperation:
raise InvalidArguments(f"amount_usd is not a number: {raw!r}") from None
if not amount.is_finite() or amount <= 0:
raise InvalidArguments(f"amount_usd must be positive: {raw!r}")
return amount
def evaluate_tool_risk(tool_name: str, args: Dict[str, Any],
spent_today: Decimal) -> RiskTier:
policy = REGISTRY.get(tool_name)
if policy is None:
return RiskTier.HIGH # default deny: an unknown tool needs a person
if policy.read_only:
return RiskTier.LOW
if policy.max_per_call_usd > 0:
amount = parse_amount(args)
over_call = amount > policy.max_per_call_usd
over_day = spent_today + amount > DAILY_AUTONOMOUS_USD
return RiskTier.HIGH if over_call or over_day else RiskTier.MEDIUM
return RiskTier.MEDIUM if policy.reversible else RiskTier.HIGHFour choices make this policy fail closed:
- Default deny: a tool missing from the reviewed registry is HIGH. A name such as
get_all_customer_secretsearns no trust from itsget_prefix. - Validated amounts: a missing, non-numeric, negative or
NaNamount raises an error instead of defaulting to zero, andDecimalavoids float rounding on money. - Per-call and cumulative limits: each refund is checked against $50 and the customer's running total for the day against $200. In production the daily total must be reserved atomically (for example a database update that adds the amount only if the new total stays under the limit), otherwise two concurrent $49 refunds can both pass the check.
- MEDIUM is still logged: autonomous writes run, but every one goes to the audit log for review.
"""Negative tests: inputs that would make a careless policy fail open."""
import unittest
from decimal import Decimal
from risk_policy import InvalidArguments, RiskTier, evaluate_tool_risk
ZERO = Decimal("0")
class RiskPolicyTests(unittest.TestCase):
def tier(self, tool, args, spent=ZERO):
return evaluate_tool_risk(tool, args, spent)
def test_unknown_tool_needs_approval(self):
self.assertEqual(self.tier("wire_funds", {}), RiskTier.HIGH)
def test_read_prefix_is_not_trusted(self):
self.assertEqual(self.tier("get_all_customer_secrets", {}), RiskTier.HIGH)
def test_refund_over_per_call_limit_needs_approval(self):
args = {"amount_usd": 499}
self.assertEqual(self.tier("refund_customer_account", args), RiskTier.HIGH)
def test_many_small_refunds_hit_the_daily_limit(self):
spent, tiers = ZERO, []
for _ in range(5): # five $49 refunds to one customer in one day
tier = self.tier("refund_customer_account", {"amount_usd": 49}, spent)
tiers.append(tier)
if tier is RiskTier.MEDIUM:
spent += Decimal("49")
self.assertEqual(tiers[:4], [RiskTier.MEDIUM] * 4)
self.assertEqual(tiers[4], RiskTier.HIGH)
def test_missing_or_bad_amounts_are_rejected(self):
for args in ({}, {"amount_usd": "abc"}, {"amount_usd": -10},
{"amount_usd": True}, {"amount_usd": "NaN"}):
with self.assertRaises(InvalidArguments):
self.tier("refund_customer_account", args)
def test_small_refund_runs_with_audit(self):
args = {"amount_usd": "30.00"}
self.assertEqual(self.tier("refund_customer_account", args), RiskTier.MEDIUM)
if __name__ == "__main__":
unittest.main()python3 -m unittest test_risk_policy......
----------------------------------------------------------------------
Ran 6 tests in 0.001s
OKIn a graph, the orchestrator calls evaluate_tool_risk before a tool runs, and the tier picks the next node. A LOW call goes straight to the node that runs the tool. A MEDIUM call runs too, and the notification goes out. A HIGH call pauses the run, creates a review task and alerts the person who must decide; the next lesson shows how that pause works.
Keeping the policy in deterministic code, rather than asking the LLM "Do you think this action is safe?", means the model cannot talk its way past it. It does not stop prompt injection from steering actions the policy allows, such as reading data and sending it somewhere, so pair it with least-privilege tools and checks on what leaves the system. The OWASP Top 10 for LLM Applications 2026 files this risk under LLM03:2026 Excessive Agency: it names too much functionality, too many permissions and too much autonomy as the causes, and recommends human approval for high-impact actions. The 2026 edition renumbered the 2025 list, so older articles call this entry LLM06.
Routing in code also leaves a clear audit trail: every tool request is stamped with its tier before it runs or pauses. If an injected instruction asks the model for a transfer above its limits, the router sends it to a person instead of running it. The negative tests above check the fail-open cases this lesson names: unknown tools, trusted-looking names, amounts over either limit and malformed amounts.
03. Verify Your Understanding
04. Apply it
Classify the tools of an agent you know, such as a support or an operations agent, and check your registry against these points:
- A tool that is not in the registry yet is HIGH until a person classifies it.
- Agree the money limits with the finance or risk team, and review them when incidents or override data suggest they are wrong.
- An approval request shows the reviewer what they need to decide: the user's request, the agent's stated reason, the proposed arguments and what exactly will change.
- For sensitive work, such as payroll or production changes, the person who started the run is not the only one who can approve it.
- Measure how long approvals take. If reviewers are often too slow, look for MEDIUM-risk actions that could run with notification instead.
- Log every risk decision, with the arguments, the tier, the approver, the time and the outcome, in a store that cannot be edited afterwards.
05. Review Prompt
Explain the four questions this lesson asks about each tool: reversibility, financial exposure, regulated data, and blast radius. Provide a concrete example of an agent tool for each question and justify why it belongs in either the autonomous, human-on-the-loop, or human-in-the-loop operational tier. In your answer, explain why risk evaluation must be enforced by deterministic code gates rather than prompt instructions.
References
Your progress
Reading state
Sign in to save that you finished reading this lesson.
Prove this skill
8 questions · about 6 minutes · scored automatically. Marking a lesson as read never demonstrates a skill.