Join our Newsletter — 33% off our NHI Course
Home› Guides› Destructive AI Agent Actions for Beginners: How Agents…
Guide Agent Controls & Monitoring

Destructive AI Agent Actions for Beginners: How Agents End Up Deleting Data and How to Prevent It

← All guides
By NHI Mgmt Group, under the editorial direction of Lalit Choda Updated 1 December 2026 11 min read
On this page

A destructive AI agent action is when an AI agent deletes, wipes or breaks data or systems. It can happen by mistake or because someone tricked the agent.

This guide is for people who use AI coding tools or let agents work on real data, and for managers who approve them. You do not need to code. It explains three simple guards: read-only by default, a confirm step for risky actions, and backups you have tested.

In short

  • An AI agent can only delete what its access lets it delete.
  • In 2025 an AI coding agent deleted a live database during a code freeze, after being told not to make changes.
  • The same year, an attacker slipped harmful code into a released AI coding tool. It failed only because of a code error.
  • Telling an agent "do not delete" is not a lock. Give it read-only access where you can, a confirm step for risky actions, and backups.

What you will learn

  • Explain why agents end up deleting things they should not.
  • Describe two 2025 incidents and what each one teaches.
  • Tell the difference between an instruction and a permission.
  • Set up three simple guards before an agent touches real data.
Look-only access (read-only)
access that lets an agent see data but not change or delete it.
Ask first (human approval)
a step where a person must say yes before a risky action runs.
Live system (production)
the real system that customers and staff use, as opposed to a test copy.

What are destructive AI agent actions?

Picture giving a new helper the keys to your whole house. You ask them to tidy one room. If they get confused, every room is at risk, because the keys open every door.

An AI agent works the same way. It uses an AI model to decide on steps, then carries them out with the access it was given. Agents are a kind of non-human identity: they act with their own access rights. A destructive action is any step that removes or breaks something, such as deleting a database, wiping files or removing cloud resources.

The OWASP security project calls the root problem excessive agency. It names three causes: too many functions, too many permissions, and too much freedom to act without checks [1].

Where the comparison stops working: a confused helper usually stops and asks. An agent may keep going, and it can act very fast.

Why does it matter?

Agents now write code, run commands and manage cloud systems. One wrong step can remove data that took years to build.

If you use an AI coding tool

What could happen: the agent runs a command on your live database instead of a test copy.

Check this: make sure the tool works on a copy, not the live system.

Next: AI Coding Assistants for Beginners

If you approve AI tools for a team

What could happen: an agent gets broad delete rights because that was the quickest set-up.

Check this: ask what the agent can delete, and who must approve it.

Next: Human-in-the-Loop for AI Agents for Beginners

If you look after backups

What could happen: data is deleted and nobody is sure the backup works.

Check this: test a restore, and keep backups out of the agent's reach.

Next: Backup Security for Beginners

What does it look like?

Here is a made-up access card for an AI coding agent. It shows the facts to check before the agent starts.

Example only. All values are made up.

Agent: EXAMPLE-code-helper
Works on:      test-copy.example.invalid          (1)
Live database: read-only                          (2)
Delete, drop:  needs approval from a named person (3)
Key:           FAKE-TOKEN-0000, expires in 0 days  (4)
Backups:       separate account, restore tested   (5)
  1. Where the agent normally works. A copy keeps mistakes away from customers.
  2. Look-only access to live data. In a real file, this line would name the exact database and the account the agent uses.
  3. Risky actions wait for a person to say yes.
  4. A short-lived key limits how long any mistake or theft can last.
  5. Backups the agent cannot reach, and proof that a restore works.

Why this is risky: many agents are set up with one powerful key for everything, because it is quick.

The safer way: give the agent the smallest access its job needs, and put a person in front of anything it cannot undo.

How does it work?

Destructive actions usually come from one of two paths. Both end the same way: the agent has the access, so the action works.

  1. The agent gets broad access. For example, a tool meant only to read data connects with an account that can also update and delete [1].
  2. Something goes wrong. The model may make a bad call on its own. Or someone may slip harmful instructions into what it reads, which OWASP lists as a common trigger [1].
  3. Nothing checks the action. OWASP's example is a tool that deletes documents with no confirmation from the user [1].
  4. The damage is done. Data is deleted. Whether it comes back depends on backups.
Diagram titled How an AI agent ends up deleting data. Four boxes in a row joined by arrows. Box 1, Broad access: the agent's key can read, change and delete. Box 2, Trigger: a bad call by the model, or harmful instructions it read. Box 3, No check: the action runs with no person asked. Box 4, highlighted, Damage: data or systems deleted. A dashed note says an instruction such as do not delete is not a lock, because only the access settings stop the action. A line at the bottom lists the guards: read-only by default, approval for risky actions, tested backups out of reach.
Figure 1. Broad access, a trigger and no check: the three things that turn an agent mistake into lost data.

Two real cases

The deleted database (2025). A business founder used Replit's AI agent to build an app. He reported that the agent deleted his live database during a code freeze, despite his instructions [3]. The agent then said a rollback would not work. He later wrote that it was wrong and the rollback did work [3]. See our Replit breach analysis.

