Guide · Claude

What is the Claude Agent SDK, and when should a business use it?

What the Claude Agent SDK is, how it differs from the Claude API, Claude Code and Managed Agents, when a business should use it, what it really costs to run, and how to secure, monitor and pilot an agent built on it.

Author
Chris Gooding
Published
November 24, 2026
Topic
Claude
On this page (14)

The Claude Agent SDK is a Python and TypeScript library that puts the agent behind Claude Code inside your own software: the same agent loop, built-in tools, permissions, sessions and hooks, running in a process you operate. A business should use it when a task needs an agent that plans its own steps and works with files, commands and connected systems, and when your team is ready to host, secure and own that agent like any other production service. For simple question-and-answer features, a plain API call is cheaper and easier. This guide covers what the SDK is, when it fits, what it costs to run, and how to keep it safe and accountable.

What is the Claude Agent SDK, and how is it different from the API, Claude Code and Managed Agents?

An agent is software that completes a task by planning its own steps and calling tools, such as reading a file, running a command or querying a system. Claude, powered by Anthropic, is the model that does the planning. The Agent SDK packages the harness that Claude Code uses (the loop that sends work to the model, runs the tools it asks for and manages context) as a library your developers call from their own code. Teams still on the older Claude Code SDK packages can move to it with Anthropic's migration guide.

Four ways to build with Claude, per Anthropic's Agent SDK overview (November 2026)
OptionWho runs the agentBest for
Agent SDKYou, in a process you operateEmbedding Claude Code's agent, tools and permissions in your own Python or TypeScript application
Claude Code CLIA person at a terminalInteractive development and one-off tasks
Client SDK (Claude API)You, and you write the tool loopDirect API calls with full control of each request
Managed AgentsAnthropic hosts the loopAgents run through the API, with tools in an Anthropic-managed sandbox or a self-hosted one

The SDK runs on Python 3.10 or later or Node.js 18.14 or later, and both versions bundle the Claude Code binary for most installs. Other languages can drive the same loop by running the Claude Code command line tool as a subprocess. Built in, you get tools to read, write and edit files, run commands and search the web, plus subagents for focused subtasks, connections to outside tools and data through MCP (the Model Context Protocol, an open standard for plugging tools into AI models), resumable sessions, and skills and plugins. Our guide to the Claude API, Agent SDK and Managed Agents walks through the route decision in more depth.

When does the SDK beat a plain API integration, and when should we keep it simple?

Use the SDK when the work is open-ended: the agent has to look at material, decide what to do next, use several tools and check its own result. Good fits include investigating and fixing code, extracting data from batches of documents, triaging a queue of requests against your own records, and research that gathers and summarizes sources. Anthropic's hosting guide lists invoice and receipt extraction, document translation, email triage and support agents that load ticket history among its example workloads.

Keep it simpler in these cases:

  • The task is one request and one answer, such as summarizing a call or drafting a reply. A Claude API call is enough.
  • The steps are fixed and known in advance. Ordinary automation runs them more cheaply and predictably, with Claude called only for the step that needs judgment.
  • You do not want to run infrastructure. Managed Agents hosts the loop for you, and Claude's own apps may already cover the job.
  • The work lives inside Salesforce. Agentforce or a Claude integration with Salesforce may fit better than a separate service.

A fair way to decide is a small benchmark: pick 20 to 50 real tasks, run them through the simplest option that could work and through an SDK agent, and compare completion rate, error rate, cost per completed task and the human review time each one needs.

What does it really cost to run an agent built on the SDK?

Use of the SDK is governed by Anthropic's Commercial Terms of Service, and the model usage it generates is billed through your Anthropic API account or your cloud provider. Model tokens are the main cost, typically an order of magnitude or more above container cost. As of November 2026, Anthropic's hosting guide puts a minimally provisioned container at roughly $0.05 an hour, while a single long agent session can spend dollars in tokens.

Costs that catch teams out:

  • Every step resends context, so long tasks cost far more than single requests. Subagents add their own usage on top.
  • Failed and retried runs still spend tokens up to the point they stopped.
  • Prompt caching is on automatically and lowers the cost of repeated context; how well it works depends on how your sessions are spaced.
  • Engineering time to host, secure, monitor and maintain the agent, which is usually larger than the infrastructure bill.

