← all posts

Your 'AI Agent' Is a While Loop With a Credit Card

Every pitch deck I've sat through this year contains the word 'agentic' at least four times. Nobody using it can define it. So let me do the industry's homework:

An agent is an LLM inside a loop that can call tools.

That's it. That's the whole trick. There's no magic, no emergent autonomy, no ghost in the shell. There's a model, a while loop, and a JSON blob describing which function to run next. You have built — and I say this with love — a for loop with opinions and a running meter.

The math nobody wants you to do

Vendors love quoting per-step accuracy: 'Our agent completes 95% of tasks!' Cool. Agents don't do one step. A 'simple' browser agent might take fifteen steps — click here, read that, fill this in, apologize to the captcha it just broke.

If each step succeeds 95% of the time, a fifteen-step task succeeds at 0.95^15 ≈ 46%. Less than a coin flip. And every failed run still costs you tokens, because the model doesn't refund you for its own confusion.

This is why demos look incredible and production looks like a fire. Demos are the 46%. You're watching someone's highlight reel and then paying full price for the outtakes.

Tool calling is JSON parsing with a press agent

Function calling was a great, honest feature. Somewhere between that and now, marketing discovered that 'the model called a function' tests worse than 'the model autonomously pursued a goal.' Here we are.

What actually happens:

  1. The model emits JSON that sort of matches your schema.
  2. Your code runs a function.
  3. You paste the result back into the prompt.
  4. Repeat until the model says DONE or your CFO opens the invoice.

Step 4 is carrying more weight than anyone admits. Ask a team running agents in prod what their true cost per successful task is and watch them check whether the door is locked.

Where agents actually work

Not everywhere. Agents are genuinely good when:

  • The task is verifiable. Code either compiles or it doesn't. Tests pass or fail. If you can check output mechanically, retries are cheap and honest.
  • Failure is cheap. Drafting an email: fine. Booking a non-refundable flight: my brother in silicon, no.
  • The loops are short. Three-step loops are tools. Thirty-step loops are slot machines.

The verdict

Agents are real and useful. They are also — and I cannot stress this enough — software. Wrapping a loop around a model does not install judgment, and compounding error rates do not care about your roadmap.

Next time someone tells you their agent will replace an entire job, ask one question: what's your success rate at step twelve?

Then enjoy watching them discover math.