Inspiration
Cloud infrastructure is powerful, but managing it efficiently is still surprisingly manual. Engineers have dashboards full of metrics, billing reports, and resource configurations, yet identifying waste, deciding what to change, applying that change safely, and verifying the result often requires several disconnected tools and human intervention.
We wanted to build something beyond another cloud-cost dashboard. The idea behind AGEM was simple: what if an agent could take responsibility for the entire optimization workflow?
That led us to AGEM — the Autonomous Google-powered Efficiency Manager. Instead of only telling an engineer that a resource is inefficient, AGEM is designed to discover the problem, reason about a possible optimization, apply it within defined safety boundaries, and verify the outcome.
This directly aligned with the Taskmaster challenge: building an agent that takes action and handles a messy, multi-step workflow rather than simply responding to prompts.
What it does
AGEM continuously analyzes Google Cloud infrastructure and looks for opportunities to reduce waste without compromising operational safety.
The workflow is:
Discover → Profile → Score → Reason → Validate → Execute → Verify → Recover
AGEM discovers resources across Cloud Run, Cloud SQL, and BigQuery, collects infrastructure and utilization signals, and calculates a Cloud Waste Score (CWS) to prioritize optimization opportunities.
Gemini provides the reasoning layer, while Google ADK orchestrates the agent workflow. AGEM then applies deterministic safety and policy checks before an infrastructure change can be executed.
The system also uses selective autonomy. Low-risk changes can proceed autonomously, while higher-risk or protected resources remain subject to additional controls.
After an optimization, AGEM can re-evaluate the resource to determine whether the change actually improved the system. If the result violates the defined conditions, the rollback path can be used to restore the previous configuration.
The goal is not simply to produce an optimization recommendation. It is to create an agent capable of taking responsibility for the operational workflow around that recommendation.
How we built it
AGEM is built around Gemini, Google ADK, and Google Cloud.
The core components are separated into dedicated modules for:
- Resource discovery using Google Cloud infrastructure APIs
- Telemetry and profiling using Cloud Monitoring and resource configuration data
- Cloud Waste Scoring for prioritizing optimization opportunities
- Gemini-based reasoning for generating optimization strategies
- Deterministic safety validation for constraining proposed infrastructure changes
- Execution and rollback for controlled infrastructure operations
- Git-based isolation for traceable optimization changes
- Firestore state management for persistent agent state and optimization history
- Cloud Run deployment for the hosted application
- Cloud Build and Google Cloud services for deployment and operation
We deliberately separated the reasoning layer from the execution layer. Gemini can propose an optimization, but it does not receive unrestricted control over infrastructure. AGEM's deterministic controls decide whether the proposed operation is permitted.
This separation became one of the most important design principles of the project:
Gemini proposes. AGEM validates. Google Cloud executes.
The architecture also supports background execution through scheduled/cloud-triggered workflows, allowing the system to operate without requiring an engineer to manually initiate every optimization cycle. This fits the hackathon's emphasis on agents that operate asynchronously and complete multi-step tasks with minimal hand-holding.
Challenges we ran into
The hardest part was not getting Gemini to generate an infrastructure command. The difficult part was building the control system around the model.
We had to think carefully about what an autonomous cloud agent should and should not be allowed to do.
One major challenge was designing the boundary between AI reasoning and deterministic infrastructure operations. An LLM can generate a plausible optimization, but plausibility is not enough when the output can modify real infrastructure. We therefore introduced validation, resource restrictions, rollback information, and selective autonomy.
Another challenge was handling telemetry reliability. An optimization decision is only meaningful when it is based on trustworthy infrastructure data. This forced us to distinguish between real operational telemetry and test/demo data rather than treating them as interchangeable.
We also had to deal with the verification problem. Applying a change is only half of the workflow. The difficult question is:
[ \text{Did the optimization actually improve the resource?} ]
That required thinking in terms of a closed loop rather than a one-shot action:
[ \text{Before} \rightarrow \text{Decision} \rightarrow \text{Change} \rightarrow \text{After} \rightarrow \text{Decision} ]
Finally, we had to balance autonomy with safety. Making everything fully autonomous would be easy to claim but difficult to justify. Instead, we designed AGEM around risk-aware autonomy, where the level of automation depends on the potential blast radius of the operation.
Accomplishments that we're proud of
We are proud that AGEM evolved from an idea about cloud optimization into a working agentic system running on Google Cloud.
Some of the key accomplishments are:
- Built a complete multi-stage cloud optimization workflow rather than a chatbot
- Integrated Gemini and Google ADK into the operational workflow
- Connected the agent to real Google Cloud infrastructure and telemetry
- Built a Cloud Waste Score to prioritize optimization opportunities
- Implemented deterministic safety controls around AI-generated actions
- Added selective autonomy for different infrastructure risk levels
- Added Git-based change isolation and persistent state
- Implemented rollback mechanisms for infrastructure changes
- Deployed the application using Google Cloud services
- Built an observable control plane for inspecting agent decisions and execution state
Most importantly, we are proud of the shift in mindset from:
“AI recommends what an engineer should do.”
to:
“AI participates in a controlled workflow that can actually do the work.”
That distinction is what makes AGEM an agent rather than simply an AI-powered dashboard.
What we learned
The biggest lesson was that agentic engineering is less about making the model smarter and more about designing the system around the model correctly.
A powerful model can reason about an infrastructure problem, but a reliable agent also needs state, tools, permissions, validation, observability, failure handling, and recovery.
We also learned that autonomy should not mean unrestricted access. A good agent needs clearly defined boundaries. In AGEM, that means separating low-risk autonomous actions from higher-risk operations that require additional controls.
Another important lesson was the importance of verification. An agent should not consider a task complete simply because an API call succeeded. The real question is whether the desired outcome occurred in the underlying system.
That changed how we designed the workflow:
[ \text{Action Success} \neq \text{Task Success} ]
Instead, AGEM treats the observed state of the infrastructure as the final source of truth.
What's next for AGEM (autonomous Google powered Efficiency Manager)
The next step for AGEM is to evolve from an optimization agent into a broader autonomous cloud operations layer.
We want AGEM to become increasingly capable of understanding long-term infrastructure behavior, learning from previous optimization outcomes, improving its savings estimates, and making increasingly precise decisions about when to optimize, when to defer, and when to do nothing.
Future directions include deeper integration with cloud billing and cost attribution, stronger policy and governance controls, richer post-change verification, expanded optimization strategies, and improved long-running agent memory.
The long-term vision is straightforward:
Give AGEM a cloud environment and an efficiency goal, then let the agent continuously discover opportunities, make bounded decisions, execute safely, and verify the results — while keeping humans in control of the decisions that truly require them.
AGEM is our step toward making cloud infrastructure not just observable, but self-optimizing, accountable, and operationally intelligent.
Built With
- adk
- cloud-asset-inventory
- cloud-firestore
- cloud-optimization
- cloud-run
- devops
- gemini
- google-cloud
- pub/sub
- vertex


Log in or sign up for Devpost to join the conversation.