โ† AI Coding Agents (Claude Code & Codex) learning path
AI Coding Agents (Claude Code & Codex) ยท Module 8 of 10

Safety and permissions

Control what an agent may do on your machine.

๐Ÿ“– Key ideas

  1. Agents ask permission before running commands or editing files, depending on settings.
  2. Allow safe, read-only commands; keep risky ones (deploy, delete, push) behind approval.
  3. Never paste secrets into prompts; use environment variables.
  4. Watch for prompt injection in files or web pages the agent reads.
  5. Use sandboxes, containers or cloud environments for untrusted code.
๐Ÿ’ก Real-life example: Like giving a house-sitter keys: they can enter rooms you allow, but the locker stays locked.
Permission modeSetting for what the agent can do without asking
AllowlistCommands approved to run automatically
SandboxIsolated environment for running code
Prompt injectionHidden instructions in content the agent reads