My AI ran up a $200 Google charge re-reading the same notes three times a day. Here's what every job that runs on its own gets now, so it can't happen quietly again.
Read https://jay-burnett-packs.vercel.app/bill/agent.md and set this up for me.It reads agent.md: install, test and undo steps. Want it by hand instead? Your email below opens the full page.
You're in, the files are below.
Before anything runs on a schedule, it gets all three. If it can't have all three, it doesn't run on its own.
A hard number per run and per day. If a run would go over it, the job stops itself.
One file or one setting that stops the job without touching code. Mine check for a file called PAUSE and exit if it's there.
When the cap trips or the cost jumps, you hear about it that day. Not when the bill shows up.
A cache saving to the wrong folder looks fine. It just never finds anything, so every run pays full price. Two quick checks from my own bill. They catch the obvious case, they don't prove the cache is perfect:
If it reads 0 run after run, the cache isn't being found. That was my $200.
A run that only handles what's new should cost a lot less than the first run. If every run costs the same as the first one, check the caching first. It's probably re-reading files it already handled.
Make the job print files cached and cost at the end of every run, so you can see it at a glance.
Google's own Budgets page, about two minutes of setup.
Google's guide: cloud.google.com/billing/docs/how-to/budgets. A budget alerts you. It doesn't stop the spending. The cap in line 1 is what stops it. If you have auto-reload on prepaid credit, turn it off or cap it too.
Hooks, filters and checkers that run on every message add up fast. My second leak was one of these.
Never the big model per event. Save the big one for the jobs you actually read.
Collect the messages and run one call every few minutes instead of one per message.
I show the real log line and how I found the leak on my channel.
Watch on YouTube