Inspiration
Cloud bills leak money quietly — an idle IP here, an oversized instance there, snapshots and cold storage nobody remembers. FinOps today is mostly manual dashboards and good intentions. We wanted an agent that doesn't just flag waste but fixes it — and that we'd actually trust to touch a real cloud account. The hard part isn't finding savings; it's autonomy you can trust.
What it does
Steward is an autonomous FinOps agent for Alibaba Cloud. It runs a five-stage loop — detect → plan → gate → execute → roll back:
- Detect five classes of waste: over-provisioned ECS, idle elastic IPs, unattached disks, old snapshots, and cold OSS buckets on Standard-tier pricing.
- Plan — every action is scored 1–5 for blast radius and ordered safest-first.
- Gate — a deterministic policy layer outside LLM control:
env=productionis untouchable, irreversible actions are opt-in, plus a monthly-change budget and a per-run cap. - Execute — captures before-state, verifies health afterward, and rolls back automatically on failure.
- Report — a full audit trail of everything proposed and done.
On top of the rules, Qwen 3.7-Max investigates the live account through tools, proposes savings the detectors miss, and explains its reasoning — but everything it proposes still passes the same gate. The thesis: the LLM proposes; policy disposes. In --auto mode the gate refuses to execute any LLM-proposed action without a human. Autonomy without blind trust in the model.
It runs live against a real Alibaba Cloud account: reads are free, and the only live mutations are cheap and reversible (release an idle IP, re-tier a cold OSS bucket). We demoed a real, reversible storage-class change on a real bucket — at $0.
How we built it
- Engine: Python 3.11, ports-and-adapters — one
CloudProviderinterface, two implementations (an in-memory mock for tests + the real Alibaba SDK). Test-driven throughout (200 passing tests). - Agent: Qwen Cloud (
qwen3.7-max, OpenAI-compatible API) with function calling, a bounded tool-call loop, and a full transcript for audit. Degrades gracefully to a detector-only run if the key is missing. - Dashboard: a thin read-only FastAPI backend + a React / TypeScript / Tailwind SPA (a "mission-control" FinOps view), talking over JSON + a live SSE stream of the agent's tool calls.
- Deploy: the backend runs on Alibaba Function Compute (custom-runtime web function,
mock/ read-only) and the SPA on GitHub Pages, calling the live API cross-origin. $0 on the Function Compute free tier.
Challenges we ran into
- Trust: how do you let an LLM act on infrastructure? Our answer is the deterministic gate, a
+1blast-radius penalty on LLM-sourced findings, and an--autohard-block — the model never gets the keys. - A real bug, caught in review: a
NaNsaving slipped past validation (NaN < budgetis false) and could poison the gate — fixed with a finite-number check. - Alibaba platform friction: no free Container Registry, RAM-permission walls, and both OSS and the Function Compute system domain force-download HTML (anti-phishing). We hosted the SPA on GitHub Pages → live FC backend to get a browsable URL with the engine still running on Alibaba.
Accomplishments that we're proud of
- A real, reversible mutation on a live Alibaba account, end-to-end, at $0.
- Safe by construction: dry-run by default, production protected, automatic rollback, and the LLM strictly gated.
- Deployed live on Alibaba, 200 passing tests, and a polished dashboard plus a fully narrated demo.
What we learned
The "LLM proposes, deterministic policy disposes" split is a clean, reusable pattern for trustworthy agents — keep judgment in the model and authority in code. Plus a lot about Alibaba Cloud's real edges: BSS billing endpoints, OSS lifecycle rules, FC custom runtimes, and anti-abuse download headers.
What's next
More detectors and cloud providers, scheduled autopilot runs, a pull-request-style approval flow for proposed actions, and cost-trend tracking over time.
Built With
- alibaba-cloud
- alibaba-oss
- docker
- fastapi
- function-compute
- github
- openai-api
- pydantic
- pytest
- python
- qwen
- react
- recharts
- serverless-devs
- tailwindcss
- typescript
- uvicorn
- vite
Log in or sign up for Devpost to join the conversation.