Getting Started with Managed Agents

Google for DevelopersAbout 4 min readJun 3, 2026Watch original
THE SUMMARYAI-generated

Key Concepts

  • Managed Agents: AI agents hosted by Google that run in a secure, isolated Linux sandbox.
  • Gemini 3.5 Flash: The underlying model powering the agentic capabilities.
  • Agentic Workflows: The ability for an AI to reason, write/execute code, browse the web, and manage files autonomously.
  • Interactions API: A specialized API endpoint designed for multi-turn, stateful agent conversations.
  • Sandbox Environment: A remote, secure Linux environment where agents perform tasks, execute scripts, and store generated files.
  • Custom Sources: The ability to inject agent.md (instructions), skill.md (capabilities), and external scripts (GitHub/Cloud Storage) into an agent.

1. Overview of Managed Agents

Managed agents represent a shift from simple chat interfaces to autonomous workers. These agents are capable of:

  • Reasoning: Breaking down complex tasks into logical steps.
  • Code Execution: Writing and running Python scripts within a secure Linux sandbox.
  • Web Browsing: Performing Google Searches to fetch real-time data.
  • File Management: Creating, editing, and saving files (e.g., HTML dashboards, PDFs, images).

2. Using AI Studio for Rapid Prototyping

AI Studio provides a visual interface to test and configure agents:

  • Templates: Users can select pre-built templates like "Customer Support," "Data Analyst," or "Repo Maintainer."
  • Configuration: The right-hand panel allows users to define:
    • Tools: Enabling code execution, Google Search, and network access.
    • Network Allow-list: Defining specific domains the agent is permitted to access.
    • Sources: Loading custom instructions (agent.md), specific skills (skill.md), or external repositories (GitHub/Cloud Storage).

3. Implementation via Gemini API

The Google AI Python SDK is the primary tool for integrating these agents into applications.

Step-by-Step Process for Agent Interaction:

  1. Initialization: Set up the client with a valid API key.
  2. Interaction Creation: Use client.interactions.create() to initiate a task.
    • Parameters: Specify the agent ID, the input prompt, and the environment (set to remote for the Linux sandbox).
  3. Multi-turn Conversations: To maintain context, pass the interaction_id and environment_id from the previous response into the next request.
  4. File Retrieval: Currently, downloading files from the sandbox requires a REST API GET request to the specific environment endpoint, which returns a .tar file containing the generated assets.
  5. Streaming: Use streaming to receive real-time updates on the agent's reasoning steps, providing a more responsive UI experience.

4. Building Custom Agents

Developers can create bespoke agents by defining custom configurations:

  • Creation: Use client.agents.create() to define a new agent based on a base model (e.g., the anti-gravity agent).
  • System Instructions: Define the persona and specific output formats (e.g., "You are a technical explainer that creates slide decks").
  • Skill Injection: By providing a skill.md file or a GitHub repository, developers can extend the agent's capabilities beyond the default set.

5. Real-World Application Example: Weather Dashboard

  • Task: Fetch weather data for London and Ankara, parse it using Python, and generate an interactive HTML dashboard.
  • Execution: The agent performed a Google Search, wrote a Python script to aggregate data, utilized Tailwind CSS for styling, and saved the final output as an interactive HTML file.
  • Outcome: The user was able to download the resulting file directly from the sandbox environment.

6. Notable Quotes

  • "This is a new feature that easily allows you to build customized agents, and those agents are running in a secure Linux sandbox that's hosted by Google." — Patrick, Gemini API Team.
  • "The interactions API is especially optimized for agentic workflows."

7. Synthesis and Conclusion

The Gemini Managed Agents framework significantly lowers the barrier to entry for building autonomous AI systems. By abstracting the complexities of environment management (the Linux sandbox) and providing a robust API for multi-turn reasoning, Google enables developers to move from simple prompt-response models to agents that can actively solve problems, write code, and produce tangible digital assets. The ability to customize these agents via GitHub repositories and specific instruction files makes them highly adaptable for enterprise use cases like customer support and technical documentation.

AI summaries can miss context or contain errors. Check important details against the original video.

Go a little deeper.

Have a question about this video? Load its transcript to open the video chat.