Integration
Least-privilege tool configuration, authentication/authorization posture, relieving the binding performance constraint, monitoring gaps, selecting the retrieval architecture and connection mechanism, progressive discovery, and reliability controls (rate limits, retry/backoff, idempotency, fallback) at enterprise scale.
- Least-Privilege Tool Configuration: least privilege, minimal footprint
- Authentication and Authorization Posture: credential exposure, privilege escalation
- Relieving the Binding Performance Constraint: retrieval depth, model tier, caching, call pattern
- Instrumentation and Monitoring Gaps in scaled agentic architectures
- Retrieval Architecture Selection: RAG pipeline, agentic search, full-corpus context; contextual retrieval
- Connection Mechanism Selection: MCP, direct API/CLI, agent-to-agent handoff
- Progressive Discovery vs. Monolithic Context Loading
- Production Reliability Controls: rate-limit handling, retry and backoff, idempotency, fallback routing
Domain overview
Domain 3 accounts for 21% of the CCAR-P exam, about 13 of the 60 scored items. Items present an architecture with constraints and evidence (error traces, throughput tables, tool configurations) and ask you to choose one change that solves the actual problem without breaking another constraint.
| Objective | Typical question | Keywords to recognize |
|---|---|---|
| Least-privilege tool configuration | Which tool should be removed, scoped down, or replaced? | minimal footprint, read-only, search_* |
| Authentication & authorization | Where are credentials exposed, and how can privileges escalate? | proxy, vault, OAuth, service account |
| Binding performance constraint | What change relieves accuracy or latency? | retrieval depth, model tier, caching, call pattern |
| Instrumentation gaps | Which signal should have caught the failure? | OTel, cache hit rate, served model |
| Retrieval architecture | RAG, agentic search, or full-corpus? | 200k tokens, BM25, contextual retrieval |
| Connection mechanism | MCP, API/CLI, or agent handoff? | transport, stateless, session |
| Progressive discovery | Load progressively or load everything? | defer_loading, Skills, tool search |
| Reliability controls | Retry, backoff, idempotency, fallback? | retry-after, 429, 529, duplicate effect |
The general approach: identify the binding constraint, read the evidence, choose a deterministic control. "Add an instruction to the system prompt" is almost always a distractor when the problem involves permissions, money, or duplicate effects.
(Sources: CCAR-P Exam Guide, Domain 3; Claude Certification exam prep: CCAR-P Prep Course — Enterprise Integration & Production)
Least-privilege tool configuration
Anthropic's CISO guide calls this the principle of least agency: scope permissions around actions, rather than relying on the model's current capability limits. An example from the guide: an incident-response agent that was only allowed to read logs, read Slack, and draft Google Docs contacted another agent on its own after a model upgrade. Permissions must be locked down in configuration.
Each tool connection has three options:
- Remove: tools that do not serve the task. Every tool definition both consumes context and widens the attack surface.
- Scope down: switch to read-only, require per-action approval, remove destructive verbs such as
delete. Claude Enterprise connectors let you set each write/delete tool to "Always allow", "Needs approval", or "Blocked". - Replace (with a context-efficient access pattern):
search_contactsinstead oflist_contacts,search_logsinstead ofread_logs,get_customer_contextcombining several sources. Add aresponse_formatenum ("concise"/"detailed": 72 vs. 206 tokens in the example), pagination, filtering, truncation. Claude Code limits tool responses to 25,000 tokens by default.
At the runtime layer, the Agent SDK secure deployment documentation lists: read-only filesystem mounts, network access through an allowlisting proxy, credentials injected from outside, dropped Linux capabilities (--cap-drop ALL, --network none, --read-only), and never mounting .env or ~/.aws/credentials. The CISO guide rates egress allowlisting as the strongest control against prompt injection.
| Symptom | Remedy |
|---|---|
| A document-summarization subagent has DB write access | Remove |
| A support agent needs to read tickets and occasionally close them | Scope down + approval for write actions |
list_all_orders returns 50k rows and fills the context |
Replace with search_orders(customer_id, status) |
Exam trap
A "never delete data" line in the system prompt is not least privilege, because a prompt is only a probabilistic control. MCP tool annotations (readOnlyHint, destructiveHint, idempotentHint, openWorldHint) are also only hints, not security guarantees. The correct answer removes permissions at the configuration layer: tool list, connector settings, IAM, read-only mounts.
(Sources: Claude Blog: CISO's guide to agentic AI; Anthropic Engineering: Writing effective tools for AI agents; Claude Code Docs: Securely deploying AI agents; Anthropic Academy: Deploying Claude Enterprise with confidence — Connectors; Anthropic Skills: mcp-builder — MCP Server Best Practices)
Authentication and authorization posture
Two groups of risk:
- Credential exposure: tokens, API keys, or cloud configuration files sit where the agent can read them, so prompt injection can trick the agent into printing or sending them out.
- Privilege escalation: the agent acts with broader permissions than the user it serves. Example: every user goes through one service account that can read the entire CRM.
The CISO guide describes an identity spectrum: service accounts at one end, human credentials at the other, and delegated identity in between, the most ambiguous zone. The architectural question: on whose behalf does the agent act, and does the audit trail record that correctly?
Mitigations covered in the documentation:
- Proxy pattern: inject credentials outside the agent boundary through
ANTHROPIC_BASE_URLorHTTP_PROXY/HTTPS_PROXY. With an HTTPS CONNECT tunnel, the proxy cannot inject credentials unless it terminates TLS. The sandbox never holds credentials worth stealing. - Vault (Claude Managed Agents): per-end-user credentials, attached with
vault_idsatsessions.create. The agent never sees the token; supports static bearer tokens or OAuth with refresh; audit is tied to the user. - Remote MCP: use OAuth 2.1, validate the access token before processing, and accept only tokens issued for that specific server. For Streamable HTTP running locally, enable DNS rebinding protection, check
Origin, and bind to127.0.0.1. - Three connector gates: Organization gate, Role gate, Member gate. Through a connector, Claude inherits the member's own permissions in the source system. Enterprise-managed authorization (EMA) grants access centrally through the identity provider (IdP).
- Workspaces: set separate rate limits and spend limits below the org level to isolate workloads; the prompt cache is isolated per workspace on the Claude API. A key without the required permission gets a 403
permission_error. Detect leaked keys with the Usage and Cost Analytics API grouped byapi_key_id.
| Risk | Indicator | Mitigation |
|---|---|---|
| Token in the sandbox environment | Agent runs arbitrary code and has GITHUB_TOKEN |
Proxy injection or vault |
| Shared service account | Everyone sees the same data, audit records only the service | Per-user credentials (vault, OAuth, member gate) |
| Remote MCP accepts any token | Accepts tokens issued for other services | OAuth 2.1, verify the token was issued for this server |
| Leaked key | Cost rising on an unfamiliar key | Usage and Cost API by api_key_id, revoke the key |
Scenario example
A bank deploys an agent that looks up customer records for 400 branch employees, using a service account that can read the entire core banking system plus the instruction "only answer about customers of the requester's branch". This is privilege escalation: the effective permissions are broader than each employee's, and the prompt cannot enforce the restriction. The fix is to have the agent use each employee's delegated identity (per-user OAuth through a vault or the connector member gate), so that the source system enforces permissions itself and the audit trail records the right person.
Key point
The identity attribute in Agent SDK telemetry identifies the service credential, not the end user. To trace actions back to users, inject enduser.id/tenant.id for each query() call.
(Sources: Claude Blog: CISO's guide to agentic AI; Claude Code Docs: Securely deploying AI agents; Claude Code Docs: Observability with OpenTelemetry; Claude Cookbooks: Claude Managed Agents; Anthropic Skills: mcp-builder — MCP Server Best Practices; Anthropic Academy: Deploying Claude Enterprise with confidence — Connectors; Claude Docs: Rate limits; Claude Docs: OpenTelemetry tracing for the Claude API)
Relieving the binding performance constraint
The binding constraint is the metric currently missing its target: accuracy or latency. The answer must relieve that constraint at the least cost to the other metric. The latency optimization cookbook breaks time down as follows:
TTLT ≈ number of calls × TTFT + output tokens ÷ OTPS + non-model latency
(TTFT: time to first token; TTLT: time to last token; OTPS: output tokens per second.)
| Lever | Relieves | Cost to the other metric |
|---|---|---|
| Retrieval depth (top-K, reranking) | Accuracy: top-20 beats top-10 and top-5 | More tokens; reranking adds latency and cost |
| Model tier | Up a tier for accuracy; down a tier for low-reasoning work | More expensive/slower, or lost accuracy |
| Caching | Cost; TTFT when the prefix is long and heavily reused | 1.25x write premium (5 minutes), no change to output |
| Call pattern (parallel, prefetch, effort, fast mode, batch) | Latency or cost | Fast mode costs 2x; batch can wait up to 24h |
Figures from the latency cookbook (Claude Opus 5.5 as the baseline):
- Claude Haiku 5.5 writes 581 tokens/second, Claude Sonnet 5.5 writes 236, Claude Opus 5.5 writes 153. But Haiku writes more tokens for the same task, so only move low-reasoning jobs to the smaller model.
- Fast mode gives up to 2.5 times the OTPS at 2x the price; p50 and p90 drop 53–59%, with no significant change in accuracy.
- Prefetching lookups that every task needs cuts p50 by 13%. Handing three independent lookups to subagents running in parallel shortened a task from 9.5 to 5.7 seconds.
- Caching cuts cost per task by 85% but does not change latency significantly for short tasks. Asking for an answer of exactly two lines cut the time from 46.4 to 4.9 seconds.
When accuracy is the constraint: increase retrieval depth, add contextual retrieval, or rerun failed cases at higher effort (low, then high, reaches about 97% at $0.17, versus everything at high: 95.3% at $0.29; requires a failure signal). When latency is the constraint: cache long prefixes, prefetch, parallelize, shorten output, lower effort if evals show accuracy holds.
Scenario example
A chat assistant for insurance policies has an SLA of p50 TTLT 4 seconds and currently measures 6.5 seconds; accuracy is 96% against a 95% floor. Each turn resends a 120k-token handbook. Choose to cache the static handbook and prefetch the policy record. Dropping a tier could push accuracy below the floor, reranking adds more delay, and Batch cannot be used for chat.
Exam tip
Underline the number that is missing its target. The correct option acts on the term that dominates the time (number of calls, uncached prefix, long output). "Upgrade to the most capable model" is rarely right when accuracy is not the problem.
(Sources: Claude Cookbooks: Latency Optimization on the Claude API; Claude Docs: Optimizing for cost and intelligence; Anthropic Engineering: Contextual retrieval in AI systems)
Instrumentation and monitoring gaps
Anthropic's postmortem of three incidents is the model case. A context-window routing bug affected 0.8% of requests, peaking at 16% after a load-balancing change, and routing was "sticky", so the same users were hit repeatedly. The bug slipped through because the evals were noisy, Claude often recovers from isolated mistakes, and privacy restrictions limited access to the data. Remediations: more sensitive evals and running quality evals continuously on the real production system.
Other lessons: the Claude Code team monitors cache hit rate like uptime; the multi-agent research system monitors decision patterns without reading conversation content; the eval harness must assert which model actually served the request, because a fallback can silently swap the model.
Available signals:
- Agent SDK:
CLAUDE_CODE_ENABLE_TELEMETRY=1; metrics, log events, and traces (traces requireCLAUDE_CODE_ENHANCED_TELEMETRY_BETA=1). Spansclaude_code.interaction,claude_code.llm_request,claude_code.tool,claude_code.hook; subagent spans nest under the parent agent's tool span. - Events for the SIEM:
tool_decision,tool_result,mcp_server_connection,permission_mode_changed. Logging prompt/tool content is opt-in. - Claude Platform OTel (beta): Metadata only by default; spans
anthropic.messages.create,anthropic.model_request,anthropic.custom_tool_use. Delivery is best effort, not a complete usage record.
| Incident that slipped through | Missing signal | Strategy |
|---|---|---|
| Quality drops on a small slice of traffic | Evals run only before release | Continuous quality evals in production |
| Cost doubles after a prompt edit | Cache hit rate not monitored | Alert on the cache_read_input_tokens ratio |
| Agent calls a write tool after hours | No tool events in the SIEM | Export tool_decision/tool_result |
| Actions cannot be traced back to a customer | Spans carry only the service identity | Inject enduser.id/tenant.id |
| Dashboard empty despite configuration | Export failing silently | CLAUDE_CODE_OTEL_DIAG_STDERR=1 |
Exam trap
"Log every prompt and response" is not the default answer to a monitoring gap: it runs into privacy constraints (HIPAA allows exporting metadata only) and does not create alerts by itself. Items usually want a thresholded signal tied to the specific type of failure that slipped through.
Key point
Agent SDK telemetry export fails silently by default. Default export intervals: metrics 60 seconds, traces and logs 5 seconds.
(Sources: Anthropic Engineering: A postmortem of three recent issues; Claude Code Docs: Observability with OpenTelemetry; Claude Code Docs: Monitoring; Claude Docs: OpenTelemetry tracing for the Claude API; Claude Blog: Lessons from building Claude Code: Prompt caching is everything; Anthropic Skills: claude-api — Eval health checklist)
Retrieval architecture selection
- Full-corpus context: a knowledge base under 200k tokens (about 500 pages) goes entirely into the prompt, together with prompt caching. The Contextual Retrieval article reports latency cut by more than 2× and cost by up to 90%.
- Pre-built RAG pipeline: the corpus exceeds the context window. Chunks of a few hundred tokens, embeddings + BM25, rank fusion, take the top-K. BM25 catches exact matches such as the code "TS-999" that embeddings often miss.
- Agentic search with tools: Claude formulates its own queries and calls search tools repeatedly. Suits multi-step questions or continuously changing data, but is token-hungry: an agent uses about 4× the tokens of chat, multi-agent about 15×.
| Criterion | Full-corpus + cache | RAG pipeline | Agentic search |
|---|---|---|---|
| Corpus | Under about 200k tokens | Large, relatively stable | Large, frequently changing or live |
| Query type | Any | Single-step lookup | Multi-step exploration |
| Latency | Low when the cache is warm | Low | Higher, multiple turns |
| Weakness | Cannot exceed the context window | Chunks lose their context | Token-hungry, hard to predict |
Contextual Retrieval prepends 50–100 tokens of context to each chunk before embedding and BM25 indexing, generated by Claude 3 Haiku from a prompt containing <document> and <chunk>; thanks to prompt caching, the one-time cost is about $1.02 per million document tokens. The retrieval failure rate (1 − recall@20) drops 35% with Contextual Embeddings, 49% when Contextual BM25 is added, and 67% when reranking is added (retrieve 150, rerank down to 20).
Fallback configuration once indexing is chosen: keep hybrid embeddings + BM25 for queries that contain IDs; have the search tool return "No results found." instead of an error so Claude can reformulate the query; return search_result blocks to get citations (cited_text does not count toward output tokens); and run evals on chunk boundaries, the contextualizer prompt, and the number of chunks.
Exam trap
A stable 300-page corpus with recurring questions: don't build RAG just because it is "enterprise scale". Under about 200k tokens, full-corpus + caching is simpler and has no retrieval failures. When recall is poor on queries containing product codes, add BM25 or contextual BM25 instead of switching to a larger model.
(Sources: Anthropic Engineering: Contextual retrieval in AI systems; Anthropic Academy: Building with the Claude API — RAG and Agentic Search; Claude Docs: Search results; Claude Docs: Citations; Anthropic Engineering: How we built our multi-agent research system)
Connection mechanism selection
MCP standardizes how clients discover and call tools, so one server can be reused across many clients. The stdio transport runs the server as a subprocess on the same machine. Streamable HTTP is for remote servers, using mcp-session-id and SSE for messages the server sends to the client. stateless_http=True allows horizontal scaling behind a load balancer but loses session IDs, server-to-client requests, sampling, progress, and subscriptions. The 2026-07-28 spec removes the initialize handshake and session IDs. On Managed Agents, MCP toolsets are proxied by Anthropic; custom tools are used when a service is reachable only inside your network.
Direct API/CLI (or a custom tool that calls an API) has the fewest intermediate layers and suits a single consuming application, fixed operations, and low-latency needs. Programmatic tool calling lets Claude write a script that calls multiple tools inside a container, with only the filtered results entering context (24% fewer input tokens).
Agent-to-agent handoff gives subagents their own context and model, and lets them run in parallel. The Claude Code team advises against switching models mid-session (the cache is tied to the model) and recommends handing off to a subagent instead. Subagents should write output to the filesystem and pass references to avoid the "game of telephone".
| Constraint | Favors |
|---|---|
| Many clients need the same integration | MCP (Streamable HTTP) |
| One internal service, fixed operations, low latency | Direct API/CLI or custom tool |
| Horizontally scaling an MCP server, no server-to-client messages needed | MCP stateless_http=True |
| Needs progress, sampling, server-initiated requests | MCP with sessions |
| Subtask needs a different model or a clean context | Agent handoff |
Key point
Statefulness is the deciding factor: stateless HTTP scales easily but loses bidirectional features; handoff keeps the main session stable but costs tokens because each subagent needs its own context.
(Sources: Anthropic Academy: Model Context Protocol: Advanced topics; Anthropic Academy: Introduction to Model Context Protocol; Claude Cookbooks: Claude Managed Agents; Claude Blog: Lessons from building Claude Code: Prompt caching is everything; Anthropic Engineering: How we built our multi-agent research system)
Progressive discovery vs. monolithic context loading
Progressive discovery keeps tools, instructions, and data out of context until they are needed:
- Agent Skills load at three levels: the name and description are preloaded; SKILL.md loads when relevant; bundled files are read when needed.
- Tool search with
defer_loading: cost stays nearly flat up to 502 tools, whereas preloading rises from $0.55 to $1.02, with comparable accuracy. Keep the 3–5 most-used tools always loaded. Deferring the GitHub MCP toolset saves 20%; tool search over 500 definitions saves 45%. The latency cookbook holds that tool search pays off when tool definitions exceed about 10,000 tokens. - Large data: mounting files through the Files API for code execution scored 25/25 correct at $0.40, versus pasting about 91k tokens into the prompt: 7/25 at $5.01.
Monolithic loading suits context that is small, stable, used on most turns, and already cached, because each discovery step adds at least one TTFT. Don't add or remove tools mid-session: changing tool definitions invalidates the entire cache. Claude Code uses defer_loading stubs so the prefix stays unchanged while discovery still happens progressively.
Exam trap
"Progressive discovery is always better" is wrong. For a voice agent with 6 fixed, already-cached tools, adding tool search only adds calls. Conversely, when 400 tool definitions take up most of the input while each session uses only a few tools, preloading is the wrong context economics.
(Sources: Anthropic Research: Equipping agents with Agent Skills; Claude Docs: Optimizing for cost and intelligence; Claude Cookbooks: Latency Optimization on the Claude API)
Production reliability controls
| HTTP | Error type | Correct response |
|---|---|---|
| 400 | invalid_request_error; also when hitting a spend limit the org/workspace set itself ("You have reached your specified API usage limits") |
Fix the request or the limit; retrying is useless |
| 429 | rate_limit_error with retry-after |
Wait as retry-after says, back off |
| 429 | error_code: "enforced_spend_limit_reached", no retry-after |
Don't retry; resets at 00:00 UTC on the 1st of the next month |
| 429 | error_code: "ramp_limit_exceeded" |
Hold at the level that works, increase by at most one step per minute |
| 500 | api_error |
Retry with exponential backoff |
| 504 | timeout_error |
Use streaming for long requests |
| 529 | overloaded_error (system-wide overload) |
Back off, reduce load |
- The SDK automatically retries connection errors, 429s, and 5xx errors with exponential backoff, 2 times by default, honoring
retry-after; adjust withmax_retries. Retries need jitter and a cap on attempts; a retry loop without delays silently multiplies cost. - Rate limits use a token bucket: 60 RPM may be enforced as 1 request per second, so short bursts still get 429s.
- Cache-aware ITPM:
cache_read_input_tokensdo not count toward ITPM. A 2M ITPM limit with an 80% cache hit rate can process about 10M input tokens per minute. - The Batch API is not subject to ramp limits. Errors can arrive mid-stream after a 200.
Idempotency for side-effecting tools. Retries are safe for reads but dangerous for money transfers, sending emails, or creating tickets. When the tool has already executed on the target system but the client times out before receiving the response, a retry causes a second execution. The fix is an idempotency key derived from the business operation (for example, a request ID) and sent with every attempt; the target system checks the key and returns the original result if the operation was already processed. Lengthening timeouts or reducing retries only narrows the race window; telling the model to "check whether it has already paid" is not enforceable, and the model does not see the earlier result. MCP's idempotentHint is only a declaration.
Fallback routing. The documentation has a specific mechanism for refusals (HTTP 200, stop_reason: "refusal"): the fallbacks: "default" parameter with the beta header server-side-fallback-2026-07-01 makes the API rerun the request on another model according to the refusal type. Prefer "default" over pinning a model that may be deprecated. Always record which model served the request; the cache is tied to the model, so the fallback model reads a cold cache; fallbacks for side-effecting tools must reuse the same idempotency key.
Scenario example
A nightly invoice reconciliation job. From 01:00, every request gets a 429 with error_code: "enforced_spend_limit_reached" and no retry-after. The operations team proposes raising max_retries to 10. Wrong: retries will keep failing until 00:00 UTC on the 1st of the next month. The right approach is to handle it at the spend layer (raise the limit or the tier), set an alert before the threshold, and move non-urgent jobs to the Batch API to cut cost by 50%.
Key point
Not all 429s are alike. Read error.details.error_code and check whether retry-after is present before choosing a remedy: back off, ramp up gradually, or deal with the limit.
(Sources: Claude Docs: Claude API errors; Claude Docs: Rate limits; Claude Docs: Batch processing; CCAR-P Exam Guide, Domain 3 and the sample question on retries; Anthropic Skills: mcp-builder; Anthropic Skills: claude-api — Model Migration Guide, Eval health checklist; Claude Cookbooks: Classifier Fallback & Billing)
Quick summary
- Least privilege: remove, scope down, replace; lock permissions around actions, without relying on the model's limitations.
- Credentials never live in the sandbox: proxy injection, vault, egress allowlist.
- A shared service account is privilege escalation; prefer per-user delegated identity (OAuth, member gate, EMA).
- Remote MCP: OAuth 2.1, validate tokens, accept only tokens issued for that specific server.
- Relieve the binding constraint with the lever that acts on the term dominating the time, while keeping the other metric above its floor.
- Monitoring needs thresholded signals: quality evals in production, cache hit rate, tool events in the SIEM,
enduser.id. - OTel spans are best effort; detect leaked keys with the Usage and Cost API by
api_key_id. - Under about 200k tokens: full-corpus + caching; larger: hybrid RAG + contextual retrieval.
- MCP stdio for local, Streamable HTTP for remote;
stateless_http=Trueloses sessions, sampling, and progress. - Progressive discovery pays off when definitions are large and rarely used; don't add/remove tools mid-session.
- 429: with
retry-after, back off; withramp_limit_exceeded, ramp up gradually; withenforced_spend_limit_reached, retrying is useless. - Side-effecting tools need an idempotency key; longer timeouts or prompt instructions do not prevent duplicate effects.