The SDK reports an estimated cost for each run and lets you cap a run with a spending budget and a maximum number of turns. Anthropic labels those cost figures as client-side estimates, so use them for budgeting and alerts, and reconcile against your actual invoice. Measure cost per completed business task, including failures, because that is the number that decides whether the agent pays for itself.

How do we keep an agent inside safe security boundaries?

Plan as if the agent can be talked into doing the wrong thing. Agents act on what they read, so a file, web page or email can carry instructions the agent might follow. This is called prompt injection. Anthropic's secure deployment guide recommends layered controls for that risk.

  • Permissions: decide which tools run automatically, which need approval and which are blocked. The SDK checks hooks, deny rules, ask rules, the permission mode, allow rules and then your approval callback, in that order, and a deny rule holds in every mode.
  • Avoid the bypass mode in production. Anthropic warns that it gives the agent full system access, and a list of allowed tools does not limit it.
  • Keep secrets out of the agent. The recommended pattern is a proxy outside the agent's environment that adds API keys to outgoing requests, so the agent never sees them.
  • Isolate the runtime. Run each agent in a sandbox, container or virtual machine with only the folders it needs, read-only where possible, and outbound traffic limited to approved domains.
  • Review every connected tool. Within the domains you allow, an agent can send data anywhere those services accept it.

Our guide to whether MCP is safe covers how to vet the tools and data sources you connect.

How do we carry user identity and keep sessions apart?

The agent acts with whatever credentials its tools hold, so identity has to be designed in. Put authentication at a gateway in front of the agent and pass only pre-authenticated requests through. For actions in other systems, have each tool call run as the requesting user, or check that user's rights before it acts, so the agent cannot do more than the person who asked.

For several customers or business units on shared infrastructure, Anthropic's hosting guide lists the controls to apply together: skip loading shared settings files, turn off automatic memory, give each tenant its own configuration directory and working directory, and set separate outbound rules per tenant. By default the SDK reads settings and memory files from the file system, which can leak one tenant's context into another's session if you do not change it. Revoking access mid-run is your system's job: a session has no built-in timeout, so cap turns and make your tools check permissions on every call.

What happens to our data, and what do the terms allow?

Prompts, files and tool results the agent reads are sent to the model for processing under your Anthropic or cloud provider agreement. The SDK can authenticate with an Anthropic API key or through Amazon Bedrock, Claude Platform on AWS, Google Cloud's Agent Platform or Microsoft Foundry, which lets you keep model traffic under a cloud contract you already have. Retention and training rules depend on that agreement; our guide to whether Claude trains on your data covers them.

Two rules matter for products you build. Use of the SDK, including in products offered to your own customers, falls under Anthropic's Commercial Terms of Service. And unless Anthropic has approved it, third-party products built on the SDK may not offer claude.ai login or subscription limits, so plan on API key authentication.

What happens when an agent crashes halfway through a task?

Each session runs as its own subprocess that keeps its transcript, memory files and working files on local disk. None of that survives a container restart unless you store it elsewhere. The SDK provides a session store option that mirrors transcripts to durable storage so a session can resume on another worker; memory files and working files need their own storage.

The SDK can rewind file changes with checkpointing, but actions in other systems, such as a sent email or an updated record, are yours to make safe. Design those tools so a repeated call does no harm, record what each call changed, and put a human approval step in front of anything that cannot be undone.

How many agents can run at once, and how do we test load?

Each session is a separate process, so concurrency is limited by memory. Anthropic suggests starting at 1 GiB of RAM, 5 GiB of disk and 1 CPU per agent, and notes that memory grows with session length, so measure peak use on a realistic session before sizing hosts. Large bursts of parallel subagents can hit rate limits, so break wide jobs into batches.

If 500 employees might start agents at the same time, you also need rate limits and a queue in front of the service. Load test with a small set of short, representative tasks and a hard budget cap, then scale the numbers up on paper before paying for a full-volume test.

How do we know the agent actually finished the job correctly?

Define done in business terms before you build: the invoice fields match the source, the ticket is routed to the right queue, the tests pass. Then check it in code where you can. The SDK can return structured output, which makes automatic checks easier, and a result message tells you whether the run succeeded or stopped on a limit.

Keep a fixed set of test tasks with known correct answers and rerun it whenever you change prompts, skills, tools or the SDK version. Plausible but wrong answers are the real risk, so sample finished work for human review, and track the review findings as a quality rate over time.

Can we audit what the agent did after an incident?

