Gemini API Managed Agents: 4 production features and how they compare to Bedrock AgentCore (2026)
Summary. On 7 July 2026 Google DeepMind expanded Managed Agents in the Gemini API with 4 capabilities aimed at production use: long-running background execution (background: true), remote Model Context Protocol (MCP) server integration, custom function calling alongside sandbox tools, and network credential refresh. Managed agents run inside the Gemini Interactions API, where a single endpoint handles reasoning, code execution, package installation, file management and web access inside an isolated cloud sandbox. The headline change is that a long task no longer needs an open HTTP connection: you pass background: true, the API returns an interaction ID immediately, and your client polls or reconnects later. The obvious point of comparison is Amazon Bedrock AgentCore, which meters 12 components and charges its Runtime at $0.0895 per vCPU-hour and $0.00945 per GB-hour in us-east-1 as of June 2026, with model inference often 50 to 70 percent of total agent spend. The two products solve the same problem, a managed place to run agents, with different bets: Gemini couples tightly to one model family behind one endpoint, while AgentCore is a model-agnostic, AWS-native set of services you assemble. This guide breaks down the 4 Gemini features at the API level, gives working code patterns, and lays out when each platform is the right call for a production team.
"These updates turn managed agents into asynchronous workers that operate inside real development environments without blocking your application," wrote Philipp Schmid, Developer Relations Engineer at Google DeepMind, and Mariano Cocirio, Product Manager at Google DeepMind, in the launch post.
What "Managed Agents in the Gemini API" actually is
Managed Agents are part of the Gemini Interactions API. You call one endpoint, and Gemini handles the agent loop for you: reasoning, running code, installing packages, managing files, and pulling web information inside an isolated cloud sandbox. That is the difference from a raw chat-completions call. With a plain model call you own the loop, the tool execution, and the sandbox. With managed agents, Google runs the sandbox and the loop, and you send instructions and read results.
That design decision matters for a platform team. It removes the work of provisioning and securing an execution environment, and it removes the glue code that keeps a model, a tool runner, and a file system in sync. It also hands control of that environment to Google, which is exactly the trade a team has to weigh. The four July 2026 additions all push managed agents from a demo-friendly feature toward something you can run in production without holding a request open or hand-rolling proxies.
The examples below use the @google/genai JavaScript SDK, the SDK Google shows in its own launch material. Python and cURL equivalents live in the Antigravity agent documentation. Treat the snippets here as the shape of each call; confirm exact signatures against the official managed agents quickstart before you ship.
The 4 new capabilities, at the API level
1. Long-running background execution
Holding an HTTP connection open for a multi-minute agent task is fragile: load balancers time out, mobile networks drop, and a redeploy kills every in-flight request. Google's fix is a background: true flag. Pass it and the interaction runs asynchronously on the server. The API returns an ID immediately, and your client uses that ID to poll for status, stream progress, or reconnect later while the agent keeps working remotely.
// Start a long-running interaction in the background
const started = await ai.interactions.create({
agent: myAgentId,
input: "Refactor the repo's test suite and open a summary.",
background: true, // returns immediately with an interaction ID
});
// Later, from any client, poll by ID
const status = await ai.interactions.get({ interaction: started.id });
// status.state moves through running -> requires_action / completed
This is the change that makes managed agents usable behind a normal web or mobile app. The app fires the task, stores the interaction ID, and shows progress from a poll or a stream rather than blocking a request thread for minutes.
2. Remote MCP server integration
Agents earn their keep when they touch your data. Before this release you wrote proxy middleware to expose a private database or an internal API to the agent. Now you connect a managed agent directly to a remote Model Context Protocol (MCP) server by passing an mcp_server tool at interaction time, alongside built-in tools like Google Search or code execution. The agent talks to your endpoint from inside its secure sandbox.
const result = await ai.interactions.create({
agent: myAgentId,
input: "Summarize this quarter's overdue invoices.",
tools: [
{ mcp_server: { url: "https://mcp.internal.example.com", auth: "..." } },
{ code_execution: {} }, // mix remote tools with built-in ones
],
});
MCP has become the common protocol for connecting agents to tools, so a first-party remote-MCP path removes a whole category of custom integration code. Google also publishes security best practices for extending an agent with external tools, which you should read before you point an autonomous agent at a production database.
3. Custom function calling alongside sandbox tools
You can add custom tools next to the built-in sandbox tools, and the API resolves them with step matching. Built-in tools (code execution, search) run automatically on the server. A custom function instead transitions the interaction to a requires_action state, which hands control back to your client to run local business logic, then you return the result and the agent continues.
if (status.state === "requires_action") {
const call = status.required_action.function_call;
const output = await runLocally(call.name, call.args); // your business logic
await ai.interactions.submit({
interaction: status.id,
function_output: output,
});
}
The split is the useful part: server-side tools stay fast and hands-off, while anything that must run in your own trust boundary, a payment call, a write to your ledger, stays on your side.
4. Network credential refresh
Access tokens and short-lived API keys expire mid-task. You refresh them by passing your existing environment_id with a new network configuration on the next interaction. The new rules replace the old ones immediately, and the sandbox keeps its filesystem state, installed packages and cloned repositories intact. For a long-running agent that authenticates to several internal services, this is the difference between a clean key rotation and a restarted job.
Gemini Managed Agents vs Amazon Bedrock AgentCore
Both products give you a managed place to run agents with an isolated sandbox, code execution, web or browser access, and tool integration over MCP. The differences are architectural and commercial.
Gemini Managed Agents are one endpoint tied to the Gemini model family, with the agent loop and sandbox run by Google. Amazon Bedrock AgentCore is a set of AWS services, Runtime, Browser, Code Interpreter, Gateway, Identity, Memory, Observability, Evaluations and more, that you compose, and it is model-agnostic within the AWS ecosystem. AgentCore is metered across 12 components with consumption-based pricing and no minimum fees; its Runtime bills at $0.0895 per vCPU-hour and $0.00945 per GB-hour in us-east-1 as of June 2026, and across most production agents model inference is the largest line at 50 to 70 percent of spend.
| Vector | Gemini Managed Agents (Interactions API) | Amazon Bedrock AgentCore |
|---|---|---|
| Model coupling | Gemini family, one endpoint | Model-agnostic within AWS Bedrock |
| Surface | Single managed endpoint and sandbox | 12 composable services (Runtime, Gateway, Memory, etc.) |
| Async long tasks |
background: true with poll or reconnect |
Runtime sessions, async invocation |
| Remote tools | Remote MCP server tool at interaction time | Gateway plus MCP-style tool access |
| Enterprise networking | Managed sandbox, credential refresh via environment_id | VPC PrivateLink, IAM, CloudFormation |
| Pricing shape | Gemini API token pricing, managed loop | Per-component metering; Runtime $0.0895/vCPU-hour, $0.00945/GB-hour |
| Best fit | Fast path to one managed agent on Gemini | Assembled, governed agents inside AWS |
The honest read: neither is strictly better. Gemini Managed Agents get you to a working, production-shaped agent faster because there is one endpoint and Google runs the environment. AgentCore gives you more control, model choice, and AWS-native networking and identity, at the cost of assembling and paying for more parts. A team already standardised on AWS with IAM and VPC requirements will lean AgentCore; a team that wants the shortest path to a Gemini-powered background worker will lean Gemini. For a broader view of the trade, our guide to enterprise AI agents in production and the walkthrough on how to build an AI agent on Amazon Bedrock AgentCore cover the AWS side in depth.
A production build pattern
Here is the pattern most teams will actually ship: a user action starts a background agent, the app stores the interaction ID, and a worker polls until the agent either finishes or asks for a local action.
// 1. Kick off in the background, persist the ID
const job = await ai.interactions.create({
agent: myAgentId,
input: userRequest,
background: true,
tools: [{ mcp_server: { url: internalMcpUrl, auth: token } }],
});
await db.save({ jobId: job.id, userId, state: "running" });
// 2. A worker polls and handles requires_action
async function tick(jobId) {
const s = await ai.interactions.get({ interaction: jobId });
if (s.state === "requires_action") {
const c = s.required_action.function_call;
const out = await runLocally(c.name, c.args);
await ai.interactions.submit({ interaction: jobId, function_output: out });
}
return s.state; // "completed" ends the loop
}
Three engineering notes. First, persist the interaction ID durably; it is your only handle on a task that outlives the request. Second, put the poll on a queue or scheduler, not a tight loop, and back off as tasks run longer. Third, keep every write that matters, payments, ledger updates, irreversible actions, on the requires_action path so they run inside your trust boundary rather than the agent's sandbox. This mirrors advice we give in our comparison of production AI agent frameworks: the model plans, but your code commits.
Cost and operational trade-offs
The pricing shapes differ in a way that changes architecture. AgentCore meters infrastructure directly, so a long-running or memory-heavy agent shows up as vCPU-hours and GB-hours you can forecast and optimise, and its Runtime at $0.0895 per vCPU-hour rewards short, bursty sessions over always-on ones. Gemini Managed Agents fold the sandbox into the managed service and bill you on Gemini API terms, so your cost tracks tokens and interactions rather than a vCPU meter you tune. On both platforms, model inference dominates, often 50 to 70 percent of total agent spend, so the first cost lever is model selection and prompt design, not the runtime.
Background execution also changes the failure model. An async job that runs for minutes needs idempotent restarts, a dead-letter path for stuck interactions, and observability on the interaction ID, not just the HTTP request. Teams that skip this ship agents that silently hang. Our write-up on OpenAI's agent platform decision makes the same point from a different vendor: the sync-versus-async choice is an architecture decision, not a config flag.
India and data-residency considerations
For Indian teams, the managed-sandbox model raises two questions. First, where does the sandbox run, and does that satisfy your data-residency posture? A managed agent that installs packages, clones repositories and calls internal MCP servers is processing your data in a cloud region you should confirm. Second, when an agent touches personal data, the Digital Personal Data Protection Act, 2023 (DPDP) applies to that processing regardless of which vendor runs the loop. Consent, purpose limitation and audit logging belong in the agent's design, and the requires_action boundary is a natural place to enforce them, because that is where your own code, and your own compliance controls, run. Design applications aligned with DPDP requirements from the first interaction rather than retrofitting them after a pilot.
FAQ
What are Managed Agents in the Gemini API?
Managed Agents are part of Google's Gemini Interactions API. You call one endpoint, and Gemini runs the agent loop, reasoning, code execution, package installation, file management and web access, inside an isolated cloud sandbox. Google manages the environment and the loop, so you send instructions and read results instead of hosting your own agent runtime.
What did Google add on 7 July 2026?
Google DeepMind added four capabilities: long-running background execution via a background: true flag, direct connection to remote MCP servers, custom function calling alongside built-in sandbox tools, and network credential refresh. Together they let managed agents run as asynchronous workers in real environments without holding an HTTP connection open or writing custom proxy middleware.
How does background execution work?
You pass background: true when creating an interaction. The API runs it asynchronously on the server and returns an interaction ID immediately. Your client uses that ID to poll for status, stream progress, or reconnect later while the agent finishes remotely. This removes the fragile pattern of holding one HTTP connection open for a multi-minute task.
How is this different from Amazon Bedrock AgentCore?
Gemini Managed Agents are one endpoint tied to the Gemini model family, with Google running the sandbox. Bedrock AgentCore is a model-agnostic set of AWS services you compose, metered across 12 components, with Runtime at $0.0895 per vCPU-hour in us-east-1 as of June 2026. Gemini is faster to start; AgentCore gives more control and AWS-native networking.
What is remote MCP support, and why does it matter?
Remote MCP support lets a managed agent connect directly to a remote Model Context Protocol server by passing an mcp_server tool at interaction time, alongside built-in tools. It removes the custom proxy middleware teams previously wrote to expose private databases or internal APIs to an agent, and it uses the common protocol most agent tools now speak.
Which languages and SDKs does it support?
Google's launch examples use the @google/genai JavaScript SDK. Python and cURL equivalents are documented in the Antigravity agent documentation. The managed agents quickstart covers custom agent definitions, environment configuration, network rules, and advanced streaming patterns, and it is the reference to confirm exact method signatures before shipping.
How much does it cost to run agents on these platforms?
Bedrock AgentCore uses consumption-based pricing with no minimums; Runtime bills at $0.0895 per vCPU-hour and $0.00945 per GB-hour in us-east-1 as of June 2026. Gemini Managed Agents bill on standard Gemini API terms. On both, model inference is usually the largest cost, often 50 to 70 percent of total agent spend.
Does DPDP apply when an agent processes Indian users' data?
Yes. The Digital Personal Data Protection Act, 2023 applies to processing of personal data regardless of which vendor runs the agent loop or where the managed sandbox executes. Build consent capture, purpose limitation and audit logging into the agent, and use the requires_action boundary to enforce controls inside your own trust boundary.
How eCorpIT can help
eCorpIT is a Gurugram-based senior engineering organisation, certified for CMMI Level 5, MSME and ISO 27001:2022, that builds and operates production AI agents for Indian and global clients. We help teams choose between managed runtimes like Gemini Managed Agents and Amazon Bedrock AgentCore, design the background-execution and human-in-the-loop patterns, wire remote MCP servers to internal systems safely, and engineer agents aligned with DPDP Act, 2023 requirements. If you are moving an agent from prototype to production, talk to our engineering team about an architecture and cost review.
References
- Expanding Managed Agents in Gemini API: background tasks, remote MCP and more (Google, The Keyword)
- Managed Agents in Gemini API documentation (Google AI for Developers)
- Gemini Interactions API overview (Google AI for Developers)
- Background execution guide (Google AI for Developers)
- Antigravity agent documentation (Google AI for Developers)
- Managed agents quickstart (Google AI for Developers)
- Model Context Protocol (MCP) specification
- Amazon Bedrock AgentCore pricing (AWS)
- Amazon Bedrock AgentCore Runtime, Browser, Code Interpreter, VPC PrivateLink and CloudFormation support (AWS What's New)
- Amazon Bedrock AgentCore pricing: 12 components breakdown (Cloud Burn)
- Digital Personal Data Protection Act, 2023 (MeitY)
Last updated: 27 July 2026.
Top comments (0)