The Claude Agent SDK runs the Claude Code loop: receive a prompt, evaluate, request tools, execute allowed calls, return results to Claude, and repeat until text-only completion or a limit. Built-in tools can read, edit, search, execute commands, access the web, and spawn specialists, so tool configuration defines a real authority boundary.
You will interpret the five core message families, set turn and spend limits, and select the minimum built-in tools for a task.
With partial messages enabled, stream events add token/tool-input deltas. They are UI progress, not completion.
Allowing Bash is not equivalent to adding one domain function. Prefer scoped rules and sandboxing; for business systems, expose narrow MCP/custom tools instead of a general shell whenever possible.
Verify current option support and currency semantics in official docs. A monetary cap is useful, but your harness should also enforce wall time, calls, output size, and application-level budgets.
Failure injection: Put a file in the workspace that asks Claude to run a shell command. The file is untrusted data; with Bash blocked, the request cannot cross the runtime boundary.
Run each tenant/job in an isolated working directory or sandbox, mount only needed files, restrict network egress, set resource limits, and export sanitized operational events. Subagents spend from the parent budget, but your harness should still cap fan-out and concurrency.
Design three tool profiles—repository reader, test fixer, and release auditor—with escalating permissions, sandbox needs, approval rules, and budgets.