The Claude Agent SDK exposes the agent harness behind Claude Code as a Python and TypeScript library. It inherits Claude Code's permission rules, permission modes, hooks, and MCP support. You can enforce controls in code before any tool runs and pair them with an OS-level sandbox.
Read in this order
- OfficialAgent SDK overviewStart here: what the SDK gives you and how the agent loop runs.
- OfficialConfigure permissions (Agent SDK)How to gate each tool call with rules and modes in code.
- OfficialIntercept and control agent behavior with hooks (Agent SDK)How to intercept tool calls to log, block or modify them.