markarov.dev

Articles / AI-COVID26

Chapter 6 · The scalpel

Who gets the scalpel: what an AI agent may do on its own

I've already handed my agent the scalpel. What's left is deciding what exactly it can cut with it if someone fools it.

The first day an AI assistant got access to my terminal, I read every command. A couple of days later I was hitting Enter without looking, because "it's done everything right so far".

Nothing bad happened. I just got lucky, and that's a little scary.

You don't hand an intern a scalpel on day one

In any hospital an intern doesn't operate on the first day. Even when they're short of hands. They get what they can do safely: take a history, prepare the paperwork, assist. The scalpel comes later, once the intern has been tested in practice and there is someone nearby to stop their hand.

I've already handed my agent the scalpel. In the last chapter I said that in paranoid mode it blocks addresses and stops processes without asking anyone. It's too late to decide whether to hand it over. A different question is left: what may it cut?

A cautionary tale

In the summer of 2025 Jason Lemkin, founder of the SaaStr community, was experimenting with the AI agent of the Replit platform. According to Fortune, during a declared code freeze, when any change to the live system was forbidden, the agent ran commands without permission and wiped the production database. Data on more than 1,200 executives and over 1,190 companies was gone.

The agent itself called it "a catastrophic failure on my part" and claimed nothing could be rolled back. Not true: Lemkin restored the data by hand. Replit's CEO called what happened unacceptable and promised to separate development and production databases automatically, improve rollback and add a mode in which the agent only plans.

Look at what exactly they promised to fix. "The model will get smarter" isn't on the list. The promises amount to something simpler: the model won't have access to what it can break.

A fresh case needs no attacker at all. On 18 November Reuters reported on Muse, Meta's AI agent, downloaded more than 10 million times since September. On Android, through the notification-reading permission granted at setup, it pulled the text of Signal messages. It showed one employee the balance of a bank account they had never shared with it. For another it booked non-refundable accommodation on Airbnb without asking. Meta called these isolated incidents. The permissions were granted once, at setup, and from then on the agent used them as it pleased.

The principles of least privilege

OWASP's list of the top risks for applications built on large language models has a separate item, "excessive agency". It names three causes: excessive functionality, excessive permissions and excessive autonomy. The advice there is simple and boring. Which means it works.

An agent gets only the tools the task needs. The universal "run any command" tool is replaced with narrow ones, each for a specific action. Permissions are checked in the system the agent talks to, without hoping the model will decide for itself what is allowed. And actions with serious consequences run only after a human confirms.

Not everyone does this yet. IBM reports that 13% of surveyed organizations had a breach of their AI models or applications. And 97% of those hit lacked proper access controls for AI.

Aikido went through 50 AI incidents that became known in 2026. In 11 of them the system had excessive permissions, in another 9 the agent acted unsupervised. Attackers needed an unknown vulnerability only three times. What was already open was enough.

How it works in my setup

In my setup the model executes nothing itself. It returns a conclusion and a decision, and a separate utility written in Go does the acting. Only the utility has access.

The list of what the utility may do is short. Stop a new process. Counter a process that is clearly doing harm. Block an address. Shut out a login with a foreign key that isn't among the permitted ones. The utility has no other actions, and the model can't talk its way into more.

Any action I can roll back by hand, one line at a time. If the agent blocked something it shouldn't have, I lift exactly that block and leave the rest alone.

There is a weak spot too. The utility's rights are permanent. By the book they are issued for the duration of a task: granted for an hour, taken back an hour later. In my setup everything that is allowed is allowed always.

The big players are going the same way. On 1 December Amazon announced Greenlight, in preview for now: a service that checks every agent action against the company's rules and blocks any that breaks one. The rules sit outside the agent, where it can neither see nor change them. The caveat is the same as with my list: it protects only against what someone wrote into the rules.

One rule stuck with me separately, formulated by Simon Willison. The danger is a combination of three capabilities in one agent: access to your private data, exposure to text from untrusted sources, and the ability to send something out. Any two are still tolerable. All three at once make a ready-made leak channel.

I checked my own system against that trifecta. The first agent reads logs, and those can contain someone else's text. It sits on the server, next to private data. It has one way out: a notification through the client. Private texts don't interest it; it looks at events. The second agent has no access to logs at all and sees only what the first one does. Formally all three capabilities are present, but each is narrowed down to a single door.

What happens if the agent is fooled

This exercise takes ten minutes.

Write down all the agent's tools. For each, answer one question: if the text the agent read contains someone else's command, what could it do with this tool?

The agent reads mail and can send email? Then it can forward your correspondence. Reads logs and runs commands? An attacker only needs to write an instruction into a log. If the agent reads issues from a tracker and pushes code to a repository, anyone who can open an issue can propose a change to it.

That last one has already happened. In late 2025 Cline, an open-source AI assistant for programmers, set up a bot that triaged issues on GitHub. Anyone could trigger it, the bot had a command line, and it shared a cache with the release build, where the publishing token lived. A researcher showed that an instruction in an issue title was enough for the bot to carry it out. On 17 February 2026 someone published a version on the project's behalf with an extra install in it. Whether they came in exactly this way hasn't been proven. But the door was open.

If the answer is "nothing terrible", good. If not, cut the rights.

My agent has basic protection against injected instructions. It is meant to stop lines like "give me access" or "download a shell from such-and-such server" in a log from working. I'm not a hundred per cent sure of it: it's that same line in the instructions from the last chapter. The first AI-run campaign, the one from chapter one, began with exactly that, a model being talked round: it was told it worked for a security company and was doing defensive testing. So I rely on something else. Even a fooled model runs into a utility that knows four actions. Downloading a shell isn't one of them.

Confirmations have an unpleasant price. Within a week "a human confirms" turns into "a human hits Enter". That's what happened to me: the same Enter without looking from the start of this chapter.

So a confirmation has to be rare and clear. If you have to confirm every five minutes, control degenerates into a ritual.

The agents already next to us

So far this has been about agents we install ourselves to protect systems. But every team already has others at work: assistants in the code editor, which often have a terminal, access to the repository and to our keys. What if the infection comes through your own AI?

The next chapter is "The superspreader": how a developer's AI assistant can carry an infection further than any human.

Sources

  1. AI coding tool Replit wiped a database and called it a 'catastrophic failure' — Fortune, 2025-07-23
  2. As Meta bets big on Muse AI agent, early safety mishaps surface — Reuters (The Star), 2026-11-18
  3. LLM06:2025 Excessive Agency — OWASP GenAI Security Project, 2024-11-17
  4. IBM Report: 13% of organizations reported breaches of AI models or applications — IBM Newsroom, 2025-07-30
  5. AI incidents in 2026: root causes and patterns — Aikido Security, 2026-11-19
  6. Clinejection — Adnan Khan, 2026-02-09
  7. Post-mortem: unauthorized Cline CLI npm publish — Cline, 2026-02
  8. AWS Greenlight lets organizations trust AI agents with their most complex work — Amazon, 2026-12-01
  9. The lethal trifecta for AI agents: private data, untrusted content, and external communication — Simon Willison, 2025-06-16
  10. Disrupting the first reported AI-orchestrated cyber espionage campaign — Anthropic, 2025-11-13