Skip to content
Courses/Agents and automation/Infinite Loops and Cost Control

Infinite Loops and Cost Control

An agent that repeats the same call a hundred times doesn't seem dangerous until the bill arrives or it blocks an external service.

  • Detect loops by repetition of intent, tool, and arguments.
  • Apply budgets per task, user, model, and time window.
  • Design circuit breakers that stop the system before disaster strikes.
Terminal
guardrails:
  max_steps_per_task: 12
  max_tool_calls_per_tool: 4
  max_cost_usd_per_task: 0.80
  max_repeated_fingerprint: 3
  max_runtime_seconds: 300

fingerprint:
  campos:
    - normalized_goal
    - tool_name
    - sorted_args_hash
  si_repite_3_veces:
    parar
    guardar_traza
    pedir_revision_humana

Loop Signals

  • The same tool receives nearly identical arguments.
  • The agent says "I'm going to check" many times without new evidence.
  • Cost increases but the task state doesn't change.
  • Errors are recoverable, but the strategy doesn't change.
Complete Aulafy mapSee how this lesson fits without leaving your path.

Complete Aulafy map

How all courses connect

This is not a checklist. Start with the foundation, choose an outcome, and go deeper only when your project needs more control.

  1. 1Understand
  2. 2Apply or build
  3. 3Operate with confidence
01

Choose an application

Turn the foundation into a visible outcome: a website, a business improvement, media, or an interactive experience.

Continue into the technical branch when you need to maintain code, data, or infrastructure.

02

Build with code

Prepare your environment, work with coding agents, and run models while keeping control of your projects.

This branch prepares you to design and operate reliable AI systems.

03

Take systems to production

Combine retrieval, agents, evaluation, security, deployment, and model adaptation when the problem requires it.

You do not need every course: choose the component your system needs and return as it grows.

View full catalogue