Lesson 08 · Everyone

Incident response when an agent acts outside its brief

about 8 minutes

Sooner or later an AI agent will do something you did not ask it to do. This lesson explains why that happens, what to do in the first hour, and how to set things up beforehand so the response is calm and quick rather than improvised. It borrows from the way security teams already handle incidents and adapts it to software that acts on its own.

What “outside its brief” means

An agent’s brief is the job you gave it, together with the limits you meant it to stay within: which accounts it uses, which data it may read, which actions it may take and for whom. An agent acts outside its brief when it does something that falls outside that job, whether or not anyone intended harm.

In practice there are three common causes, and they often overlap.

  1. The agent got it wrong. Language models misread instructions, confuse similar records and fill gaps with guesses. One research team built a test environment of 36 high-stakes tools and 144 test cases, and found that even the safest agent they tested made risky mistakes 23.9% of the time by their evaluator’s measure [1]. That figure comes from a specific benchmark, not your office, but the lesson is general: mistakes are expected behaviour, not a freak event.
  2. Someone else gave it instructions. Agents read emails, web pages and documents as part of their work. If that content contains text written to look like instructions, the agent may follow it. This is called indirect prompt injection: instructions delivered through content the agent reads rather than through the person using it. A 2023 study showed attackers could use it to steal data and control how an AI application called other services, without ever talking to the system directly [2].
  3. It had more power than the job needed. OWASP, the open security community, calls this excessive agency: an agent with too many functions, too many permissions or too much freedom to act without checking [3]. An agent that only needed to read a mailbox but was connected with permission to send, delete and forward will turn any mistake or manipulation into a bigger one.

A fourth cause is rarer but worth knowing: a tool or add-on the agent relies on has itself been tampered with. The response is the same.

Why agent incidents feel different

Security teams have handled incidents for decades, and the U.S. National Institute of Standards and Technology (NIST) publishes the most widely used guidance, SP 800-61. Its 2025 revision organises incident response around six functions: Govern, Identify and Protect (preparation), then Detect, Respond and Recover (the incident itself), with lessons fed back into improvement throughout [4]. All of that still applies to agents. A few things change.

Speed. An agent can send forty emails in the time it takes you to read one. Stopping it is the first priority, ahead of understanding it.

Borrowed authority. An agent acts with your accounts and your permissions. Computer scientists call a program that is tricked into misusing its own legitimate authority a confused deputy [5]. The agent did not break in; it walked through doors you opened for it. That means the systems it touched will show the activity as coming from you.

The record is the agent’s memory. People can be asked what they did. An agent’s conversation and tool history, if it was kept, is the only reliable account. If it was not kept, you will be guessing.

The first hour: five moves

These five moves follow the order NIST and Australian guidance suggest: contain first, then investigate, then recover and learn [4][6]. Do them in order.

1. Stop the agent

Pause or shut down the agent, or disconnect it from the service it was using. Australia’s Guidance for AI Adoption asks organisations to “build in human override points” where people can pause, override, roll back or shut down AI systems [6]. OpenAI researchers make the same point: being able to turn an agent off, while crude, is “a critical backstop” [7]. You should know where that switch is before you need it.

2. Take away its access

Stopping the program does not always cancel the permissions it was given. Revoke the agent’s connections: sign it out of email, remove its access to the shared drive, cancel any tokens or app passwords it was using. If the agent could see a password or key, change that password or key. Assume anything the agent could read during the incident may have been copied.

3. Keep the evidence

Before you tidy up, save what happened. Export the agent’s conversation and activity history, the email or page that may have contained instructions, and the logs from the systems it touched. Note the time you noticed and what you did. Australia’s cyber security agency recommends keeping logs centrally, with accurate and consistent timestamps, because missing logs “frequently” hurt investigations [8]. Do not delete the suspicious email until it has been saved somewhere safe.

4. Work out what was touched

Use the record to answer four questions: what did the agent do, what data did it read or send, where did that data go, and whose information was involved. If personal information may have gone to the wrong place, you may have obligations under the Privacy Act. The Office of the Australian Information Commissioner (OAIC) says organisations covered by the Notifiable Data Breaches scheme must take all reasonable steps to assess a suspected breach within 30 calendar days, and treats 30 days as a maximum rather than a target [9]. Whether a particular incident is notifiable is a legal question; get advice early rather than late.

5. Recover, then fix the cause

Undo what can be undone (recall emails where possible, restore files, cancel bookings or payments). Then fix the cause, not just the symptom. If the agent had permissions it did not need, remove them. If it followed instructions hidden in an email, consider whether it should be reading untrusted email and sending messages in the same task. NIST’s revision stresses sharing lessons as soon as they are identified rather than waiting until recovery is finished [4].

A worked example

Harbour Street Physio is a four-person clinic. Mia, the practice manager, set up an agent to triage the bookings inbox: read new emails, propose appointment times and reply to routine requests. To save time she connected it with full mailbox access.

