Quick answer: Google announced new Managed Agents in Gemini API capabilities on July 7, 2026: background execution for long-running interactions, remote MCP server integration, custom function calling, and credential refresh across interactions. For developers, the practical takeaway is simple: Gemini agents can now run more like asynchronous workers inside remote environments instead of fragile one-request demos.
Best immediate use case: long-running coding, data analysis, research, QA, internal-tool and operations workflows where an agent needs to use files, install packages, call tools, reconnect later, or talk to approved MCP endpoints.
Copy-paste implementation checklist
- Start with Interactions API: Managed Agents are used through Gemini Interactions API, not a plain one-shot text generation pattern.
- Use background execution for slow jobs: add
background: truewhen the task may outlive an HTTP request. - Store the interaction ID: save the returned ID in your database, queue, or job table so your app can poll or reconnect later.
- Use remote MCP only for trusted endpoints: expose the minimum toolset needed and follow Google’s security guidance.
- Separate built-in sandbox tools from local business logic: custom functions may require your client to execute an action and send results back.
- Plan credential refresh: if tokens expire, pass the existing
environment_idwith refreshed network configuration on the next interaction. - Log agent steps: keep step timelines for debugging, audits, retries and safety review.
- Do not move production workloads blindly: test quotas, pricing, network rules, timeout behavior and data-handling requirements first.
What changed in Google’s July 2026 Managed Agents update?
According to Google’s announcement, Managed Agents in Gemini API now add four developer-focused capabilities: background execution, remote MCP server integration, custom function calling and refreshed credentials across interactions. Google describes Managed Agents through the Gemini Interactions API as a single endpoint where Gemini can handle reasoning, code execution, package installation, file management and web information inside an isolated cloud sandbox.
| Feature | What it means | Useful for |
|---|---|---|
| Background execution | Run an interaction asynchronously and retrieve status/results later. | Long code analysis, reports, crawls, QA jobs, data tasks. |
| Remote MCP server integration | Connect a managed agent to approved remote Model Context Protocol servers. | Internal telemetry, private APIs, controlled enterprise tools. |
| Custom function calling | Mix built-in sandbox tools with client-side business functions. | Weather, CRM, inventory, billing, support or internal database actions. |
| Credential refresh | Reuse an environment while replacing expired network credentials. | OAuth tokens, short-lived API keys, private cloud access. |
Starter pattern 1: background task
Use this pattern when a job may take minutes and you do not want to keep the original HTTP request open.
import { GoogleGenAI } from "@google/genai";
const client = new GoogleGenAI({});
const interaction = await client.interactions.create({
agent: "antigravity-preview-05-2026",
input: "Analyze this repository and create a markdown risk report.",
environment: "remote",
background: true,
});
console.log("Save this interaction ID:", interaction.id);
// Later, poll by ID and read the completed output.
const result = await client.interactions.get(interaction.id);
console.log(result.status, result.output_text);
Starter pattern 2: remote MCP tool
Use this only with trusted MCP servers and minimum necessary access.
const interaction = await client.interactions.create({
agent: "antigravity-preview-05-2026",
input: "Check the internal observability data for auth latency spikes.",
environment: "remote",
tools: [
{ type: "google_search" },
{ type: "code_execution" },
{
type: "mcp_server",
name: "internal_telemetry",
url: "https://mcp.example.com/mcp",
},
],
});
Starter pattern 3: credential refresh
If a token expires, Google says you can pass the existing environment ID with new network configuration. That lets the sandbox keep its filesystem state, installed packages and cloned repositories while replacing the old credential rules.
const result = await client.interactions.create({
agent: "antigravity-preview-05-2026",
input: "Continue the previous analysis with the refreshed token.",
environment: {
type: "remote",
environment_id: previous.environment_id,
network: {
allowlist: [{
domain: "storage.googleapis.com",
transform: { Authorization: "Bearer REFRESHED_TOKEN" },
}],
},
},
});
Who should pay attention?
- AI product builders who want agent execution without building every orchestration and sandbox layer themselves.
- Developers building internal tools where agents need to inspect logs, files, repos, tickets or dashboards.
- Agencies and automation teams building repeatable workflows such as SEO crawls, QA checks, data reports and implementation audits.
- Enterprise teams that need a clearer boundary between sandbox execution, approved network access and local business functions.
Practical workflow ideas
| Workflow | How Managed Agents could help |
|---|---|
| Repository audit | Clone a repo, inspect TODOs, dependencies or risky files, then return a report later. |
| SEO technical crawl | Run a crawl, collect page titles/schema/canonicals, produce a prioritized issue list. |
| Customer support triage | Use an MCP endpoint for approved internal context, then summarize likely fixes. |
| Data cleanup | Install packages, inspect files, transform data and keep state in the same environment. |
| Incident investigation | Correlate telemetry, deployments and logs through controlled tools. |
Safety notes before using it in production
- Do not expose broad internal systems through MCP when a narrow tool would work.
- Do not hard-code secrets in prompts, examples, repos or logs.
- Review network allowlists, credential transforms and retention requirements.
- Log interaction IDs and status changes so background jobs do not become invisible.
- Test billing, rate limits and failure modes before connecting customer-facing workflows.
FAQ
What are Managed Agents in Gemini API?
Managed Agents are Google’s Gemini API agent capability where an agent can run with tools and a remote environment through the Gemini Interactions API. Google says the environment can handle reasoning, code execution, package installation, file management and web information inside an isolated cloud sandbox.
What is background execution?
Background execution lets a long-running interaction run asynchronously on the server. Your application receives an interaction ID and can poll, stream progress or reconnect later instead of keeping the original request open.
What is remote MCP integration?
Remote MCP integration lets a managed agent connect to a remote Model Context Protocol server as a tool, alongside other capabilities such as search or code execution. This is useful for approved internal APIs or toolsets, but it should be deployed with strict security controls.
Should every Gemini app migrate immediately?
No. This update is most relevant for agentic and long-running workflows. Stable production apps should test SDK support, quotas, data handling, cost and failure behavior before moving critical workloads.