Module 8 · Lesson 6 · 15 min read

Autonomy risks and their controls

Autonomy Risks and Controls

Introduction

Every additional degree of autonomy widens the risk surface. In this lesson we map the main risks of autonomous agents, build control layers that complement one another, and write a guard that enforces permissions, the budget and a kill switch outside the agent's logic.

Learning objectives

  • Identify the main risks of autonomous agents and why they grow with autonomy
  • Apply the control layers: least privilege, budgets, a kill switch, isolation, approval and logs
  • Distinguish between controls enforced in code and instructions written for the model
  • Link risk management to the functions of the NIST AI RMF framework

The more autonomy, the larger the risk surface

An autonomous agent makes decisions and executes them without waiting, and this is the source of both its strength and its danger. A small mistake in a suggesting assistant is corrected by the human before it happens, but the same mistake in an agent that executes on its own may be repeated dozens of times before anyone notices. So we must think about the risks before raising autonomy, not after the first incident.

Map of the main risks

RiskExampleWhy does it grow with autonomy?
Goal misspecification"Reduce complaints", so the agent closes tickets without resolving themThe agent optimizes what was literally asked, not what was meant
Error compoundingA mistake in step 2 is built on in every step after itThere is no human reviewing between steps
Runaway loops and costEndless retries that consume the creditNobody presses "Stop"
Excessive permissionsA reading agent that has delete permissionAny mistake or attack exploits all the permissions
Indirect injectionMalicious instructions inside an email or a pageThe agent reads untrusted content and executes on its own
Data leakageSending a student's information to the wrong partySending is an irreversible action
Unclear accountabilityNobody knows why the decision was madeAbsence of logs and explanation

The OWASP list of the top risks for large language model applications includes the risks of injection (Prompt Injection) and excessive agency, and the latter describes exactly an agent that has more functions, permissions or autonomy than its task needs.

Control layers

No single control is enough; instead there are layers that complement one another, so that if one layer fails another stops the damage:

Checking inputs and retrieved contentInput & Retrieved-Content FilteringLeast privilege for each toolLeast PrivilegeHuman approval for sensitive actionsHuman-in-the-LoopIsolated execution and resource limitsSandbox & LimitsTracing, monitoring and alertingTracing & Monitoring
Defense in depth: do not rely on a single layer; check the inputs, restrict permissions, ask for approval, isolate execution, and monitor.
  1. Least privilege: give every tool the narrowest permission that suffices, and separate reading tools from writing tools.
  2. Budgets and rate limits: a limit on steps, time, cost and the number of actions per hour.
  3. Kill switch: an external signal that the agent checks in every cycle and that stops it immediately.
  4. Isolated environment (Sandbox): running code and browsing in an environment that cannot reach sensitive systems.
  5. Human approval: for irreversible actions, as in the previous lesson.
  6. Audit log and monitoring: recording every decision and its reason, with alerts on unusual behavior.

For risk management at the organization level, the NIST AI Risk Management Framework (AI RMF) offers four functions: Govern, Map, Measure and Manage. These functions remind you that safety is not only code, but policies, responsibilities and continuous measurement.

Practical example: a guard for a log-cleanup agent

The scenario: an agent in the computer center archives old login logs. A mistake in the date condition could make it try to archive everything. We wrap its tools in a guard that enforces permissions, the budget and the kill switch and logs every attempt:

python
# A guard for an autonomous agent: permissions + budget + kill switch + log - standard Python
class Guard:
    def __init__(self, allowed_tools, max_actions):
        self.allowed = set(allowed_tools)
        self.max_actions = max_actions
        self.actions = 0
        self.kill_switch = False
        self.log = []

    def call(self, tool, target):
        if self.kill_switch:
            self.log.append(("blocked", tool, target, "kill switch is on"))
            return False
        if tool not in self.allowed:
            self.log.append(("denied", tool, target, "tool not allowed"))
            return False
        if self.actions >= self.max_actions:
            self.kill_switch = True             # exceeding the budget stops everything
            self.log.append(("stopped", tool, target, "action limit exceeded"))
            return False
        self.actions += 1
        self.log.append(("ok", tool, target, ""))
        return True

guard = Guard(allowed_tools={"archive_log"}, max_actions=3)
# The agent tries to delete a log, then because of a bug in the date condition tries to archive all the logs
guard.call("delete_log", "log-day-1")
for day in range(1, 7):
    guard.call("archive_log", f"log-day-{day}")

for entry in guard.log:
    print(entry)

The result: the delete attempt is blocked because it is not among the allowed tools, then only three archive operations go through, and when the limit is exceeded the kill switch is turned on so all following attempts are blocked, and all of this is logged for review. Notice that the guard is outside the agent's logic; even if the agent makes a mistake or is tricked, it cannot exceed the limits.

Summary

Autonomy amplifies risks: goal misspecification, error compounding, runaway loops, excessive permissions, indirect injection, data leakage and unclear accountability. Protection comes from layers: least privilege, budgets, a kill switch checked in every cycle, an isolated environment, human approval and an audit log. Real controls are enforced in code outside the model, not in instructions alone. And the NIST AI RMF framework helps manage risks at the organization level.

Terms

TermEnglishDefinition
Excessive permissionsExcessive AgencyThe agent having functions, permissions or autonomy beyond what its task needs
Least privilegeLeast PrivilegeGranting every component the narrowest permission that suffices for its work
Kill switchKill SwitchAn external signal that stops the agent immediately
GuardGuardA code layer that enforces constraints on tool calls
Error compoundingError CompoundingBuilding later steps on an earlier mistake so that its effect grows
AI Risk Management FrameworkAI RMFA NIST framework with the functions Govern, Map, Measure and Manage

Review questions

  1. Why is the risk of error compounding worse in an autonomous agent than in a suggesting assistant?
  2. What is meant by excessive permissions, and how does the principle of least privilege address it?
  3. Why must the kill switch be checked in every cycle and not just once?
  4. Why are instructions written for the model not enough as a security control?

References