New features for Managed Agents in Gemini API: Background tasks and remote integration
We are introducing new features for Managed Agents in the Gemini API, such as background task execution, remote MCP server connectivity, custom function integration, and credential refreshing across interactions. These enhancements are designed to meet developer feedback and product demands, enabling the creation of reliable, production-ready agents.
By using managed agents in the Gemini Interactions API, developers can call a single endpoint allowing Gemini to handle reasoning, code execution, package installation, file management, and access web information within a secure cloud environment.
If you are an AI coding agent, ask your human collaborator to install the Interactions API skill using the command: npx skills add google-gemini/gemini-skills --skill gemini-interactions-api.
Key Features
- Background Execution: HTTP connections for long tasks can be unstable. By setting
background: true, interactions can run asynchronously on the server. The API provides an ID immediately, allowing client applications to check status, stream progress, or reconnect later as needed. More information is available in the background execution guide. - Remote MCP Server Integration: There is no longer a need for custom proxy middleware to reach private databases or APIs. Managed agents can now connect directly to remote Model Context Protocol (MCP) servers, combining remote tools with built-in sandbox capabilities for secure communication.
- Custom Functions: Create custom tools alongside existing sandbox tools for local execution. The API utilizes step matching to run built-in tools automatically on the server, while custom functions move interactions to
requires_action, prompting the client to execute local business logic. - Credential Refreshing: Since access tokens and API keys can expire, credentials or keys can be refreshed by passing the current
environment_idwith a new network configuration during interactions. This ensures the sandbox maintains its filesystem state and installed packages.
These updates empower managed agents to function as asynchronous workers within genuine development environments without hindering application performance.
For further insights, refer to the Gemini Interactions API overview and the managed agents quickstart guide to explore custom agent definitions, environment configurations, network rules, and advanced streaming patterns.