Google has expanded its Gemini API with new features, including the default use of Gemini 3.6 Flash and the introduction of environment hooks. These updates allow developers to manage tool calls within a sandboxed environment, enhancing control and automation. The changes build on previous enhancements such as background tasks and remote MCP server integration. Developers can now use environment hooks to run custom scripts before or after tool calls, providing greater flexibility in managing interactions within the sandbox.

The new environment hooks enable users to block, lint, or audit tool calls inside the sandbox. Developers can configure these hooks by adding a .agents/hooks.json file to their environment, which triggers handlers on pre_tool_execution or post_tool_execution events. The hooks support regular expressions, allowing for targeted script execution on specific tool calls. Additionally, the system now supports HTTP type handlers that POST directly to external endpoints, offering more integration options.

The updates also include budget controls and free tier access for managed agents. Developers can now experiment with agentic workflows using a free tier API key, and budget limits can be set to prevent excessive token usage. These features are designed to make managed agents more cost-effective and efficient for complex tasks. The changes reflect Google's ongoing efforts to enhance the capabilities of its Gemini API for developers and organizations.

Source: googleai