0Pricing
AI Agents · Lesson

Budgets and Guardrails

What stops a loop from running until your bill notices.

Budgets and Guardrails is a free AI Agents lesson on CoddyKit — lesson 4 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the AI Agents learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

An agent with no limits is not ambitious, it is unbilled. Two limits do most of the work: how many steps it may take, and which tools it may touch.

This one has a budget of three steps. Watch it run out.

[{"type":"USER","text":"Find every mention of our product in the last year and summarise the sentiment."},
     {"type":"THOUGHT","text":"This is broad. I will start searching."},
     {"type":"TOOL_CALL","tool":"docs.search","args":{"query":"product mentions"}},
     {"type":"TOOL_RESULT","tool":"docs.search","result":{"results":[{"topic":"evaluation","text":"Agents are judged on task success, cost and guardrail violations."}]}},
     {"type":"THOUGHT","text":"One partial hit. I would need many more searches to cover a year."},
     {"type":"ERROR","text":"step budget exhausted (3/3)"},
     {"type":"ANSWER","text":"I could not finish within my step budget. I found one relevant note; a full year needs a wider search."}]

It stopped and said so. That is the desired behaviour: a bounded failure you can read, instead of an unbounded loop you discover on an invoice. Least privilege applies too — give an agent only the tools its task needs, because anything it can reach, an injected instruction can reach.

Last one.

Frequently asked questions

Is the “Budgets and Guardrails” lesson free?

Yes — the full text of “Budgets and Guardrails” is free to read here on the web, and the AI Agents course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the AI Agents course, upgrade to CoddyKit PRO.

What will I learn in “Budgets and Guardrails”?

What stops a loop from running until your bill notices. You practise AI Agents with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start AI Agents?

No prior experience is required. AI Agents on CoddyKit is structured for beginners through advanced learners; this is — lesson 4 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Budgets and Guardrails” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this AI Agents lesson?

Yes. Every AI Agents lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. The Loop
  2. When the Tool Says No
  3. Grounded or Guessing
  4. Budgets and Guardrails
← Back to AI Agents