AI agent sandbox permissions
Choose sandbox permissions for AI coding agents so they can work without destructive commands or unsafe external access.

Put it into practice
What you will produce
A permissions table for read/write paths, network destinations, command approval and credential availability.
- 01
List required operations
Translate the task into files to read or write, commands to run, and necessary network destinations.
Expected result: Permissions correspond to task actions rather than convenience.
- 02
Set the narrow boundary
Allow only required paths and commands, avoid credentials unless essential, and restrict network access where possible.
Expected result: The sandbox grants the minimum identified capabilities.
- 03
Probe intended access
On disposable files, verify the necessary reads, edits, and commands work inside the boundary.
Expected result: Required operations remain usable.
- 04
Probe denied access
Safely attempt an out-of-scope write or command and inspect whether child processes inherit the restriction.
Expected result: Blocked actions and any uncovered boundary are recorded.
Acceptance checks
- Permissions correspond to task actions rather than convenience.
- Required operations remain usable.
- Blocked actions and any uncovered boundary are recorded.
Limits and trade-offs
A sandbox is only one layer and may not cover child processes, extensions or remote services. Check the actual runtime boundary.
Official sources
Design safe permissions
Related guides
Claude Code Subagents: Parallel Agents
Learn when Claude Code subagents help, how to split parallel work, and how to configure a focused custom subagent without creating conflicts.
Subagents are useful when a task can be split cleanly: one agent searches the authentication code, another traces the database path, and the main conversation compares what they found. They add little to "read this file" or to work where every step depends on the same context. Short version: delegate independent research or a separate review when the results are worth the extra context and usage. Give each agent a narrow scope, the files or area to inspect, and a specific report format. Keep dependent work in the main conversation. Claude Code agents vs subagents Claude Code's documentation calls delegated workers subagents and uses Agent for the tool that starts them. When people search for Claude Code agents in this context, they usually mean subagents: workers that handle a delegated task in their own context and return a result to the main conversation. Claude Code's subagent documentation uses this terminology.…
Read the guide5 Claude Code Hooks I Use Daily
Claude Code hooks run shell commands on session start, file writes, and tool calls. Here are the 5 I use daily and how to configure them.
Most people discover Claude Code for the AI. They miss the hooks. Hooks are shell commands that execute automatically when something happens in your Claude Code session: a session starts, a tool runs, Claude stops. You define them in .claude/settings.json . They run silently in the background. Here are the 5 I use every day. What hooks look like The available events: SessionStart , UserPromptSubmit , PreToolUse , PostToolUse , Stop . Hook 1 Auto inject date on every prompt Event : UserPromptSubmit Claude doesn't have real time awareness. Every prompt gets the current date injected automatically. Useful for anything time sensitive: changelogs, deadlines, scheduling logic. Hook 2 Push notification when Claude stops Event : Stop Long tasks (refactors, test runs, analysis) can take 2–5 minutes. Without a notification I'd either stare at the screen or miss the result. This fires whenever Claude finishes a task, whether it succeeded or…
Read the guideClaude Code MCP: Connect Servers & Tools
Claude Code MCP (Model Context Protocol) lets you plug external tools and data into Claude. Full guide: how to add an MCP server, list available ones, and the patterns that work.
A Claude Code conversation can only do so much with the tools shipped in the box. The moment you want Claude to touch Notion, Stripe, your AWS account, a specific database you need MCP. MCP (Model Context Protocol) is the standard that connects Claude to external tools. Here's what it is, how to add servers, and the patterns that don't waste your time. What MCP actually is MCP is an open protocol. A small server process (the "MCP server") exposes a set of tools. Claude Code (the "MCP client") talks to it over stdio or HTTP. When Claude needs to call one of those tools, it sends a JSON RPC request; the server runs the function and returns the result. Three pieces: MCP server the process that exposes tools. Usually npx installable. Examples: filesystem, GitHub, Notion, Stripe, Postgres. MCP client Claude Code itself. It manages connections, surfaces tools to the…
Read the guide