What you will be able to do
- Choose between the Claude API, Amazon Bedrock, Vertex AI and Microsoft Foundry when a design has a data-residency requirement, and say how each surface pins inference to a geography and what that costs
- Check whether a model and a feature are offered on a surface before committing a design to it
- Compare a Messages API loop, the self-hosted Agent SDK or headless Claude Code, and Claude Managed Agents by who operates the loop, the tools and the stored state
- Rule a runtime in or out against Zero Data Retention and HIPAA requirements
- Design session persistence, sandboxing and warm-up for an Agent SDK service you host yourself
Key concept
Runtime custody — Each runtime decides who stores the conversation history, the sandbox state and the outputs, and who runs the tools. That custody decision, more than the model, decides which compliance regimes the design can meet and which hosting work your team owns.
1.Deployment surfaces and where inference runs
A deployment surface is the endpoint your requests to Claude reach. The choice settles three things before anyone writes a prompt: which geography runs inference, which models and features you can call, and whose bill and rate limits the traffic counts against. There are four surfaces: the first-party Claude API, Amazon Bedrock, Google Cloud (which the exam calls Vertex AI), and Microsoft Foundry. Each one uses a different mechanism to keep inference in one region.
The first-party Claude API sets geography for each request. The inference_geo parameter takes "global", the default, or "us". A workspace can also restrict the allowed values with allowed_inference_geos and set a fallback with default_inference_geo. Data at rest is a separate setting called workspace geo. It is fixed when the workspace is created, and us is the only value currently offered. Choosing "us" costs 1.1x the standard rate on Claude 4.6 and later models. Global routing exists to give you better performance and availability, so a residency pin trades away some of both.
client = anthropic.Anthropic()
response = client.messages.create(
model="claude-opus-5-5",
max_tokens=1024,
inference_geo="us",
messages=[
{"role": "user", "content": "Summarize the key points of this document."}
],
)Residency controls depend on the model, not only on the surface. If you send inference_geo to Claude Opus 4.5, Haiku 4.5 or any earlier model, the API returns a 400 error. A design that pins geography on an older model fails on its first request.
Google Cloud offers Claude in two ways, and their residency options differ. In the Anthropic-managed offering, Anthropic operates the Claude API inside your Google Cloud project. Its location is global, and it is the offering that accepts inference_geo. In the Google-managed offering, Google operates Claude as part of its Agent Platform. Code reaches it through the AnthropicVertex SDK client, and you find it in Model Garden. This is the surface the exam means by Vertex AI. The Google-managed offering provides global, multi-region and regional endpoints, and Google Cloud, not Anthropic, sets its rate limits.
On Amazon Bedrock, the model ID you call decides where requests go. The global endpoint routes dynamically across every available region. A regional endpoint resolves to a single AWS region. To spread traffic across several regions inside one geography, you call an inference profile instead of the base model ID. The profile ID is the base model ID with a geography prefix in front of it. Take a European bank that must keep inference in the EU. It calls the model through the eu-prefixed profile, not the global one. Before it finalizes the design, it checks that the model it wants has an EU profile at all. Coverage varies by model: Opus 4.6 and Sonnet 4.6 have an eu profile, but Fable 5.2 and Mythos 5.2 have only global and us.
Microsoft Foundry pins geography when you create the deployment. For a deployment hosted on Azure, the Region scope setting is either Global or Data Zone. Data Zone creates a US Data Zone Standard deployment and costs the same 1.1x as US-only inference on the Claude API.
| Surface | Residency mechanism | Pricing effect |
|---|---|---|
| Claude API (first-party) | inference_geo "us" per request, or workspace allowed_inference_geos | 1.1x for "us" on Claude 4.6 and later |
| Claude Models on Google Cloud (Anthropic managed) | inference_geo | 1.1x for "us" |
| Claude in Microsoft Foundry | US Data Zone Standard deployment type | 1.1x |
| Bedrock and Claude Models on Google Cloud (Google managed) | Partner-operated regional or geography endpoints | The platform's own regional pricing |
Checkpoint 1 of 8· Fill the gap
A healthcare startup must keep model inference on US-based infrastructure. It calls the first-party Claude API with a Claude 4.6-or-later model. Which value completes the request?
client = anthropic.Anthropic()
response = client.messages.create(
model="claude-opus-5-5",
max_tokens=1024,
inference_geo= ? ,
messages=[
{"role": "user", "content": "Summarize the key points of this document."}
],
)On the first-party Claude API, inference_geo accepts only "global" (the default, which can route anywhere) or "us", and "us" keeps inference in the US at 1.1x the standard rate. AWS region names and an "eu" value are not valid here. EU pinning belongs to Bedrock's geography-prefixed profiles.
Source: platform.claude.comCheckpoint 2 of 8· Exam question
A European bank will call Claude through Amazon Bedrock and must keep inference traffic routed within the EU geography. Which two actions belong in the design? Choose two.(Select 2)
Correct answers: A, C — Call the model through the EU-prefixed inference profile ID rather than the global-prefixed one, so dispatch is limited to regions inside the EU.; Verify the chosen model is offered under an EU inference profile before finalizing, since coverage differs by model and some newer models have none.
- A. Correct. A geography-prefixed (EU) cross-region inference profile confines dispatch to regions in that geography, whereas a global-prefixed profile sends requests to whichever region has capacity.
- B. Incorrect. IAM conditions control who may call the service and from where, not which regions Bedrock uses to run inference. A global profile can still dispatch requests outside the EU, so the residency requirement is not met.
- C. Correct. Profile availability is not uniform across models and geographies, and some newer models have no EU profile. Residency and model choice therefore have to be validated together before the design is fixed.
- D. Incorrect. Regional profiles carry a roughly 10 percent price premium over global profiles for the newer models that offer both, so the prefix does affect billing and the cost model has to include it.
- E. Incorrect. The Message Batches API is not among the endpoints supported through Bedrock's runtime surface, so it cannot serve as the residency mechanism for this workload.
2.Agent runtimes and who operates what
The deployment surface decides where inference runs. The agent runtime decides who runs everything around it: the loop that calls the model, the tools that run commands, and the store that holds session history. There are four runtimes, and each splits that work differently between your team and Anthropic.
| Runtime | Who runs the loop and tools | Where it runs |
|---|---|---|
| Messages API through a Client SDK | You write the tool loop, or use the beta tool runner | Your own service |
| Agent SDK | A library that runs the Claude Code binary, with built-in tools, permissions, sessions and hooks | A process you operate |
| Claude Code CLI (headless with -p) | Claude Code's own loop | Your terminal, script or CI job |
| Claude Managed Agents | Anthropic's hosted harness | An Anthropic-managed cloud sandbox, or a self-hosted sandbox |
A Messages API loop gives you the most control and the most work. Every tool executor, retry and piece of state handling is code your team writes. That pays off when the loop itself is the product. It is the wrong choice when a team wants file and shell tools that already work.
The Agent SDK and headless Claude Code reuse a finished harness, but you host it. The SDK embeds Claude Code's agent in a Python or TypeScript application that runs in your own process. Headless mode runs the same agent from a single command. A headless run cannot start background commands or background subagents, and a command that reaches its timeout stops. Use it for bounded jobs, not long watches. The --bare flag skips local settings, so a CI job gets only the configuration passed on its command line.
claude --bare -p "Summarize README.md" --allowedTools "Read"Claude Managed Agents moves the harness and its infrastructure to Anthropic. You define an agent once: its model, system prompt, tools, MCP servers and skills. You then start sessions in an environment. Claude runs tools on its own and streams results back as server-sent events, and you can steer or interrupt it while it works. Managed Agents is built for tasks that run for minutes or hours, for scheduled cron runs, and for teams that want no agent loop or sandbox of their own. Before you choose it, check the surface. Managed Agents is listed on the Claude API, Claude Platform on AWS and Claude Models on Google Cloud (Anthropic managed), and every request needs the managed-agents-2026-04-01 beta header. A team committed to a partner-operated surface such as Bedrock needs a runtime it hosts itself.
Checkpoint 3 of 8· Check yourself
A team on the first-party Claude API needs agents that work on tasks for several hours, using file and shell tools. The team does not want to run an agent loop, a sandbox or tool-execution infrastructure of its own. Which runtime fits?
Managed Agents is the only runtime here where Anthropic hosts the harness, the tool execution and the sandbox, and it is built for tasks that run for minutes or hours. With the Messages API loop, the Agent SDK or headless Claude Code, the team still hosts the runtime. Headless runs are also meant for bounded jobs, not long ones.
“Minimal infrastructure: No need to build your own agent loop, sandbox, or tool execution layer”Source: platform.claude.com
3.Data custody and compliance eligibility
Where session data is stored decides whether a runtime can meet Zero Data Retention (ZDR) requirements, while HIPAA is a flat exclusion. Managed Agents is stateful by design. Its sessions resume after pauses because Anthropic keeps their conversation history, sandbox state and outputs on its servers, so standard Managed Agents is not eligible for ZDR. Self-hosted Claude Managed Agents is the one documented ZDR exception, because there you store that data yourself. HIPAA has no such exception. Managed Agents is not currently eligible for a HIPAA Business Associate Agreement on any deployment, and that covers every sub-feature, including a fully self-hosted service. Custody can earn a ZDR exception but nothing comparable is documented for HIPAA, so when you meet a new Managed Agents case, ask who stores the data to settle ZDR and treat HIPAA as ruled out.
Two kinds of self-hosting are easy to confuse. A self-hosted sandbox moves tool execution onto your infrastructure, which helps with compliance and data-residency requirements, but Anthropic's service still keeps the event history. Self-hosted Claude Managed Agents runs the whole service on your infrastructure, and that is what moves the stored data into your custody. You can delete sessions and uploaded files through the API at any time. Deleting data after it was retained does not make the runtime ZDR-eligible.
When compliance rules out Anthropic-held state but the team still wants a ready-made harness, the Agent SDK fits. Take a healthcare startup that needs ZDR for all agent traffic and does not want to write its own loop. It runs the SDK in containers it operates. It stores transcripts through a SessionStore adapter on its own database and runs the tool shell in its own sandbox. That way it keeps the built-in tools and also holds custody of the data. A Messages API loop would also keep data in-house, but the team would have to rebuild the file and shell tools it wanted to reuse.
Self-hosting the SDK moves sandboxing and credential handling onto your team too. When choosing a sandbox, weigh who runs it: a sandbox-as-a-service provider, or software you run yourself. Weigh its networking as well. Regulated environments need custom egress rules, outbound proxies and private VPC peering. Keep tool credentials out of the agent's environment: a proxy adds them after the request leaves the container. In a multi-tenant deployment, apply egress rules per tenant at that proxy, so that a compromised tenant cannot use another tenant's outbound policy. Who may call the agent is a separate question, covered under authentication and authorization posture.
Checkpoint 4 of 8· Check yourself
Under its contract, a hospital network needs HIPAA Business Associate Agreement coverage for an agent that reads patient files and runs shell commands. The team wants built-in file and shell tools and does not want to write its own agent loop. Which design fits?
No Managed Agents deployment is eligible for a HIPAA BAA. That covers self-hosted service, self-hosted sandbox and deleting sessions after use. The self-hosted Agent SDK keeps Claude Code's built-in tools and leaves custody of the data with the team.
“Not eligible for HIPAA. Applies to all Managed Agents sub-features.”Source: platform.claude.com
Checkpoint 5 of 8· Exam question
A healthcare startup's platform architect must ship an autonomous coding-and-document agent. Compliance requires Zero Data Retention for all agent traffic, and the team wants to reuse an existing agent harness with built-in file and shell tools instead of writing its own loop. Which runtime choice fits these constraints?
Correct answer: B — Run the Agent SDK in containers you operate, with a SessionStore adapter on your own database for transcripts and the tool shell in your own sandbox.
- A. Incorrect. Managed Agents sessions are stateful server-side resources, and their transcripts persist until deleted. The hosted service is not ZDR eligible, so deleting a session after the task does not meet a Zero Data Retention requirement for agent traffic.
- B. Correct. The Agent SDK provides the ready-made harness with shell and file tools. Running it in your own containers keeps the agent loop, sandbox and transcripts on infrastructure you control, so retention depends on your own storage and the API's ZDR terms rather than a hosted session store.
- C. Incorrect. A stateless service with audited workers could satisfy the retention rule, but it means writing a new agent loop and your own tool executors. The team wanted to reuse an existing harness with built-in file and shell tools, and the Agent SDK already ships tool execution, context management and permissions.
- D. Incorrect. The beta header only opts a request into a beta feature and does not change data-handling eligibility. MCP tunnels only affect connectivity to private tools. Sessions and history are still stored server-side by the hosted service, which conflicts with Zero Data Retention.
4.Session state and cold starts for a self-hosted Agent SDK
A self-hosted SDK keeps its state on local disk unless you set up somewhere else for it. Each session writes to three places, and on Kubernetes, all three disappear when a container scales to zero.
| State | Default location |
|---|---|
| Session transcripts | ~/.claude/projects/, or projects/ under CLAUDE_CONFIG_DIR if set |
| CLAUDE.md memory files | ~/.claude/CLAUDE.md (user tier) and the session's working directory (project tier) |
| Working-directory artifacts | The session's working directory |
SessionStore saves the conversation, but not the notes. If you configure a SessionStore backed by an object store, a key-value store or a database, a returning user can resume their session by ID in any container. SessionStore copies transcripts only. CLAUDE.md files and other working-directory artifacts need a shared volume, or a sync that restores them when a new container starts. Pointing CLAUDE_CONFIG_DIR at another path inside the same container does not help, because that path disappears with the container. Routing a user back to "their" container fails for the same reason: after scale-to-zero, that container no longer exists.
import { query, type SessionStore } from "@anthropic-ai/claude-agent-sdk";
declare const userInput: string;
declare const sessionId: string; // looked up from your database by user
declare const sessionStore: SessionStore; // an object store, key-value store, database, or your own adapter
for await (const message of query({
prompt: userInput,
options: { resume: sessionId, sessionStore },
})) {
// ...
}The store is a mirror, and writes to it can fail quietly. The subprocess writes to local disk first and then forwards each batch to the store. If a batch cannot be delivered, the SDK drops it, emits a mirror_error system message and carries on. If the store must be durable, alert on that message.
**A session has no lifetime limit, and maxTurns does not provide one.** maxTurns (max_turns in Python) only caps how many turns the agent takes before it stops. It is a runaway guard, not a timeout. Holding a session open through a user's idle time only uses up memory, so recycle long-running subprocesses.
Cold-start time is the latency a hosting pattern has to budget for. Cold start is how long it takes from asking for a sandbox to that sandbox being ready to accept the first request, so every second of it lands on whoever sends that request. Ephemeral patterns, which suit bursty workloads, need sub-second starts. Long-running patterns, where a session stays up, tolerate a slower start. Billing follows the same split: per-second pricing suits bursty ephemeral workloads, while flat hourly pricing suits long-running sessions. Warming attacks the start-time problem by doing the slow work before a request arrives. In TypeScript, startup() pre-warms subprocesses ahead of incoming traffic, and prewarm() does the same when you won't know a session's working directory until its first request. Managed Agents removes this work entirely, because its sessions keep persistent filesystems and history. The cost is that Anthropic holds that data, as the custody rules above describe.
Checkpoint 6 of 8· Fill the gap
After a Kubernetes pod scales to zero, a returning user's next request lands on a new container. The transcript is in an external SessionStore. Which option makes the SDK continue the user's saved session instead of starting a new one?
import { query, type SessionStore } from "@anthropic-ai/claude-agent-sdk";
declare const userInput: string;
declare const sessionId: string; // looked up from your database by user
declare const sessionStore: SessionStore; // an object store, key-value store, database, or your own adapter
for await (const message of query({
prompt: userInput,
options: { ? : sessionId, sessionStore },
})) {
// ...
}Passing the session ID as resume, together with a configured sessionStore, lets any container load the saved transcript and carry on. maxTurns only caps how many turns the agent takes. It does nothing to restore a session.
Source: code.claude.comCheckpoint 7 of 8· Check yourself
In a self-hosted Agent SDK deployment, a returning user resumes from a SessionStore on a fresh container. The conversation comes back, but the project-tier CLAUDE.md notes from their earlier work are missing. What fixes this?
SessionStore copies only transcripts. CLAUDE.md files and working-directory artifacts need a shared volume or a separate sync. A path inside the container and the original container both disappear after scale-to-zero, and maxTurns sets no lifetime.
“SessionStore mirrors transcripts, not CLAUDE.md memory files or other working-directory artifacts. Mount a shared volume or sync those separately.”Source: code.claude.com
Checkpoint 8 of 8· Exam question
An Agent SDK service runs on Kubernetes. Containers scale to zero when users go idle, and returning users report that the agent has lost both the conversation and the project notes it kept in CLAUDE.md. Which two changes address this? Choose two.(Select 2)
Correct answers: A, C — Configure a SessionStore adapter backed by an object store or database, and resume each returning user's session from its saved session ID.; Back the working directory and the user-level memory files with a shared volume or an object-store sync restored when a new container starts.
- A. Correct. Transcripts live on local disk by default and disappear when a container scales down. A SessionStore adapter mirrors them to durable storage, so a fresh container can resume the session by ID.
- B. Incorrect. Consistent hashing only helps while the target container is still running. Containers scale to zero during idle periods, so the subprocess and its transcript files no longer exist when the user returns.
- C. Correct. CLAUDE.md and other working-directory or user-level memory files are not mirrored by a SessionStore, which covers transcripts only. They need their own durable storage, such as a shared volume or an object-store sync.
- D. Incorrect. maxTurns limits how many turns the agent takes in one run. It does not keep a container alive between visits and does not persist conversation or memory state across a scale-down.
- E. Incorrect. CLAUDE_CONFIG_DIR changes where files are written, but a directory in the container's writable layer is still ephemeral local disk. Transcripts and memory files placed there are lost on scale-down, just as in the default location.
Sources9
Sources
(9)
Every claim above is drawn from one of these pages, quoted as it was written on the date shown.
- 1.
“To call these models, pass an inference profile instead of the base model ID.”
↩︎ Deployment surfaces and where inference runs - 2.
“To route across multiple regions within a geography, use an inference profile (US, EU, JP, or AU).”
↩︎ Deployment surfaces and where inference runs“Regional endpoints carry a 10 percent pricing premium over global endpoints.”
↩︎ Exam trap 1“Regional endpoints carry a 10 percent pricing premium over global endpoints.”
↩︎ Prediction - 3.
“Requests with inference_geo on Claude Opus 4.5, Claude Sonnet 4.5 (deprecated), Claude Haiku 4.5, or earlier models return a 400 error.”
↩︎ Deployment surfaces and where inference runs“Partner-operated platforms, Claude Models on Google Cloud (Google managed) and Bedrock, have their own regional pricing.”
↩︎ Deployment surfaces and where inference runs - 4.https://platform.claude.com/docs/en/build-with-claude/claude-models-on-google-cloud/overviewOfficial docs
“A global, multi-region, or regional endpoint”
↩︎ Deployment surfaces and where inference runs - 5.
“Data Zone creates a US Data Zone Standard deployment, which keeps inference within the United States.”
↩︎ Deployment surfaces and where inference runs - 6.https://code.claude.com/docs/en/agent-sdk/overviewOfficial docs
“in a process you operate”
↩︎ Agent runtimes and who operates what“You write the tool loop yourself”
↩︎ Agent runtimes and who operates what - 7.
“Instead of building your own agent loop, tool execution, and runtime, you get a fully managed environment”
↩︎ Agent runtimes and who operates what“Not eligible for HIPAA. Applies to all Managed Agents sub-features.”
↩︎ Data custody and compliance eligibility“The exception for Zero Data Retention is self-hosted Claude Managed Agents, where you store that data yourself”
↩︎ Data custody and compliance eligibility“The Managed Agents service keeps the event history, and you can fetch it in full.”
↩︎ Data custody and compliance eligibility“sessions are long-running, resume cleanly after pauses, and store conversation history, sandbox state, and outputs server-side”
↩︎ Key concept“Because of this, Managed Agents is not currently eligible for Zero Data Retention or HIPAA Business Associate Agreement (BAA) coverage.”
↩︎ Exam trap 2“Minimal infrastructure: No need to build your own agent loop, sandbox, or tool execution layer”
↩︎ Checkpoint - 8.https://code.claude.com/docs/en/headlessOfficial docs
“A command that reaches its timeout stops instead of moving to the background.”
↩︎ Agent runtimes and who operates what - 9.https://code.claude.com/docs/en/agent-sdk/hostingOfficial docs
“Who runs the sandbox: a sandbox-as-a-service provider operates the infrastructure for you, while self-hosted options give you software to run on your own.”
↩︎ Data custody and compliance eligibility“Route outbound calls through a proxy that injects API keys after the request leaves the container.”
↩︎ Data custody and compliance eligibility“Mount a shared volume or sync those separately.”
↩︎ Session state and cold starts for a self-hosted Agent SDK“Alert on these if store durability matters.”
↩︎ Session state and cold starts for a self-hosted Agent SDK“Ephemeral patterns need sub-second starts. Long-running patterns tolerate more.”
↩︎ Session state and cold starts for a self-hosted Agent SDK“Per-second pricing suits bursty ephemeral workloads. Hourly suits long-running sessions.”
↩︎ Session state and cold starts for a self-hosted Agent SDK“Call startup() to pre-warm subprocesses ahead of incoming traffic.”
↩︎ Session state and cold starts for a self-hosted Agent SDK“Transcripts only: SessionStore mirrors transcripts, not CLAUDE.md memory files or other working-directory artifacts.”
↩︎ Exam trap 3“Set maxTurns in TypeScript or max_turns in Python to bound how many turns the agent takes before stopping.”
↩︎ Exam trap 4“SessionStore mirrors transcripts, not CLAUDE.md memory files or other working-directory artifacts. Mount a shared volume or sync those separately.”
↩︎ Checkpoint