Expanding Managed Agents in Gemini API: background tasks, remote MCP and more

Google DeepMind has announced a significant expansion of its Gemini API, introducing a suite of new capabilities designed to transform "Managed Agents" from simple conversational interfaces into autonomous, production-ready workers capable of handling complex, long-duration tasks. This update, spearheaded by Developer Relations Engineer Philipp Schmid and Product Manager Mariano Cocirio, introduces four pivotal features: background execution for asynchronous interactions, remote Model Context Protocol (MCP) server integration, custom function calling within sandboxed environments, and the ability to refresh network credentials across ongoing interactions. These enhancements represent a strategic shift in the AI landscape, moving away from stateless request-response models toward persistent, stateful agentic workflows that can operate within isolated cloud sandboxes.
The core of this update resides in the Gemini Interactions API, a specialized framework that allows developers to call a single endpoint while the model handles the heavy lifting of reasoning, code execution, package installation, and file management. By providing a managed, secure environment, Google aims to lower the barrier to entry for developers building sophisticated AI agents that require more than just text generation. The "Antigravity" agent, which serves as the foundational model for these managed interactions, is now equipped to function as a background worker, bridging the gap between human-led prompting and fully autonomous software execution.
The Shift to Asynchronous AI: Background Execution
One of the most critical challenges in deploying AI agents for real-world tasks has been the fragility of standard HTTP connections. Traditional API calls require a persistent connection; if a task takes several minutes—such as cloning a massive repository, analyzing thousands of lines of code, or scraping multiple websites—the connection often times out, leading to lost progress and developer frustration.
To resolve this, Google DeepMind has introduced background execution. By passing a specific parameter in the API request, developers can now trigger interactions that run asynchronously on Google’s servers. Upon initiation, the API immediately returns a unique Interaction ID. This allows client applications to disconnect and later poll for status, stream progress updates, or reconnect once the agent has completed its mission. This capability is essential for "long-haul" agentic tasks, such as generating comprehensive markdown reports from complex source code or performing deep-dive data analysis that involves multiple steps of reasoning and execution.
Bridging Private Data and Public Models: Remote MCP Integration
In a move that signals a commitment to industry standards and interoperability, Google has integrated support for the Model Context Protocol (MCP). Originally introduced as an open standard to allow AI models to securely access data from various sources, MCP acts as a universal bridge between AI agents and private databases, internal APIs, or specialized software tools.
Previously, developers were often forced to write custom proxy middleware to allow a cloud-hosted model to talk to a private internal server. This added layers of latency, security risk, and maintenance overhead. With the new remote MCP server integration, managed agents in the Gemini API can connect directly to these servers from within their secure sandbox. This allows an agent to, for example, query an internal company telemetry server to investigate latency spikes and then correlate that data with recent Git commits—all without the developer needing to build a bespoke integration layer. This "mix and match" approach allows built-in Google tools, such as Google Search and native code execution, to work in tandem with a company’s proprietary internal data streams.
Hybrid Tooling: Custom Function Calling and Sandbox Logic
The update also refines how agents interact with local environments through custom function calling. In many development scenarios, an agent needs to perform some tasks in the cloud (like running a Python script in a sandbox) and other tasks on the client side (like accessing a local file system or a specific user-side API).
Google’s new implementation uses "step matching" to manage this hybrid workflow. When an agent is invoked with a mix of built-in sandbox tools and custom functions, the Gemini API automatically handles the server-side execution. If the model determines that a custom function is required, it transitions the interaction to a "requires_action" state. This hands control back to the client application to execute local business logic. Once the client provides the result, the agent resumes its work in the cloud. This seamless handoff ensures that agents can maintain a high degree of autonomy while still being able to "reach out" to the local environment when necessary.
Maintaining Persistence: Network Credential Refresh
Long-running agents often encounter a practical hurdle: security tokens and API keys expire. In a standard session, an expired token would terminate the agent’s progress, requiring a full restart of the environment. Google has addressed this by allowing developers to refresh network credentials without losing the agent’s state.
By passing an existing environment_id along with a new network configuration, developers can rotate keys or refresh access tokens mid-stream. Crucially, the agent’s sandbox—including its filesystem state, any installed libraries, and cloned repositories—remains intact. This feature is particularly vital for enterprise applications where security policies dictate short-lived credentials, ensuring that an agent can work for hours or even days on a complex project without being hampered by authentication timeouts.

