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

Google has expanded the Gemini Interactions API with updates to Managed Agents, introducing support for background tasks, remote Model Context Protocol (MCP)…

By AI Maestro July 7, 2026 2 min read
Expanding Managed Agents in Gemini API:  background tasks, remote MCP and more

Google has expanded the Gemini Interactions API with updates to Managed Agents, introducing support for background tasks, remote Model Context Protocol (MCP) servers, and custom function calling.

These changes respond to developer feedback and allow users to build agents that operate reliably in production environments.

Managed Agents within the Gemini Interactions API now handle reasoning, code execution, package installation, file management, and web information retrieval inside an isolated cloud sandbox. Developers trigger these actions by calling a single endpoint.

To enable an AI coding agent, a human user must install the Interactions API skill using the following command:

npx skills add google-gemini/gemini-skills --skill gemini-interactions-api

Examples below use the @google/genai JavaScript SDK. Users working with Python or cURL should refer to the Antigravity agent documentation.

Build autonomous agents with expanded capabilities

Long-running background execution

Maintaining an open HTTP connection for extended tasks is often unstable. Developers can pass background: true to run interactions asynchronously on the server.

The API returns an ID immediately. Client applications can use this ID to poll for status, stream progress updates, or reconnect later while the agent finishes remotely. Further details are available in the background execution guide.

Remote MCP server integration

Developers no longer need to write custom proxy middleware to reach private databases or internal APIs. Managed Agents can now connect directly to remote Model Context Protocol servers.

This allows mixing remote tools with built-in sandbox capabilities. Passing an mcp_server tool at interaction time lets the agent communicate with endpoints from its secure sandbox alongside Google Search or code execution.

Users should follow best practices when extending agents with external tools and APIs.

Custom function calling alongside sandbox tools

Adding custom tools alongside built-in sandbox tools enables local execution. The API uses step matching to determine how tools run.

Built-in tools execute automatically on the server. Custom functions transition the interaction to requires_action, requiring the client to execute local business logic.

Network credential refresh

Access tokens and short-lived API keys expire over time. Users can refresh credentials or rotate keys by passing their existing environment_id with a new network configuration on the next interaction.

New rules replace old ones immediately. The sandbox retains its filesystem state, installed packages, and cloned repositories.

Get started with managed agents

These updates allow managed agents to function as asynchronous workers inside real development environments without blocking the application.

Users can explore custom agent definitions, environment configurations, network rules, and advanced streaming patterns via the Gemini Interactions API overview and the managed agents quickstart.

Scroll to Top