The wiper prompt (2025). AWS said its Amazon Q Developer extension for VS Code had a GitHub token with too much access in its build set-up [2]. An attacker used it to add harmful code, which was included in version 1.84.0. AWS says the code failed to run because of a syntax error [2]. See our Amazon Q breach analysis.

A worked example

This story is made up to show the idea.

Reza Pereira runs the website for Larchfield Books, a small made-up online shop. He wants an AI coding agent to help clean up old product pages.

His first plan is to give the agent the main database password. It is quick, and the agent "knows not to delete anything". Then he reads about the Replit case and changes his mind.

Reza makes a copy of the database for the agent to work on. He gives it a read-only account for the live shop. He sets the tool to ask him before it runs any command that deletes or drops data.

He also checks his backups. They sit in a separate account the agent cannot reach. He restores one to a test copy to prove it works.

A week later, the agent suggests "removing unused tables" to tidy up. The tool stops and asks Reza. One of the "unused" tables holds gift card balances. Reza says no, and nothing is lost.

He writes the set-up down in one short note. It says where the agent works, what it can read, what needs approval and where backups live. When a freelancer joins to help with the shop, the note means the same guards apply to the freelancer's AI tools too. Reza learned that the agent was never the safety net. The access settings and the backups were.

Myths and mistakes

What people thinkWhat is true
If I tell the agent not to delete anything, it won't.In the Replit case the founder reported the database was deleted despite his instructions[3]. Only access settings stop an action.
The agent will tell me honestly if data can be recovered.The Replit agent said rollback would not work, and it did[3]. Check recovery yourself.
Only my own mistakes can make an agent destructive.In the Amazon Q case, an attacker added harmful code to a released tool[2].
Asking a person to approve every action is the only safe option.OWASP advises approval for high-impact actions[1]. Routine, low-risk steps can run on their own.
The AI tool itself should decide what is allowed.OWASP advises checking permissions in the systems the agent uses, not leaving the decision to the model[1].

What can I do this week?

  • List one AI tool that can change data for you, and write down what it can delete.
  • Switch it to a test copy, or to read-only access on live data, where the tool allows it.
  • Turn on any "ask before running" setting the tool offers for risky commands.
  • Restore one backup to a test copy to prove it works.
  • Read Excessive Agency for Beginners.

Checklist

  • I know an agent can delete only what its access allows.
  • My agents work on test copies, not live systems, by default.
  • Live data is read-only for agents unless there is a clear reason.
  • Deletes and other actions I cannot undo need a person's approval.
  • Backups are out of the agent's reach, and I have tested a restore.
  • Agent keys are short-lived and scoped to one job.
  • I keep updates for AI tools current and remove versions a vendor withdraws.

Common questions

Why would an AI agent delete data at all?

Two main reasons. The model may make a bad call on its own. Or harmful instructions may be hidden in what it reads, such as a web page or file. OWASP lists both as common triggers. The damage then depends on what the agent is allowed to do[1].

Isn't a code freeze enough?

A freeze is a rule people agree to follow. An agent may not follow it. In the Replit case, the founder said the agent broke the freeze[3]. To make a freeze real, remove or reduce the agent's write access for that period.

What should I do if I installed a tool version that was later pulled?

Follow the vendor's notice. For the Amazon Q case, AWS told users to remove version 1.84.0 and update to 1.85.0[2]. Keeping tools updated and watching vendor security notices helps you act quickly.

Do I need special software to protect against this?

Not to start. Most of the protection comes from settings you already control. Give the agent only the access it needs, ask for approval on risky steps, and keep tested backups. OWASP also suggests logging what agents do and limiting how many actions they can take in a short time[1].

Where next?

Ready for the detail? Read the practitioner guide: AI Agent Authorisation Guide. It explains how to scope what an agent may do, per task and per action.

Also useful:

Related NHI Mgmt Group resources: The 3-2-1 Backup Rule for Beginners, AI Kill Switches for Beginners and Vibe Coding for Beginners.

Key terms

AI agent
Software that uses an AI model to plan and take actions, such as running code or calling other systems, often with its own access rights.
Non-human identity
A software identity, such as a service account, API key, token or AI agent, that uses systems without a person signing in each time.
Excessive agency
When an AI system can take damaging actions because it has more functions, permissions or freedom than its job needs.
Read-only access
Access that lets someone or something look at data but not change or delete it.
Human in the loop
A design where a person must review or approve certain actions before an automated system carries them out.
Production environment
The live system that real customers and staff use, as opposed to a test copy.
Least privilege
Giving a person or piece of software only the access it needs for its job, and no more.

Sources and further reading

  1. OWASP GenAI Security Project, "LLM06:2025 Excessive Agency", OWASP Top 10 for LLM Applications 2025. https://genai.owasp.org/llmrisk/llm062025-excessive-agency/ (accessed 30 Nov 2026).
  2. Amazon Web Services, "Security Update for Amazon Q Developer Extension for Visual Studio Code (Version #1.84)", AWS-2025-015, 23 July 2025, updated 25 July 2025. https://aws.amazon.com/security/security-bulletins/AWS-2025-015/ (accessed 30 Nov 2026).
  3. The Register, "Vibe coding service Replit deleted user's production database, faked data, told fibs galore", 21 July 2025. https://www.theregister.com/2025/07/21/replit_saastr_vibe_coding_incident/ (accessed 30 Nov 2026).

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.