Chronology and Context: The Path to Managed Agency
The release of these features marks a clear trajectory in Google’s AI strategy. Since the debut of Gemini 1.0, Google has focused on increasing the model’s "actionability."
- Late 2023: Introduction of basic function calling and Gemini 1.0 Pro.
- Early 2024: Launch of Gemini 1.5 Pro with its massive context window, enabling the processing of entire codebases.
- Mid 2024: Introduction of native code execution, allowing the model to write and run Python code to solve math and logic problems.
- Late 2024: The preview of "Managed Agents" (Antigravity), moving the execution into persistent, isolated cloud environments.
- Early 2025: The current expansion, adding the infrastructure (background tasks, MCP, credential rotation) required for production-scale deployment.
This timeline shows a transition from "Chatbot" to "Copilot" and finally to "Agent." While early versions of Gemini were designed to assist a human in real-time, the current iteration is designed to work independently, checking in only when it requires human intervention or local data.
Technical Analysis: Security and Isolation
A recurring theme in the DeepMind announcement is the use of "isolated cloud sandboxes." This is a critical security feature. When an agent executes code or installs packages, it does so in a containerized environment that is wiped after the session or managed through a specific environment_id.
The use of network allowlists further enhances this security model. Developers must explicitly define which domains the agent is allowed to contact. By combining these allowlists with the new credential refresh feature, Google provides a framework where an agent can securely interact with the open web or private APIs without the risk of data exfiltration or unauthorized access common in less controlled agentic environments.
Market Implications and the AI Developer Landscape
Google’s move directly addresses the growing "AI Coding Agent" market, currently contested by startups like Cognition (Devin) and established players like GitHub (Copilot Workspace) and OpenAI. By offering these capabilities via an API, Google is positioning itself as the infrastructure provider for the next generation of AI startups.
The inclusion of the npx skills command for AI coding agents is a meta-commentary on the current state of the industry. Google is essentially providing "skills" that other AI agents can use to empower themselves. This suggests a future of multi-agent ecosystems where one agent (perhaps running locally) calls upon a "Managed Agent" in the Gemini API to perform high-compute or high-complexity tasks in a secure cloud environment.
Industry analysts suggest that the adoption of MCP is particularly noteworthy. By supporting a protocol also championed by competitors like Anthropic, Google is acknowledging that the future of AI is not a walled garden. Interoperability will be the key to enterprise adoption, as companies are unlikely to commit to an AI provider that cannot easily talk to their existing infrastructure.
Broader Impact and Future Outlook
The expansion of Managed Agents in the Gemini API signals the end of the "prompt engineering" era and the beginning of the "agentic architecture" era. Success is no longer just about writing the perfect prompt; it is about designing the right environment, network rules, and toolsets for an AI to operate within.
As these agents become more autonomous, the focus will likely shift toward "Agentic Governance"—monitoring what these background workers are doing, how much they are costing, and ensuring they remain within the bounds of their intended logic. With the foundation of background execution and remote data access now in place, the next step for Google DeepMind will likely involve more sophisticated orchestration, allowing multiple managed agents to collaborate on a single environment to solve even more complex engineering challenges.
For now, the message to developers is clear: the Gemini API is no longer just a place to get answers; it is a platform to deploy workers. These updates provide the reliability and persistence required to move AI agents out of the experimental sandbox and into the core of the modern software development lifecycle.






