Gemini API Managed Agents: Background Tasks, Remote MCP and More
AI

Gemini API Managed Agents: Background Tasks, Remote MCP and More

In brief

Google has announced a significant expansion of Managed Agents in the Gemini API, introducing background execution, remote MCP server integration, custom function calling, and credential refresh capabilities. These updates directly respond to developer feedback and are designed to help teams build reliable, production-ready AI agents without managing complex infrastructure. For marketing and digital teams exploring AI-driven automation, these enhancements lower the barrier to deploying autonomous agents in real-world workflows.

Key points

  • Background execution is now supported via a simple 'background: true' parameter, allowing long-running agent tasks to run asynchronously on Google's servers without holding open a fragile HTTP connection, returning an interaction ID that clients can poll or stream later.
  • Managed Agents can now connect directly to remote Model Context Protocol (MCP) servers, enabling agents to access private databases and internal APIs without requiring developers to build custom proxy middleware.
  • Custom function calling can now be combined with built-in sandbox tools, with the API using step matching to automatically decide whether a tool runs server-side or requires the client to execute local business logic.
  • Network credential refresh is now supported, allowing developers to rotate expiring access tokens or short-lived API keys by passing an existing environment ID with an updated network configuration, while preserving the sandbox filesystem, installed packages, and cloned repositories.
  • All managed agent interactions run inside an isolated cloud sandbox where Gemini handles reasoning, code execution, package installation, file management, and web information retrieval through a single endpoint call.
  • The new capabilities are accessible via the Google GenAI JavaScript SDK, with Python and cURL support documented in the Antigravity agent documentation, lowering the integration effort across different development stacks.

Analysis

The introduction of background execution is arguably the most operationally significant update in this release. Before this capability, developers had to maintain persistent HTTP connections for any agent task that took more than a few seconds, a fragile and resource-intensive pattern that made production deployments unreliable. With asynchronous execution and a polling mechanism, teams can now integrate long-running agent jobs into workflows that span minutes or hours without risk of timeout failures or connection drops.

Remote MCP server integration fundamentally changes how managed agents interact with proprietary data sources. Instead of building and maintaining custom middleware layers to bridge the gap between an agent and internal APIs or private databases, developers can now pass an MCP server tool directly at interaction time. This approach also allows mixing remote tools with built-in capabilities such as Google Search or code execution, which means agents can simultaneously query a company's internal knowledge base and cross-reference public web information in a single interaction.

The step matching mechanism introduced for custom function calling reflects a mature approach to hybrid agent architectures. Not all business logic can or should run in a cloud sandbox, whether for compliance, latency, or data sensitivity reasons. By automatically routing built-in tools to server-side execution and transitioning to a 'requires_action' state for custom functions, the API gives developers fine-grained control without requiring them to redesign their entire orchestration layer.

Credential refresh without sandbox state loss addresses a critical pain point in agentic workflows that span multiple sessions or operate overnight. In previous setups, rotating an expired token often meant abandoning a session and restarting from scratch, losing any installed packages or intermediate file state. The ability to pass a new network configuration to an existing environment ID while preserving the sandbox state means agents can now operate continuously across token expiry cycles, which is essential for autonomous, long-horizon tasks.

Taken together, these four capabilities signal a clear maturation path for the Gemini API from a tool for short, stateless interactions to a platform capable of supporting persistent, autonomous agents that handle real production workloads. For marketing and digital teams, this matters because it makes agent-driven content workflows, data enrichment pipelines, and automated reporting systems significantly more viable to build and maintain at scale.

What to do

  • Audit your current AI agent workflows for any tasks that regularly exceed standard HTTP timeout windows and prioritize migrating those to the new background execution model using the 'background: true' parameter, then build a polling or streaming layer to surface results back to your application.
  • If your organization has internal data sources such as product databases, CRM systems, or proprietary analytics APIs, evaluate whether exposing them via a remote MCP server would allow your managed agents to access richer context, which would improve the accuracy and relevance of any agent-generated content or analysis.
  • Map out which of your custom business logic functions genuinely need to run client-side for compliance or sensitivity reasons, and redesign your agent tool definitions to take advantage of the step matching mechanism, keeping server-side execution for standard tasks and local execution only where strictly necessary.
  • Implement a proactive credential rotation strategy for any managed agents that operate continuously or overnight, using the environment ID carry-over feature to ensure sandbox state is preserved across token refresh cycles and avoiding costly session restarts.
  • Review the Gemini Interactions API documentation on best practices for extending agents with external tools and APIs before connecting to remote MCP servers, particularly around authentication scoping and least-privilege access to minimize security exposure.
  • Establish internal benchmarks for agent task reliability and execution time before and after adopting these new capabilities, so you can quantify the operational improvement and build a business case for scaling agent-driven workflows across more marketing and content functions.
Impact

As AI agents become core to content automation and data enrichment workflows, platforms that surface agent-generated outputs in search results will increasingly reward structured, reliable, and scalable agent architectures. Teams that adopt production-ready agent frameworks now will be better positioned to generate and refresh content at scale, which has direct implications for organic visibility and AI-generated answer coverage.

Official source
Never miss an update

Product news, algorithm updates and best practices, straight to your inbox.

Back to the tracker

Stay one step ahead of the algorithms

Pulsar tracks your Google rankings, your AI visibility and your social media in one dashboard. 14-day trial, no credit card required.

Start a free trial