LogicTrail
  • Trails
  • Check my app
  • Pricing
  • Sign in
  1. Trails
  2. /
  3. Working with your AI agent
  4. · 4 minutes · Free

Approve this command?

Your wants to clean up old build files before a fresh build. It asks you to approve one command.

This answers: Which AI agent commands should I always check? No coding needed. 3 quick decisions.

  • Supervising your AI
  • Keeping data safe

Step 1 of 3

The agent asks to run this. CACHE_DIR was set in an earlier, separate command. What will it delete?

rm -rf "$HOME/$CACHE_DIR"
Choose an answer

Pick one. You will see what really happens, and why.

Which AI agent commands should I always check?

Always read commands that delete, move, reset or before approving them. Shell variables are replaced before a command runs, so an empty variable can turn rm -rf "$HOME/$CACHE_DIR" into deleting your whole home folder. Auto-approve only harmless commands, and run agents in a contained folder.

Trail of the bug
  1. AI agent
  2. Your laptop

Breaks at Your laptop: Empty variable, whole home folder

Why AI tools write this bug

Agents run many commands in separate shells, so a variable set in one command may be empty in the next, and auto-approve modes skip the human who would have noticed.

How to fix it

  1. Never auto-approve deletes, resets, force pushes or deploys.
  2. Quote variables and check they are set before destructive commands.
  3. Run agents inside the project folder or a container.
  4. Commit your work before letting an agent run cleanup.

Check your own app

Paste this into Lovable, Cursor or Claude Code:

Before we continue: list every shell command you have permission to run without asking me, and every command in this project's scripts that deletes files, resets a database, rewrites git history or deploys. Suggest which ones should always require my approval. Do not run anything.

Common questions

Is auto-approve mode safe?
Only for commands that cannot destroy anything, such as reading files or running tests. Keep a human on anything irreversible.

Related scenarios

  • The agent that reset productionFree · 5 min
  • Force-pushed awayPro · 4 min
  • The commit that broke checkoutPro · 5 min

More on this trail

Working with your AI agent: Dangerous commands, fix loops, deleted tests, prompt injection and invented packages.

Want someone to look?

We check AI-built apps for this and three other common leaks, in plain English.

Check my app
Sign in