Amazon Bedrock Managed Agents Tutorial: Run OpenAI Agents Inside Your AWS Account

Introduction

Amazon Bedrock Managed Agents, powered by OpenAI, lets you run agents built on OpenAI models entirely inside your own AWS account, under the IAM roles and audit controls you already operate. This tutorial is for developers and platform engineers who already run workloads on AWS and want to evaluate the preview without handing a second vendor a separate API key, a separate permission system, and a separate audit trail. You will set up the preview in one of its three supported Regions, choose an execution environment for tool runs, configure a first agent session with skills and tools, gate consequential actions behind human approval, and audit the result in CloudTrail.

Quick answer

Amazon Bedrock Managed Agents runs OpenAI model agents inside your AWS account in public preview: Bedrock hosts the agent loop and inference, IAM credentials replace the OpenAI API key, and tools run on AgentCore Runtime or your own compute.

Evidence

AWS announced the public preview on September 29, 2026, and restated it in the AWS Weekly Roundup of October 5, 2026, which describes the service as built on “a customized version of OpenAI’s Agents API engineered to be AWS-native and integrated with AWS resources.” The AWS What’s New announcement adds the operating detail that matters most for platform teams: “You can now build agents optimized for OpenAI models that run entirely inside AWS with the identities, permissions, and governance controls you already use.”

Two numbers from the same October 5 roundup help you pick a model for the pilot. OpenAI’s GPT-6.1 Sol, newly added to Bedrock, approaches GPT-6 Astra across demanding evaluations at roughly one-fifth of the cost, according to OpenAI, which makes it the natural default for a cost-sensitive evaluation. For speed-sensitive work, GPT-6 Astra UltraFast mode delivers up to 6x faster inference in the API, with up to 300 tokens per second, according to the same roundup. Both figures are vendor claims about the models, not about Managed Agents itself, so treat them as selection guidance and measure your own task latency before committing.

The scope of the preview is equally concrete. The What’s New announcement states that during preview there is no additional charge for Bedrock Managed Agents beyond the underlying AWS resources your agents consume, and that pricing is subject to change at general availability. The preview runs in US East (N. Virginia), US West (Oregon), and US East (Ohio) only. OpenAI’s own comparison page for the service, Bedrock Managed Agents in the OpenAI API docs, draws the boundary in one table: with the OpenAI Agents API, the agent loop is managed by OpenAI and authentication uses an OpenAI project API key, while with Bedrock Managed Agents, the loop is hosted in Amazon Bedrock and authentication uses AWS IAM credentials with SigV4 signing. If you already build with the OpenAI Agents API, the companion OpenAI Agents API tutorial explains the hosted loop, session state, and approval handling on the OpenAI side, which makes the differences in this tutorial easier to see.

Prerequisites

  • An AWS account with access to one of the three preview Regions: us-east-1, us-east-2, or us-west-2.
  • Permission to create IAM roles and policies in that account, or a platform team willing to create one role per agent for you.
  • A supported OpenAI model enabled for your account in your chosen Region. Model availability varies by Region and account, so verify before you build.
  • An execution environment decision: Amazon Bedrock AgentCore Runtime, or self-hosted compute such as a development machine, container, or existing compute environment.
  • A single, narrow pilot task with a measurable outcome, for example triaging a folder of support documents into a summary file, not an open-ended “help the team” agent.
  • Familiarity with AWS IAM basics and with the MCP server concepts if you plan to connect external tools through MCP servers.

Step-by-step guide

Step 1: Pick a Region and confirm preview access

Start in US East (N. Virginia), US East (Ohio), or US West (Oregon). These are the only three Regions AWS lists for the preview as of October 28, 2026. Confirm two things before writing any code: that Bedrock Managed Agents is available in your account in that Region, and that your chosen model is available there too. An endpoint existing in a Region does not guarantee that every model is available to your account in that Region, so this check saves a debugging session later. Record the Region in your pilot notes, because the session runs in the Region of its execution environment, and moving Regions later means reconfiguring rather than flipping a switch.

Step 2: Create one IAM role per agent

