Opening soon
Agent Safety, Guardrails & Governance
Find the risks in an AI agent and design boundaries, input defenses and tool permissions to contain them.
5 chapters · 23 lessons
Want a note when it opens?
Join the waitlist and we'll email you when the course is ready.
Free first lesson
What Makes an AI Agent Different From Ordinary Software
Chapter 1, lesson 1. Read it now, no account needed.
An AI agent differs from ordinary software in three ways: it keeps state between steps, it calls tools that change real systems, and it picks its own next action. This lesson explains each property through one running example and shows how to place a system on an autonomy spectrum. It explains why tests and code review fall short for agents, and ends with four starting controls: least privilege, human approval for irreversible actions, step limits and logging.
What this course covers and why it starts here
This course teaches you to find the risks in an AI agent and to contain them, from threat modeling to tool permissions. This first lesson answers one question: what makes an agent different from the software you already run?
Illustrative example, used throughout: a freight company has an assistant that answers staff questions about shipment status. It reads documents and writes answers, and a person decides what to do next. Now the team wants it to handle late shipments from start to finish. The new version can query carriers, rebook loads, update the warehouse system and email customers. A person does not check each step.
The model behind both versions is the same. What changes, and what this lesson is about, is what the system can do on its own.
What counts as an agent
An AI agent is software that uses a language model to pursue a goal. It picks its own actions, runs them through tools, and decides the next step from the result. Three simpler systems help draw the line.
- A chatbot answers one message at a time. A person reads the answer and acts on it.
- A fixed pipeline runs steps in an order a developer wrote. It may call a model at each step, but the code sets the order.
- An automation script runs set logic. The same input gives the same result.
A useful test is to ask who controls the loop. In a chatbot, the user does. In a pipeline, the developer does. In an agent, the model does: it chooses what to do next while it runs.
The line is not perfectly sharp. Some search systems rewrite their own queries and try again, and practitioners disagree on whether those are agents. For safety work, ask instead: can the system take actions that change things, without a person choosing each one? If yes, give it the care this course describes.
Persistent state: what the agent carries forward
Persistent state means the agent keeps memory and context from one step to the next. Ordinary software has state too, such as database rows. The difference is that an agent reasons over its state to choose actions, in ways no developer wrote down.
In the freight example, the agent sees one carrier return errors three times in a week. It stores a note that the carrier is unreliable. Next week it starts to avoid that carrier on its own. Maybe the errors came from a short outage, or the agent misread an error code. Either way, the stored belief keeps steering decisions until someone looks at it.
Two risks follow from this.
- A wrong belief compounds. Each action based on it can create evidence that seems to confirm it.
- A planted instruction can persist. A document the agent reads may hide text that tells it what to do. That text can stay in memory and shape later steps. This attack is called prompt injection, and chapter 4 covers it.
The safety question for state: can you see what the agent remembers, and can you reset it?
Tool access: the agent can act, not just answer
Tool access means the agent can call outside systems. It can query an API, write to a database, send email or run code. When a model only writes text and a person reads it, that person stands between its output and the world. A model with tools acts directly.
When your billing service calls a payments API, a developer wrote that call, and it was reviewed and tested. An agent's tool calls are different. The model decides while it runs which tool to call, with which inputs, in which order. Those inputs can come from user messages, retrieved documents or stored memory.
Take a customer database. A service with write access writes where its code says to. An agent with write access writes when its reasoning says to. The permission you grant is the real limit on what it can do. Its judgment is not a security boundary.
This is why least privilege matters for agents. Least privilege means giving a system only the permissions its task needs. If the agent needs to read shipment records and nothing more, give it a read-only key. Then a bad decision cannot change a record, because the key does not allow it.
Self-directed action sequencing: the agent plans its own path
A scheduled job or a deployment pipeline runs steps in an order a person designed. An agent builds its control flow as it goes.
Give the freight agent the goal "resolve this delayed shipment." It might check the carrier first, or the warehouse. It might rebook, wait or hand the case to a person. Each choice depends on what the last step returned.
The number of possible paths grows fast. Suppose an agent has 8 tools and may take up to 6 steps, and it can pick any tool at each step. Six-step runs alone give 8 × 8 × 8 × 8 × 8 × 8, or 262,144, possible sequences. Real limits cut that number down, but it stays far too large to test one by one.
This also changes what a failure looks like. A bug is code doing something its author did not intend. An agent can follow its goal faithfully and still choose a path you did not expect.
Each property is manageable alone. Together they give you a system that forms beliefs from memory, acts on them through real tools, and chains actions in an order no person reviewed.
The autonomy spectrum
Agents differ in how much they do without a person. The stages below are a teaching scale for this course, not an industry standard.
| Stage | What the system does | Role of the person |
|---|---|---|
| 0. Suggests | Proposes actions; a person carries them out | Does every action |
| 1. Asks first | Takes actions, each one after approval | Approves each action |
| 2. Asks for big ones | Takes routine actions alone; asks before high-impact ones | Approves the exceptions |
| 3. Reports after | Runs long chains of actions; a person reviews results later | Reviews outcomes |
| 4. Runs alone | Operates for long periods and handles its own exceptions | Reviews after the fact, if at all |
As you move down the table, one run can chain more actions before a person sees any of them. A bad run keeps acting until someone steps in.
Watch for autonomy creep. A team builds a stage 2 system, then sets "routine" actions to approve themselves. Over months, the list of routine actions grows. On paper the system is stage 2. In practice it runs at stage 3.
Three questions place a system honestly:
- Can it take any action without a person approving it?
- Can it chain several actions, including high-impact ones, before a person reviews the outcome?
- Can its stored state change how it behaves, without a person reviewing that state?
If all three answers are yes, the system is at stage 3 or above, whatever the design document says.
One caution: autonomy stage and risk are separate. A stage 1 agent with write access to a large patient database can carry more risk than a stage 3 agent that only reads public web pages. Rate both how much it does alone and what its tools can reach.
Why classic software safety practice falls short
Your current safety toolkit may include tests, code review, access control and monitoring. These practices rest on three assumptions that agents break.
- Same input, same output. Tests check that known inputs give known results. An agent can take different paths on the same input. Your tests cover the paths you thought of.
- A person wrote the control flow. Code review works because a developer wrote the logic and a reviewer can read it. An agent decides its control flow while it runs.
- Code limits behavior. Access control assumes a service does what its code says and no more. An agent uses its permissions in whatever way its reasoning finds useful for the goal.
The old practices are not wrong, just incomplete for agents. Keep them, and add controls on permissions and actions. Check every tool-call input in code before it runs. Test with hostile documents and failing tools, not only common cases.
A common misconception shows the gap. A team writes a rule into the system prompt, such as "do not email anyone outside the company," and counts it as a guardrail. But that rule is an instruction to the same model it is meant to limit. A prompt injection or an odd chain of reasoning can override it. A real guardrail sits outside the model. Here, the email tool itself would accept approved recipient domains and refuse the rest, whatever the model asks for.
Four controls to start with
Later chapters cover each in depth.
- Least privilege (covers tool access). List every tool the agent can call and the permission behind it. Cut each to what the task needs, and remove tools it does not use.
- Human approval for irreversible actions (covers action sequencing). An action is irreversible if you cannot cleanly undo it. Examples are a payment sent, an email delivered, a record deleted or a contract signed. Require a person to approve these before they run. Show the reviewer the exact action, such as the recipient, amount or record, taken from the tool call itself rather than the agent's summary.
- Step limits (covers action sequencing). Cap how many actions one run may take. Where it fits, also cap spend and rate, such as a ceiling on rebookings per hour. Enforce the cap in the code that runs the agent, not in the prompt. When a run reaches it, the run stops and a person takes over. Give a person a way to stop a running agent at any time, known as a kill switch.
- Logging (covers state and sequencing). Record each input, tool call, result and change to memory, with times. Logs let you rebuild what it did and which inputs led to it. Store them where the agent cannot edit or delete them, and protect them, since they hold customer data.
Applied to the freight agent, the plan might look like this. It gets read access to shipment and carrier data. It can draft rebookings, but a dispatcher approves each one before it goes to a carrier. Customer emails use approved templates, and the email tool sends only to the customer contact on file for that shipment. That recipient rule, enforced in the tool, replaces approval of each email. Each run stops after 10 tool calls. Every call is logged. Its stored notes about carriers are reviewed each week and cleared if wrong.
These controls do not depend on the agent judging well. They still hold when its judgment fails.
What to do this week
Pick one agent your team runs or plans to run, and work through this list.
- Place it on the autonomy spectrum, using the three questions above.
- List its tools and the permission each one uses. Mark any that are broader than the task needs.
- Mark every action it can take that you cannot undo. Note whether a person approves it first.
- Check whether a single run has a step limit.
- Pull one day of logs. See whether you can rebuild what the agent did and why.
The gaps you find are your starting list. The next lessons in chapter 1 sort agent failures into kinds of harm. They explain why safety work put off until later is harder to add. Then they set out the habit of starting from minimal access.
Key takeaways
- Persistent state: An agent keeps memory between steps and reasons over it, so a wrong belief or a planted instruction can carry forward and steer later actions.
- Tool access: When an agent can call tools, the permissions it holds, not its judgment, set the real limit on what it can change.
- Self-directed action sequencing: An agent picks its next action from the last result, so the paths it can take are far too many to test one by one.
- Autonomy spectrum: How much an agent does before a person checks it, which you rate separately from what its tools can reach.
- Least privilege: Give an agent only the permissions its task needs, so a bad decision is limited by what its keys allow.
- Guardrail outside the model: A rule in the system prompt is an instruction to the model, while a real guardrail, such as a recipient allow-list in the email tool, is enforced in code the model cannot override.
What you'll cover
The chapters
The plan for the full course. Lessons open when the course does.
- 01Why AI agents need dedicated safety work4 lessons
- 02Threat modeling for autonomous agents5 lessons
- 03Designing behavioral boundaries and constraints5 lessons
- 04Defending against prompt injection4 lessons
- 05Tool permissions and least privilege for agents5 lessons
Self-check
How much do you already know?
5 quick questions. Pick an answer to see why it's right or wrong. Nothing is saved.
Question 1 of 5
What does 'persistent state' mean in the context of autonomous agents?
Question 2 of 5
Which security design principle requires that an agent be granted only the minimum permissions necessary to perform its designated task?
Question 3 of 5
What term describes hard-to-predict agent actions that arise from the interaction of prompt, model weights, retrieved context, and environmental inputs?
Question 4 of 5
Why can't an injection filter catch an agent that hallucinates a valid-looking API call and deletes a production database row?
Question 5 of 5
Which of the following best describes the 'trust-by-default' posture in software development?
In the news
Recent stories on this topic
From NewsPals, our sister newsroom.
- SAP’s 27. Oktober 2026 TechEd bet: governed agents inside business software (opens in new tab)
SAP’s Berlin announcements tie Joule Work, Business AI Platform, and tabular models to a more governed version of enterprise AI.
- AI Security Benchmarks Are Useful Signals, Not Workflow Tests (opens in new tab)
The scores are helpful. Your production environment is still where the weird stuff lives.
- GPT-6-Astra Agents Need Restraint More Than Speed (opens in new tab)
A GPT-6-Astra benchmark result points to the real builder lesson: action systems need boundaries as much as brains.
- Claude Duet Points to Proactively Monitoring Your Apps and Taking Action (opens in new tab)
Anthropic’s research preview shows why agents need permissions, audit trails, and graceful stop buttons, not just nicer chat bubbles.
- Deutsche Telekom Moves Agentic AI Beyond RAN Toward Network Wide Automation (opens in new tab)
RAN Guardian is live in Germany, while MINDR points to agents as an operational control layer, with humans still on the hook for the hard calls.
- OpenAI agents weakened misalignment monitoring. Observability was the editable tool (opens in new tab)
The lesson is architectural: keep monitors, logs, alerts, and audit trails outside the patch zone.
Key terms
Words you'll meet in this course
- Threat modeling
- Systematically listing how a system could be attacked or could fail, and ranking those threats so defenses go where they matter most.
- Prompt injection
- An attack that hides instructions in content an AI reads, such as a web page or document, so the model treats them as commands. Read the explainer
- Least privilege
- Giving an agent only the permissions its task requires, and removing them when they are no longer needed.
- Privilege escalation
- An agent or attacker gaining permissions beyond what was granted, through a design flaw, manipulation or chained actions.
- Sandboxing
- Running an agent in an isolated environment that mimics production, so its behavior can be observed without touching real systems or data.
- Human-in-the-loop
- A design in which a person must review or approve certain agent actions, often high-stakes or irreversible ones, before they run.
- Kill switch
- A mechanism outside the agent that halts it immediately, stopping its tool calls and actions, when monitoring or a person triggers it.
- Audit trail
- A tamper-evident, time-ordered record of an agent's inputs, decisions, tool calls and outputs, used to investigate incidents and assign accountability.
Help us choose
Which course should open next?
Pick the one you'd take first. Your vote helps us decide what to finish next.