Skip to content

Agent Run Budget Guard

Stop runaway agents by capping tokens, cost and steps per task.

Intermediate12h1–2 people17/20 fit
TL;DR

Build Agent Run Budget Guard for developers running llm agents in ~12h with 1–2 people. Stack: Node.js + Vercel AI SDK + SQLite + Charts.

Why it wins: Every agent builder needs this and the demo is dramatic.

Build flow

01 · Problem
Agents can loop and burn money overnight without anyone noticing.
02 · Solution
Wrap LLM calls with a middleware that tracks tokens, cost and steps per run, warns at thresholds and kills runs that exceed budgets.
03 · Build
  1. 1Wrap model calls
  2. 2Count tokens and cost
  3. 3Enforce limits
  4. 4Chart usage
04 · Demo
Start a looping agent and show it being stopped at the budget cap.

MVP checklist

  • Per-run budgets
  • Live cost meter
  • Auto stop
  • Usage dashboard

Tech stack

TechRole
Node.jsBackend runtime
Vercel AI SDKLLM streaming + tool calls
SQLiteEmbedded database
ChartsData visualisation

Reference repos

Open-source projects you can build on. Links checked 2026-10-31.

Related ideas

More AI Agents
  • Replay agent runs, score each step and find where agents go off the rails

    Advanced26h1–3
    OpenTelemetryLLMNext.js
    15/20
  • Catches risky changes before a human reviewer looks at the PR

    Intermediate36h2–3
    PythonGitHub APILLM
    16/20
  • Lets any MCP-compatible assistant read and update your own notes safely

    Intermediate24h1–2
    Node.jsMCP SDKSQLite
    16/20