Create a dedicated IAM role for the pilot agent, and grant it only the permissions the pilot task needs. This is not boilerplate advice: the What’s New announcement states that each agent operates with its own IAM role, so the role is the permission boundary for everything the agent does. If the pilot only reads documents from one bucket and writes a summary file to another, the role should allow exactly those two actions on exactly those two buckets, nothing else. Keep a second, separate role for any later production agent, and never reuse the pilot role for a task with wider access. When the pilot ends, deleting the role is part of cleanup, and a role per agent makes that deletion safe.

Step 3: Choose the execution environment

Decide where the agent’s tools run. Bedrock manages the conversation, calls the model, and picks tools, but the tools themselves run on compute you provide. AgentCore Runtime gives you managed runtime sessions with configurable storage in your AWS account, and it is the lower-effort choice for most pilots. Self-hosted compute fits when tools must reach something managed compute cannot, such as a development machine, an existing container, or an internal environment. Amazon Bedrock AgentCore Runtime sessions isolate each session in its own environment and preserve context across messages within the session, which matches the durable-session behavior Managed Agents promises. Choose one environment for the pilot and document the reason, because the choice changes networking, storage, and cleanup.

Step 4: Define the session: instructions, tools, and skills

A session is the unit of work: it carries the model, the instructions, the tools, the IAM role, and the execution environment. Write instructions as a short, testable brief: the task, the allowed tools, the output format, and the stop conditions. Add reusable skills only for specialized procedures the agent will repeat, such as a report format or a triage rubric, and keep each skill to one procedure so you can tell which skill caused a bad output. Connect tools through MCP servers only where the pilot genuinely needs an external system, because every tool is a permission and a failure mode, not just a capability. Before the first run, read the instructions aloud and ask whether a competent colleague could execute them without asking you a question. If not, the agent will guess, and the guess will be the bug you debug later.

Step 5: Run the first task and require human approval

Send the pilot task as a first message to the session, then watch the full trace: messages, tool calls, and intermediate results. The durable session keeps this history so you can return later, add information, and continue from the progress already made, which is the feature that separates a managed agent from a single model call. For the first run, enable human approval before consequential actions, and define “consequential” narrowly for the pilot: any write outside the designated output location, any external call, and any action that cannot be undone. Approve or reject each gated action yourself during the pilot, and log which approvals you granted and why. An approval log from a pilot is the evidence your platform team needs to set the approval policy for the next agent.

Step 6: Audit the run in CloudTrail

After the run, review the supported API activity recorded in AWS CloudTrail for the session, and compare it against the agent’s own trace. The two records answer different questions: the agent trace shows what the agent thought it did, while CloudTrail shows which AWS API calls actually happened under the agent’s IAM role. Look for three things: calls outside the intended scope, calls to Regions or services the pilot never needed, and repeated calls that suggest a retry loop. If you find a call the instructions did not authorize, the fix belongs in the IAM policy or the instructions, not in a post-hoc filter. Keep the CloudTrail excerpt with the pilot notes, because it is the artifact that turns “the agent seemed fine” into “the agent did only this.”

Step 7: Decide, then clean up deliberately

End the pilot with a written verdict: continue to a second task, change one variable and rerun, or stop. Then clean up in this order: end the session, delete any files the agent wrote outside your durable record, and remove the pilot IAM role if it will not be reused. Remember that ending a session does not automatically delete files the agent stored in your own buckets or hosts, so check those locations explicitly. Preview features and APIs can change before general availability, so record the date of your pilot and the behavior you observed, and re-check the AWS documentation before building on the same assumptions again. For a broader automation picture, the n8n complete guide shows how managed agents compare with workflow automation when the task is a repeatable pipeline rather than an open-ended agent job.

Troubleshooting

The preview is not available in my Region

You are almost certainly outside the three preview Regions, or your account has not been enabled for the preview there. Confirm that you are working in us-east-1, us-east-2, or us-west-2, and that your chosen model is available to your account in that Region. Moving to a supported Region is the fix, not changing the endpoint or the credentials, because the service simply does not run elsewhere during the preview.

My OpenAI Agents API example fails against Bedrock

