google-antigravity-sdk

Design, implement, and debug autonomous AI agents using the Google Antigravity SDK.

Updated Aug 6, 2026
One-click install
npx skills add https://github.com/ferrarifankid04/ai-skills-public --skill google-antigravity-sdk-ferrarifankid04
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: google-antigravity-sdk
Source: https://github.com/ferrarifankid04/ai-skills-public/tree/main/antigravity/plugins/google-antigravity-sdk/skills/google-antigravity-sdk
Command: npx skills add https://github.com/ferrarifankid04/ai-skills-public --skill google-antigravity-sdk-ferrarifankid04

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires google-antigravity, and includes references (resource) components.

What problem does it solve? Building autonomous AI agents and multi-agent systems with the Google Antigravity (AGY) SDK requires navigating configuration, safety policies, MCP integration, hooks, and debugging workflows. This Skill provides structured guidance and runnable examples so you can create, configure, and orchestrate Antigravity agents correctly without guessing APIs or model identifiers. ## Core Features & Use Cases - Agent Configuration & Personas: Set up LocalAgentConfig, system instructions, custom tools, structured output, and persistence with verified code patterns. - Safety & Observability: Configure declarative safety policies (allow/deny/ask), track token usage, and debug failures using lifecycle hooks and logging. - MCP & Multi-Agent Orchestration: Connect agents to MCP servers via stdio or SSE, spawn subagents, and build proactive agents with time-based or file-change triggers. - Use Case: You want to build an agent that connects to an external MCP server, restricts shell command execution, and recovers gracefully from tool errors. This Skill routes you to the exact reference guide and working example for each requirement. ## Quick Start Ask the agent to create a Google Antigravity agent with a custom tool and safety policies, and it will set up the environment, verify your GEMINI_API_KEY, and generate the working configuration code.

Frequently Asked Questions about google-antigravity-sdk

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create an agent with the Google Antigravity SDK?

Create an agent by instantiating Agent with a LocalAgentConfig inside an async context manager, then call agent.chat() with your prompt. Ensure the google-antigravity package is installed and a GEMINI_API_KEY environment variable is set.

How do I connect an MCP server to a Google Antigravity agent?

Pass McpStdioServer or McpSseServer objects to the mcp_servers parameter of LocalAgentConfig. Stdio launches a local server process, while SSE connects to a remote server URL with optional authorization headers.

How do I restrict which tools an AI agent can execute?

Use the policy module to define allow, deny, or ask_user rules in LocalAgentConfig. The default confirm_run_command policy blocks shell commands while allowing other tools, and deny_all enables a deny-by-default setup.

Does the Google Antigravity SDK support conversation persistence?

Yes, persistence works by saving the conversation_id from a session and passing it with the same save_dir to a new LocalAgentConfig. The resumed agent retains context from previous interactions.

Why is my Google Antigravity agent failing silently?

Enable standard Python logging with logging.basicConfig(level=logging.INFO) to see SDK execution logs and tracebacks. You can also implement an OnToolErrorHook to intercept tool failures and return fallback guidance to the agent.

How do I track token usage and costs in Antigravity agents?

Access agent.conversation.total_usage to get a UsageMetadata object with prompt, candidates, thoughts, and total token counts. Monitor thoughts_token_count carefully since thinking tokens can significantly increase totals.