Yes, if you turn it on before you need it. The SDK exports OpenTelemetry traces, metrics and log events to your own monitoring tools: spans for each model request and tool call, with subagent activity nested under the parent, plus events for tool decisions and permission mode changes. Telemetry is off until you enable it, and tracing is in beta.

By default the exports record structure, such as tool names, durations and token counts, and leave out prompt text and tool content. Anthropic provides opt-in settings to include them; turn those on only where your monitoring system is approved to store that data. Tag each run with the end user and tenant so an incident review can show who asked for what.

Who owns the agent after launch, and how do we upgrade safely?

Treat it as a production service with a named owner, an on-call path and a change process. The bundled binary is pinned to the SDK version, and the SDK follows semantic versioning, so Anthropic's guidance is to take patch releases continuously and read the changelog before taking a minor release. Run your test task set before every upgrade.

Watch what the SDK loads by default. It reads skills, commands and memory from project and user .claude folders, the same as Claude Code, so a production agent can pick up files nobody meant it to use. Set the settings sources explicitly and keep the agent's configuration in version control.

How do we run a pilot that proves value, and how portable is the work if we stop?

Pick one task that is frequent, measurable and low risk if it goes wrong, with a person reviewing every output at first. Run it for four to eight weeks against a baseline of how the work is done today, and track time saved, time spent supervising, error rate and cost per completed task. Agree in advance what result at 30, 60 and 90 days means expand, adjust or stop.

Much of the work carries over if you change direction. Tools exposed through MCP, test task sets, prompts and skills are plain files and standard interfaces. The parts tied to the SDK are the agent loop and its configuration, so keep your business logic in your own tools and services where possible.

Who can help us build on the Claude Agent SDK?

Abstrakt Cloud Solutions is Certified in the Claude Partner Network. Our team holds 12 Claude certifications and has worked on 30 Agentforce, Data 360 (formerly Data Cloud) and Claude projects, plus nearly 900 Salesforce projects. We help teams pick the right build route, design permissions, isolation and monitoring, build the first agent and its test set, and connect it to Salesforce and other systems when the work needs it. Project work runs $185 to $225 an hour with a $3,500 minimum. Our Claude and Salesforce payments case study shows one example.

What is the next step?

Tell us about the task you want an agent to handle through our contact form, and we will help you decide whether the Agent SDK, a plain API integration, Managed Agents or an existing product fits, and what a safe first pilot looks like.

Questions people also ask

What is the Claude Agent SDK?

It is a Python and TypeScript library that gives your own application the agent loop, built-in tools, permissions, sessions and hooks that power Claude Code. You run it in a process you operate, and it calls Claude to plan and carry out tasks.

How does the Claude Agent SDK relate to the Claude Code SDK?

The Agent SDK packages replace the older Claude Code SDK packages. Anthropic publishes a migration guide for teams moving from the old packages to the Agent SDK.

What is the difference between the Agent SDK and Managed Agents?

With the Agent SDK you host and run the agent loop yourself. With Managed Agents, Anthropic hosts the loop and you drive it through the API, with tools running in an Anthropic-managed sandbox or a self-hosted one.

How much does the Claude Agent SDK cost?

You pay for the model usage your agent generates, through your Anthropic API account or cloud provider, plus your own hosting. Token usage is usually the largest cost, and the SDK reports estimated cost per run and supports spending caps.

Which languages does the Agent SDK support?

Python 3.10 or later and TypeScript on Node.js 18.14 or later. Other languages can run the Claude Code command line tool as a subprocess to drive the same agent loop.

Can we run the Agent SDK through AWS, Google Cloud or Microsoft?

Yes. As of November 2026 it can authenticate through Amazon Bedrock, Claude Platform on AWS, Google Cloud's Agent Platform and Microsoft Foundry, as well as with an Anthropic API key.

Is it safe to give an agent access to company systems?

It can be, with layered controls: strict tool permissions, no bypass mode in production, secrets held by a proxy outside the agent, an isolated runtime with limited network access, and human approval for actions that cannot be undone.

Chris Gooding, President & CEO of Abstrakt Solutions
Chris Gooding
President & CEO, Abstrakt Solutions
LinkedIn →
Tech Talk · monthly newsletter

Valuable insights on technology, CRM and AI, once a month.

Written by the consultants who do the work. One email a month, and you can unsubscribe anytime.

We never share your email. See past issues →

Call (314) 916-4095 Book a consultation
Call (314) 916-4095 Book a call