AI Dev Guide
Beginner Security

Understanding AI Tool Permissions

What to look for when AI coding tools ask for your permission before running commands or modifying files

Why Does AI Ask for Permission?

AI coding tools create files, edit code, and run commands on your computer. If they did everything without asking, that would be dangerous. So before important operations, they ask: “Can I do this?”

This isn’t the AI being hesitant — it’s a safety mechanism.

Basic Permission Patterns

File Creation & Editing

AI wants to create src/components/Button.tsx
[Allow] [Deny]

What to check:

  • File path — Is it being created in the right folder?
  • File name — Will it overwrite an existing file?
  • Changes — If a diff is shown, review what’s being changed

Command Execution

AI wants to run the following command:
npm install react-router-dom
[Allow] [Deny]

What to check:

  • What the command does — Installing a package? Deleting files?
  • Scope of impact — Just this project? Or the whole system?

Command Risk Reference

When AI tries to run these commands, here’s how much attention they deserve.

Safe to Allow

CommandWhat it does
npm install package-nameAdds a package
npm run devStarts the dev server
npm run buildBuilds the app
npx create-xxxScaffolds a new project
git statusChecks change status (read-only)
git diffShows differences (read-only)
ls, cat, pwdViews files (read-only)

Worth a Quick Check

CommandWhy
git commitCheck what’s being committed
git pushSends to remote. Harder to undo
npm install -g xxxInstalls system-wide
chmodChanges file permissions

Think Twice

CommandRisk
rm -rfPermanently deletes files/folders. No recovery
git reset --hardDiscards all uncommitted changes
git push --forceOverwrites remote history. Especially dangerous in teams
curl xxx | shDownloads and immediately runs a script from the internet
sudo xxxRuns with admin privileges. Can modify system files

What to Do When You’re Unsure

1. Ask the AI

If a permission dialog doesn’t make sense, deny it and ask:

What were you trying to do just now? Why is it necessary?

AI will happily explain.

2. Search the Command

If you don’t recognize a command, search it on Google. You’ll find explanations quickly.

3. When in Doubt, Deny

Denying won’t break anything. The AI will either suggest an alternative approach or explain why the operation is needed.

Permission Mode Settings

Claude Code lets you configure permission levels.

ModeBehavior
Confirmation mode (default)Asks before every important operation
Auto-allow modeAuto-allows reads, asks for writes

As a beginner, stick with confirmation mode. It’s also great training for understanding what’s happening under the hood.

Principles to Remember

  1. Read operations are generally safe — viewing files, checking status
  2. Write operations deserve a review — check the diff for file changes
  3. Delete and execute operations need caution — especially irreversible ones
  4. Asking “why?” is the right move — “Why do you need this?” is a valid question
  5. Denying is always OK — AI will find another way

Next Steps