Do not port the example line by line. OpenAI states that shared agent and session concepts do not imply identical API contracts or feature availability, and the two services differ in endpoint, authentication, execution environment, and supported models. Rebuild the example against the current AWS guidance for the Bedrock endpoint, supported models, tools, and environment configuration, and authenticate with AWS IAM credentials using SigV4 signing instead of an OpenAI project API key. The most common porting error is keeping the OpenAI endpoint or key, which fails authentication before any agent logic runs.

The agent calls tools I never intended it to use

Narrow the tool set first, then the instructions, then the IAM policy, in that order. Remove every MCP server and tool the pilot task does not need, because an available tool is an invitation the model will accept under uncertainty. Rewrite instructions to name the allowed tools explicitly, and confirm the IAM role allows only the actions those tools require. If the agent still reaches for an unlisted tool, that is a signal the instructions are ambiguous, not that the model is misbehaving.

A gated action was approved but should not have been

Treat this as a policy defect, not a one-off mistake. Review the approval log from the pilot run and ask what information the approver lacked at decision time. Common causes are vague action descriptions, missing context about the target resource, and approval fatigue from too many trivial gates. Fix it by gating fewer, genuinely consequential actions, and by requiring the agent to state the target resource and the effect of the action in the approval request itself.

Costs or behavior change after the preview ends

This is expected, not a bug. AWS states that preview pricing ends at general availability and is subject to change, and preview features and APIs can change too. Before the preview ends, record your pilot’s resource consumption by service, not just the total, so you can re-price it under the general availability terms when they appear. Do not present preview costs to finance as a committed rate, and schedule a re-check of the AWS documentation at general availability as a dated task.

FAQ

See the front matter FAQ entries for the most common questions about availability, Regions, authentication, code reuse, execution environment choice, and session data.

Conclusion

Bedrock Managed Agents is worth a pilot for any AWS-centered team that wants OpenAI model agents without a second permission system: the agent loop and inference live in Bedrock, each agent gets its own IAM role, sessions are durable, and CloudTrail records what actually happened. Its limits are just as clear: three US Regions, public preview status, API-driven setup, and pricing that will change at general availability. Run one narrow task, gate the consequential actions, audit the CloudTrail record, and let that evidence decide whether the service earns a second pilot. For the OpenAI-native comparison, read the OpenAI Agents API tutorial next, and for the MCP tooling behind agent tools, read the MCP server tutorial.

Frequently asked questions

Is Amazon Bedrock Managed Agents generally available?

No. As of October 28, 2026, it is in public preview, which AWS announced on September 29, 2026. During the preview there is no additional charge for the service beyond the AWS resources your agents consume, but AWS states that pricing is subject to change at general availability, so do not build a production cost model on preview pricing.

Which AWS Regions support Bedrock Managed Agents?

Three US Regions: US East (N. Virginia, us-east-1), US West (Oregon, us-west-2), and US East (Ohio, us-east-2). Model availability can vary by Region and account, so confirm that your chosen model is available in your Region before you design around it.

Do I need an OpenAI API key to use Bedrock Managed Agents?

No. Authentication uses AWS IAM credentials with SigV4 signing, not an OpenAI project API key. That is the central difference from the OpenAI Agents API: the agent loop and model inference both run inside Amazon Bedrock, under the identities and governance controls you already use in AWS.

Can I reuse my OpenAI Agents API code unchanged?

Not safely. OpenAI warns that shared concepts do not imply identical API contracts or feature availability. The agent and session concepts carry over, but the endpoint, authentication, execution environment, and supported models differ, so check the current AWS guidance for the Bedrock endpoint, supported models, tools, and environment configuration before adapting any example.

Should I choose AgentCore Runtime or self-hosted compute for tool execution?

Choose AgentCore Runtime when you want managed runtime sessions with configurable storage in your AWS account and the least operational work. Choose self-hosted compute when you already run a development machine, container, or compute environment that tools must reach, such as an internal system that managed compute cannot access.

What happens to my data when a session ends?

A durable session retains messages, tool calls, and intermediate results so work can resume later, but session state is not a permanent archive. Treat files your agent writes to your own buckets or hosts as your durable record, review what a session stored before you delete it, and confirm the retention behavior in the current AWS documentation before relying on it for compliance.

TP
ToolPilot Team

We install, break, and fix automation tools so you don't have to. Every tutorial on ToolPilot is tested hands-on before publishing.

Keep reading