- Separate context, memory, and execution state.
- Design loops with limits, exit criteria, and recovery.
- Avoid agents that repeat actions or lose track of the thread.
Recommended minimum state
{
"task_id": "inbox-2026-07-02-001",
"intent": "crear_borrador_respuesta",
"risk": "medium",
"customer": "cliente@example.com",
"attempts": 1,
"approved": false,
"next_action": "draft_email",
"evidence": ["email original", "politica devoluciones"]
}Healthy loops
- Attempt limit: never retry forever.
- Exit criterion: know when a response is sufficient.
- Escalation: request human help when there's no confidence.
- Idempotency: don't repeat external actions if the step has already been executed.