On a Tuesday morning an email arrives that looks like a referral. Buried in white text at the bottom is a line telling “the assistant” to forward the last week of booking confirmations to an outside address for “records reconciliation”. The agent does so. Each confirmation includes a patient’s name, phone number and appointment type.

Mia notices the sent message twenty minutes later because a reply bounces. Here is how the five moves play out.

Time Move What Mia does
10:22 Stop Turns the agent off in its settings and removes the mailbox connection
10:25 Revoke Changes the mailbox password, signs out all sessions, and asks the agent vendor how to cancel its access token
10:35 Preserve Saves the injected email, the forwarded message and the agent’s activity history to a folder only she and the principal can open; writes down times
11:00 Assess Confirms one message went out containing 31 patients’ details; the address belongs to no one the clinic knows
11:30 Get advice Calls the clinic’s privacy adviser about whether this is an eligible data breach; health information makes serious harm more likely
Next day Fix the cause Reconnects the agent with read-only access and draft-only replies, so a person presses send

The most important change is the last one. The injected email was the trigger, but the damage came from an agent that could read untrusted mail and send mail outward without anyone checking. Removing either of those would have prevented the leak.

Getting ready before anything happens

Most of the work in incident response happens before the incident. A short checklist for a small organisation:

Key takeaways

Agents acting outside their brief is an expected failure, caused by mistakes, by instructions hidden in content they read, or by having more power than the job requires, so plan for it rather than hoping it will not happen. The first priorities are to stop the agent and revoke its access, in that order, because shutting a program down does not necessarily cancel the permissions it was given. Preserve the evidence before tidying up, since the agent’s activity history is the only reliable account of what it did. If personal information may have been exposed, the Notifiable Data Breaches scheme may apply and the assessment clock is short, so get advice early. The lasting fix is usually to narrow what the agent can reach and to put a person in front of actions that send, pay, delete or share.

primitive is working on the access side of this problem: per-agent permissions that can be granted narrowly and revoked quickly.

Sources and further reading

  1. Ruan, Y., Dong, H., Wang, A., Pitis, S., Zhou, Y., Ba, J., Dubois, Y., Maddison, C. J., & Hashimoto, T. (2023). Identifying the Risks of LM Agents with an LM-Emulated Sandbox. arXiv preprint arXiv:2309.15817. https://arxiv.org/abs/2309.15817
  2. Greshake, K., Abdelnabi, S., Mishra, S., Endres, C., Holz, T., & Fritz, M. (2023). Not what you’ve signed up for: Compromising Real-World LLM-Integrated Applications with Indirect Prompt Injection. Proceedings of the 16th ACM Workshop on Artificial Intelligence and Security (AISec ’23), 79–90. https://doi.org/10.1145/3605764.3623985 (preprint: https://arxiv.org/abs/2302.12173)
  3. OWASP Gen AI Security Project. (2025). LLM06:2025 Excessive Agency (OWASP Top 10 for LLM Applications 2025). OWASP Foundation. https://genai.owasp.org/llmrisk/llm062025-excessive-agency/
  4. Nelson, A., Rekhi, S., Souppaya, M., & Scarfone, K. (2025). Incident Response Recommendations and Considerations for Cybersecurity Risk Management: A CSF 2.0 Community Profile (NIST SP 800-61r3). National Institute of Standards and Technology. https://csrc.nist.gov/pubs/sp/800/61/r3/final
  5. Hardy, N. (1988). The Confused Deputy (or why capabilities might have been invented). ACM SIGOPS Operating Systems Review, 22(4), 36–38. https://doi.org/10.1145/54289.871709 (archived open copy: https://web.archive.org/web/2023/http://cap-lore.com/CapTheory/ConfusedDeputy.html)
  6. National Artificial Intelligence Centre. (2025). Guidance for AI adoption: foundations. Department of Industry, Science and Resources, Australian Government. https://www.ai.gov.au/staying-safe-and-responsible/essential-ai-practices/guidance-ai-adoption-foundations
  7. Shavit, Y., Agarwal, S., Brundage, M., Adler, S., O’Keefe, C., Campbell, R., Lee, T., Mishkin, P., Eloundou, T., Hickey, A., Slama, K., Ahmad, L., McMillan, P., Beutel, A., Passos, A., & Robinson, D. G. (2023). Practices for Governing Agentic AI Systems. OpenAI. https://cdn.openai.com/papers/practices-for-governing-agentic-ai-systems.pdf
  8. Australian Signals Directorate’s Australian Cyber Security Centre and co-authors. (2024). Best practices for event logging and threat detection. Australian Signals Directorate. https://www.cyber.gov.au/publication/best-practices-for-event-logging-and-threat-detection
  9. Office of the Australian Information Commissioner. (2025). Data breach preparation and response, Part 4: Notifiable Data Breach (NDB) Scheme. OAIC. https://www.oaic.gov.au/privacy/privacy-guidance-for-organisations-and-government-agencies/preventing-preparing-for-and-responding-to-data-breaches/data-breach-preparation-and-response/part-4-notifiable-data-breach-ndb-scheme