When constructing an AI agent, choosing a mannequin is just step one. The agent nonetheless wants instruments, directions for ending the job, a solution to handle context development in lengthy periods, and guardrails earlier than it executes any consequential actions, like issuing a refund.
We’re upgrading Amazon Bedrock AgentCore harness to make use of Strands harness, our open-source agent harness, launched earlier this yr, obtainable beneath an Apache 2.0 license. AgentCore harness additionally introduces lifecycle hooks, so you’ll be able to apply your personal deterministic checks and notifications at outlined factors within the agent loop.
With this improve, brokers that depend on the managed defaults get a really useful mannequin, a task-oriented system immediate, automated immediate caching (initially for Anthropic fashions on Amazon Bedrock), and proactive context administration. In addition they get further built-in instruments for planning, internet retrieval, filesystem entry, context offloading, and process delegation. This offers brokers higher capabilities throughout lengthy duties, permitting them to maintain monitor of subtasks, scale back context window utilization, and delegate work. With hooks, you’ll be able to rework non-deterministic AI conduct into predictable, secure, and ruled workflows by operating deterministic code at particular lifecycle checkpoints.
There’s no new useful resource kind or integration to undertake. You mechanically get each updates within the AgentCore harness you already use.
Strands capabilities, on AWS
Strands harness supplies an assembled agent basis with really useful directions, instruments, and context administration. Amazon Bedrock AgentCore harness operates that basis as a managed AWS service. The result’s a production-grade default agent that doesn’t require you to assemble and function the harness or its infrastructure your self.
You don’t want to provision compute, bundle and host the agent loop, handle session scaling, or function tool-execution infrastructure. Every session runs in a safe, kernel-isolated microVM in AgentCore runtime, a functionality of Amazon Bedrock AgentCore, with managed compute, scaling, and excessive availability.
AgentCore achieves this by connecting the harness to the providers required for manufacturing brokers, together with session persistence, streaming responses, utilization metadata, observability, AgentCore reminiscence, Identification, Gateway, Browser, Code Interpreter, and customer-provided containers. You keep management over the mannequin, directions, instruments, permissions, and lifecycle insurance policies whereas AgentCore manages the underlying execution surroundings.
A extra succesful managed harness
Harness now supplies a stronger expertise if you use its managed defaults:
- A present really useful mannequin. Whenever you omit the mannequin, Harness makes use of a really useful default mannequin that evolves as new fashions are launched, at all times retaining your harnesses updated. Express harness-level and per-invocation mannequin configurations proceed to take priority.
- Job-oriented directions. The managed system immediate encourages the agent to assemble related context, use acceptable instruments, proceed till the duty is resolved, adapt to failures or denied actions, and confirm its work earlier than reporting completion. The default system immediate improves over time to assist the newest harness conduct.
- Automated immediate caching. For supported fashions utilizing Converse on Amazon Bedrock, Harness caches the system immediate, instrument definitions, and dialog historical past. Repeated calls with the identical immediate and power floor can use lower-priced cache-read tokens, decreasing enter processing latency and value.
- Proactive context administration. By default, Harness summarizes older dialog turns whereas retaining current context as soon as the context window reaches a configurable threshold. Holding the context lean this manner helps Harness run at about 34% decrease token value than different main harnesses.
- Context offloading. Massive instrument outcomes might be moved out of the fast mannequin context. The agent receives a preview and may retrieve the whole end result when wanted, decreasing repeated context utilization with out dropping entry to the information.
- Planning throughout invocations. The
todo_writeinstrument maintains a structured process plan that may be restored in later invocations inside the identical session, together with after dialog summarization. - Targeted delegation. The
subagentinstrument delegates a self-contained process to a contemporary employee and returns the end result to the father or mother agent. The employee is inner to the invocation, not a individually managed harness useful resource, and shares invocation limits and your tool-call lifecycle hooks. - Internet retrieval. The
web_fetchinstrument retrieves content material from a specified webpage to provide your harness up-to-date exterior context. - Granular filesystem entry. With separate
learn,write, andeditinstruments, you’ll be able to grant solely the granular filesystem capabilities an agent wants.
Buyer-provided Mannequin Context Protocol (MCP) servers, AgentCore Gateway (a functionality of Amazon Bedrock AgentCore), Browser, Code Interpreter, inline capabilities, abilities, reminiscence, and customer-provided containers proceed to work via the prevailing harness interfaces.
Really useful by default, configurable when wanted
Harness manages its defaults in order that brokers utilizing them obtain the present AgentCore really useful expertise as fashions, directions, context administration, and built-in capabilities enhance.
Express configuration at all times takes priority:
- Configure a mannequin ID to maintain utilizing a particular mannequin.
- Configure
systemPromptto fully change the managed system immediate. - Configure
truncationto maintain a particular context-management coverage. - Listing particular person
allowedToolsselectors to take care of a hard and fast instrument floor.
When allowedTools is omitted or set to ["*"], Harness supplies the present really useful built-in instrument set. As a result of this set can achieve capabilities over time, functions with a hard and fast safety or functionality boundary ought to listing solely the instruments they want.
For instance, the next configuration permits read-only filesystem entry and internet retrieval with out granting shell entry or file modification:
Govern consequential actions with lifecycle hooks
With lifecycle hooks, you’ll be able to run your personal deterministic code at outlined factors within the agent loop. For instance, an AWS Lambda operate can enable or deny a request or a instrument name, and an Amazon Easy Notification Service (Amazon SNS) subject or Amazon EventBridge occasion bus can obtain a notification to file exercise or begin an asynchronous workflow.
Harness helps 4 lifecycle occasions:
| Occasion | When it runs | Impact of a Lambda denial |
before_invocation |
Earlier than the agent processes the request | Stops the invocation with hook_stopped |
before_tool_call |
After the mannequin proposes a instrument name and earlier than execution | Skips the instrument name. The agent loop continues |
after_tool_call |
After a instrument end result exists | Retains the end result and stops earlier than additional inference |
after_invocation |
After the invocation completes | Reviews the choice. Output already streamed can’t be retracted |
Solely Lambda hooks can change the agent loop. They run synchronously and return enable or deny, with an optionally available motive. SNS and Amazon EventBridge hooks are notifications and don’t block the agent loop.
For instance, a customer-support agent can examine an order by itself whereas a before_tool_call hook checks every refund towards an approval restrict earlier than the refund instrument runs. The next configuration attaches that Lambda operate to the harness:
The operate receives the proposed instrument name within the hook payload and returns a call:
When the operate denies the decision, the harness skips the refund and the agent continues, so it could possibly inform the shopper that the request was escalated. Every resolution additionally seems within the InvokeHarness response stream as a hookEvent:
Hooks additionally apply to subagents. When the agent delegates a process, every instrument name the subagent makes runs via the identical beforeToolCall and afterToolCall hooks, so delegation can’t bypass your refund coverage. The invocation-level hooks (beforeInvocation, afterInvocation) run as soon as for the entire invocation.
You configure hooks with CreateHarness or UpdateHarness. If a Lambda operate instances out or returns an error, the hook applies its failureMode, which defaults to disclaim. For timeouts, payload fields, and context limits, see Lifecycle hooks within the Amazon Bedrock AgentCore Developer Information.
To see each occasion and goal kind working collectively, attempt the Refund Desk pattern within the Amazon Bedrock AgentCore samples repository on GitHub. A six-step guided tour reveals all 4 lifecycle occasions and the AWS Lambda, Amazon SNS, and Amazon EventBridge targets. It additionally reveals validation of client-supplied inline operate outcomes and the distinction between failureMode deny and permit.
Run a multi-agent analysis coordinator with the AgentCore CLI
Making a harness takes a single command. You identify it and arrange the directions, context coverage, and limits you need. This instance creates a Analysis Coordinator: a harness with a task-oriented system immediate and summarization-based truncation. In a single invocation, it runs a researcher, a synthesizer, and a reviewer as subagents and returns one consolidated report. You get multi-agent orchestration and context administration with out provisioning infrastructure or wiring the delegation your self.
The agentcore harness instructions name the harness APIs instantly, so that you don’t want a CLI venture or a deployment step. Set up the AgentCore CLI, a functionality of Amazon Bedrock AgentCore, with npm:
The CLI makes use of your default AWS credentials. It has no --profile flag, so set the AWS_PROFILE surroundings variable in order for you a particular profile. Save the coordinator’s directions from the pattern as system_prompt.md in your working listing.
Create the harness
This command passes the coordinator’s system immediate, a summarization coverage that retains the 30 most up-to-date messages intact because the dialog grows, and limits excessive sufficient for the total workflow. As a result of it omits the mannequin, reminiscence, and execution position, the harness makes use of the present AgentCore really useful mannequin and managed reminiscence, and the CLI creates an execution position in IAM for you.
Creation is asynchronous. Anticipate creation to complete. The final command ought to print READY:
Ship the prompts
Invoke your harness with a brand new session ID. Begin with a primary query. The coordinator solutions it instantly, with out calling its subagents:
Then ask for a full analysis report in the identical session. The coordinator plans the work and delegates to the researcher, synthesizer, and reviewer so as. It runs at most one revision cycle if the reviewer asks for it, and delivers the ultimate report. Reusing the session ID continues the dialog in the identical surroundings.
With --prompt, the CLI prints the finished transcript as JSON when the flip finishes. The analysis run takes about 10 to fifteen minutes. To observe alongside as it really works, miss --prompt, and the CLI opens an interactive chat.
The identical instance in Python (boto3), together with the total system immediate, is offered within the AgentCore samples repository on GitHub.
Clear up
Delete the harness if you’re completed. This additionally deletes its managed reminiscence until you cross --delete-managed-memory false. The execution position that the CLI created stays in your account, so delete it within the IAM console for those who now not want it.
Rollout and compatibility
On November 11, AgentCore harness started rolling out the Strands harness-backed expertise to new and current harnesses. No buyer motion is required.
Configuration you explicitly present stays unchanged. Harnesses that omit the mannequin, system immediate, or truncation configuration, or use allowedTools: ["*"], obtain the upgraded managed defaults.
In case your software requires fastened conduct or a hard and fast functionality boundary, configure these settings explicitly.
Study extra
Create and invoke an AgentCore harness as you do in the present day. Use the managed defaults for the whole present really useful expertise, or configure particular person settings when your software requires fastened conduct.
We sit up for seeing what you construct with the upgraded AgentCore harness.
Concerning the authors

