The model call is the easy part. The harness, the evals and the guardrails decide whether an agent ships.
A custom agent is code that gives Claude a goal and a defined set of tools, runs the tool calls Claude asks for, and loops until the job is done. A demo takes an afternoon. Production takes the parts demos skip: tool definitions tight enough that Claude does not guess missing values, a permission model for every action that changes data, an evaluation set that runs on each prompt change, logs your security team can read, and a cost model that survives real volume. We scope those parts first, because they drive budget and timeline far more than the first prompt does, and because they are what your team will maintain after launch.
- 01
Three ways to build on Claude
The Messages API gives direct model access: you write the loop, or let the SDK tool runner drive it, and you host everything. The Claude Agent SDK, in Python and TypeScript, packages the Claude Code harness as a library, with built-in file, shell and web tools, hooks, subagents, MCP, permissions and resumable sessions, running in a process you operate. Claude Managed Agents, in beta, is a hosted harness: you define the agent, environment and session through the API, and Anthropic runs the loop in a managed cloud sandbox or in a self-hosted sandbox on your infrastructure. Each step up removes code you would write and adds terms you need to accept.
- 02
Where it runs changes what you can use
The same models are reachable through the Claude API, Claude Platform on AWS, Amazon Bedrock, Google Cloud and Microsoft Foundry, and the routes are not equivalent. On Bedrock, AWS operates inference and is the data processor, and Message Batches, the Files API, Agent Skills, the MCP connector and Managed Agents are not supported. Google Cloud (Google managed) and Foundry also lack Message Batches and Managed Agents. Claude Platform on AWS is operated by Anthropic, billed through AWS Marketplace, with feature access typically the same day as the Claude API. List the features your design needs, then pick the route, not the other way around.
- 03
Why Abstrakt Solutions
Most agents our clients ask for touch a CRM, an ERP or both. As a Salesforce partner since 2017 with 108 Salesforce certifications, and a Certified Services Partner in the Claude Partner Network with 12 Claude certifications, we can tell you when a job belongs in Agentforce, when it belongs in a custom Claude agent, and when it needs both connected through MCP or APIs. We build alongside your developers, hand over the eval suite, prompts and runbooks, and quote builds as a fixed fee or in phases after discovery, with consulting at $180 to $225 per hour. Our published Claude projects for Sync Payments and Abstrakt Marketing Group are linked below.
How we help with Custom Claude Agents (5)
The engagements we run most often on Custom Claude Agents, from first implementation through optimization.
Architecture and build-vs-buy decision
We compare Agentforce, a packaged product, the Messages API, the Agent SDK and Managed Agents for your specific use case, covering data location, hosting route and ownership. You get a written recommendation with a cost model at current token and runtime prices.
Tool and integration design
We define the tools the agent may call, with strict schemas, detailed descriptions and least-privilege credentials, and decide which run in your code and which come from MCP servers. Write actions get a human confirmation step by default.
Evaluation suite
Before production we build a task-specific test set with code-graded and model-graded checks, including messy inputs and injection attempts. It runs in CI, so prompt, tool and model changes are measured instead of guessed.
Guardrails and security review
We add input and tool-output screening, structured outputs for anything a system parses, permission policies or hooks for risky tools, and a retention review against ZDR and HIPAA eligibility. Your security team gets the threat model in writing.
Deployment, observability and cost tuning
We deploy on the route you choose, send usage, cost and trace data to your monitoring stack, and tune prompt caching, batch jobs and model selection. After launch we review quality and spend with you monthly.
What Custom Claude Agents actually includes (6)
Messages API with tool use
When Claude wants a client tool it returns a tool_use block; your code runs the operation and sends back a tool_result, and the loop continues. Server tools such as web search, web fetch and code execution run on Anthropic infrastructure instead. tool_choice can require or rule out tool calls, and strict: true on a tool definition makes inputs match your schema exactly. The SDK tool runner can drive the loop for you, and the MCP connector reaches remote MCP servers without a separate client.
Claude Agent SDK
The Agent SDK gives Python and TypeScript applications the tools, agent loop and context management that power Claude Code: file and shell tools, web search, hooks, subagents, MCP, permissions, sessions you can resume or fork, and skills and memory loaded from .claude directories. Use is governed by the Anthropic Commercial Terms of Service, including products you offer to your own customers. Products built on it must authenticate with API keys, not claude.ai login, unless Anthropic has approved otherwise.
Claude Managed Agents
A hosted agent harness in beta, called with the managed-agents-2026-04-01 header. You define an agent (model, system prompt, tools, MCP servers, skills), an environment (Anthropic cloud sandbox or self-hosted sandbox) and sessions, then stream events. The built-in toolset covers bash, file read, write and edit, glob, grep, web fetch and web search. Permission policies are always_allow, always_ask or auto, and MCP tools default to always_ask. Sessions persist server-side, so it is not ZDR or HIPAA BAA eligible.
Prompt caching and batch processing
Prompt caching reuses a stable prompt prefix. A 5-minute cache write costs 1.25 times base input and a 1-hour write 2 times, while cache reads cost 0.1 times base input, or 0.05 times on Claude Opus 5.5 and Claude Sonnet 5.5. The Message Batches API cuts input and output prices by 50 percent for asynchronous work, up to 100,000 requests or 256 MB per batch, with most batches finishing within an hour and results kept for 29 days. Batches are not ZDR eligible.
Structured outputs
Setting output_config.format with a JSON schema makes responses valid JSON that matches your schema, and strict tool use does the same for tool inputs. The feature is generally available on the Claude API, Claude Platform on AWS, Amazon Bedrock, Google Cloud (Google managed) and Microsoft Foundry. Limits matter: no recursive schemas, no numeric minimum or maximum, no string length limits, and additionalProperties must be false. A refusal or a max_tokens stop can still return output that does not match.
Usage, cost and monitoring data
Console workspaces separate projects with their own API keys, rate limits and monthly spend limits, up to 100 per organization by default. The Usage and Cost Admin API reports tokens by model, workspace, API key and service tier at one-minute to one-day granularity, usually within five minutes of the request. Managed Agents bills $0.08 per session-hour only while a session is running, plus tokens. On Bedrock, logs go to CloudWatch and CloudTrail; on Foundry, to Azure Monitor.
Is Custom Claude Agents the right call?
Good fit
- The task spans several systems, such as reading a contract PDF, checking ERP payment terms and drafting a CRM update, and no single vendor agent covers all three.
- Another system consumes the output, such as a JSON record, a classification or an extraction, at a volume where batch pricing and caching change the budget.
- A long-running job such as research, reconciliation or code migration needs a sandbox with files and shell access, which suits Managed Agents or the Agent SDK.
- Contract or data-processing rules require inference to stay inside your AWS, Google Cloud or Azure account.
- You have, or will hire, developers who can own the code, prompts and evals after launch.
Think twice
- The work lives entirely in Salesforce records and screens: an Agentforce agent is usually cheaper to build and maintain.
- Staff need a general assistant for drafting and analysis: a Claude Team or Enterprise rollout with connectors delivers that without custom code.
- Engineers want help writing and reviewing code: our Claude Code for Engineering Teams service fits better than building an agent.
- Nobody will own the agent after go-live: buy a packaged product or wait until an owner exists, because unowned agents drift as models and data change.
How a Custom Claude Agents rollout comes together (5)
- 01
Use case and success criteria
Owners: business sponsor and technical lead, one to two weeks. We write the agent's job in one paragraph, list the systems it reads and the actions it may take, and define success in measurable terms: accuracy on a labeled sample, latency, cost per task and the error rate the business can live with. Then we settle build or buy, including whether Agentforce or a packaged product already covers it.
- 02
Architecture and route
Owners: architect and security. We pick the build path (Messages API, Agent SDK or Managed Agents) and the hosting route by checking each required feature against the platform tables: batch, Files API, MCP connector, Managed Agents, ZDR and HIPAA eligibility. We define tools with strict schemas and narrowly scoped credentials, and mark which actions need human confirmation. Security signs off on the data flow before code is written.
- 03
Eval-first build
Owner: engineering lead. We assemble a test set that mirrors real inputs, including messy documents, missing fields, out-of-scope requests and injection attempts, and grade with code where possible and a separate model where judgment is needed. The agent is built against that set. Every prompt, tool or model change reruns it in CI, and a regression blocks the merge the way a failing unit test would.
- 04
Guardrails and pilot
Owners: product owner and reviewers, two to four weeks. We add input screening, screening of third-party tool output, structured outputs for anything parsed downstream, and spend and rate limits on a dedicated workspace or cloud budget. A read-only or draft-only pilot runs with a small user group while reviewers grade outputs against the success criteria and log every miss with the input that caused it.
- 05
Production and operations
Owner: named agent owner, ongoing. Write actions are enabled one at a time behind confirmation. Usage, cost and traces flow to your monitoring, and alerts fire on spend thresholds, error spikes and refusal rates. We review quality and cost monthly, rerun evals before any model migration, and keep a written record of who owns prompts, tools, credentials and the eval set.
Common Custom Claude Agents mistakes (4)
- 01
Choosing the cloud before listing features
Teams commit to Bedrock, Google Cloud or Foundry and then find Message Batches, the Files API or Managed Agents are not available there. Check the platform feature lists first.
- 02
Putting third-party content in the prompt
Emails, web pages and documents belong in tool_result blocks with their source labeled, never in the system prompt. Screen that content with a small classifier call before the agent can act on it.
- 03
Treating auto approval as a human checkpoint
The Managed Agents docs state that auto is not a human checkpoint: a call judged safe runs before anyone sees it. Set always_ask on any tool a person must approve.
- 04
Building the eval set after something breaks
Without a fixed test set, a prompt tweak or model upgrade can quietly lower accuracy for weeks. Build the set before the agent and rerun it on every change.
Guides on Custom Claude Agents (15)
- What should an AI acceptable-use policy say, and how do you enforce it in Claude?
- Should you build Claude agents on the Messages API, the Agent SDK, or Managed Agents, or buy one?
- How do you roll out Claude Code to an engineering team safely?
- What does Claude Enterprise cost? Seats, usage, API rates and rollout services
- Claude Enterprise vs. ChatGPT Enterprise vs. Microsoft 365 Copilot: which fits your company?
- How can finance and accounting teams use Claude without weakening controls?
- Claude Team vs. Enterprise: which plan does your company need?
- How do you connect Claude to your company's data? SharePoint, Google Drive, Slack, databases and ERPs
- Does Claude train on your data? Training, retention, zero data retention and where data lives
- How do you roll out Claude company-wide? A phased plan with owners, settings and checkpoints
- Is Claude HIPAA compliant? What the HIPAA-ready offering and BAA actually cover
- How do you measure the ROI of Claude in your company?
- What are Claude Skills, and how do companies build their own?
- What does a Claude implementation partner do, and do you need one?
- Using Claude with Salesforce: where it fits alongside Agentforce
Custom Claude Agents questions (6)
Should we build a custom Claude agent or use Agentforce?
If the work starts and ends inside Salesforce, Agentforce usually wins on build effort, and Salesforce offers Claude models hosted on Amazon Bedrock inside Agentforce. Build a custom agent when inputs live outside Salesforce, when the job needs a sandbox with files and shell access, or when outputs go to several systems. Many companies run both, connected through MCP or APIs, and our Agentforce vs. custom agents guide walks through the choice.
What is the difference between the Agent SDK and Managed Agents?
Both provide the agent loop so you do not write it. The Agent SDK is a library you run in your own process and infrastructure. Managed Agents is hosted: Anthropic runs the loop and stores sessions server-side, in its cloud sandbox or a self-hosted sandbox you operate. Managed Agents is in beta and is not eligible for ZDR or HIPAA BAA coverage.
How is Managed Agents billed?
On two meters: tokens at standard model rates with the usual prompt caching multipliers, and session runtime at $0.08 per session-hour. Runtime counts only while a session is running, not while it sits idle waiting for your input, and it replaces separate code execution container charges. The Batch API discount does not apply to sessions.
Which cloud should our Claude agents run on?
Start with the cloud your contracts and data rules point to, then confirm the features. Anthropic documentation recommends Bedrock when you need FedRAMP High, IL4, IL5 or HIPAA-ready compliance or need AWS as the sole data processor, and Claude Platform on AWS when you want Anthropic-operated features on your AWS bill. Google Cloud (Google managed) and Foundry support tool use, prompt caching and structured outputs but not Message Batches or Managed Agents.
How do we cut the cost of a high-volume agent?
Cache the stable prefix, meaning the system prompt, tool definitions and reference documents, so repeat reads bill at a tenth of base input or less. Move work that can wait a few hours into the Message Batches API for a 50 percent discount. Route simple steps such as classification to Claude Haiku 5.5, listed at $0.10 per million input tokens for prompts up to 100,000 tokens, and check the Usage and Cost API weekly.
How do we keep an agent from being hijacked by content it reads?
Treat every document, email, web page and tool result as untrusted data. Deliver it in tool_result blocks with its source labeled, state in the system prompt that such content never overrides instructions, screen tool output with a small classifier call, and give the agent only the credentials it needs. Require human confirmation for anything irreversible.
Sources (20)
Product details on this page come from these sources, checked October 26, 2026. Anthropic updates Claude often; confirm current terms for your contract.
- platform.claude.com/docs/en/agents-and-tools/tool-use/overview
- code.claude.com/docs/en/agent-sdk/overview
- platform.claude.com/docs/en/managed-agents/overview
- platform.claude.com/docs/en/managed-agents/tools
- platform.claude.com/docs/en/managed-agents/permission-policies
- platform.claude.com/docs/en/about-claude/pricing
- claude.com/pricing
- platform.claude.com/docs/en/build-with-claude/batch-processing
- platform.claude.com/docs/en/build-with-claude/structured-outputs
- platform.claude.com/docs/en/test-and-evaluate/develop-tests
- platform.claude.com/docs/en/test-and-evaluate/strengthen-guardrails/mitigate-jailbreaks
- platform.claude.com/docs/en/manage-claude/api-and-data-retention
- platform.claude.com/docs/en/manage-claude/usage-cost-api
- platform.claude.com/docs/en/manage-claude/workspaces
- platform.claude.com/docs/en/build-with-claude/claude-in-amazon-bedrock
- platform.claude.com/docs/en/build-with-claude/claude-platform-on-aws
- platform.claude.com/docs/en/build-with-claude/claude-models-on-google-cloud/google-managed
- platform.claude.com/docs/en/build-with-claude/claude-in-microsoft-foundry
- docs.cloud.google.com/gemini-enterprise-agent-platform/models/partner-models/claude
- salesforce.com/news/press-releases/2025/10/14/anthropic-regulated-industries-partnership-expansion-announcement