# Agent loops in C\# with Microsoft Agent Framework

Canonical source : [Agent loops in C\# with Microsoft Agent Framework](<https://sebastien.rigaux.be/en/tech-watch/links/agent-loops-in-c-with-microsoft-agent-framework>)

Agent loops combine action, observation, and evaluation to refine an answer or retry an operation until it meets a criterion. Jesse Liberty demonstrates the pattern in C# with Microsoft Agent Framework: a loop agent, an evaluator, and an iteration limit.

The example contrasts a deterministic marker such as `DONE` with a model-based judge, then outlines safeguards to add: timeouts, idempotent calls, logging, and cost tracking. Each iteration adds latency and token usage.

- Selected on : 2026-11-02

- Resource publication : 2026-10-26

- Entry updated : 2026-11-07T20:32:37+0000

- Format : Article

- Source language : EN

- Found via : [C\# Digest](<https://csharpdigest.net/>)

Original resource : [Agent loops in C\# with Microsoft Agent Framework](<https://jesseliberty.com/2026/10/26/prompts-are-dead-long-live-loops/>)

Tags : Microsoft Agent Framework · [C\#](<https://sebastien.rigaux.be/en/tech-watch/tags/c-sharp>) · [AI Agents](<https://sebastien.rigaux.be/en/tech-watch/tags/ai-agents>) · [Model Evaluation](<https://sebastien.rigaux.be/en/tech-watch/tags/model-evaluation>) · [Workflow Orchestration](<https://sebastien.rigaux.be/en/tech-watch/tags/workflow-orchestration>)

Available versions : [Français](<https://sebastien.rigaux.be/veille/liens/boucles-dagents-en-c-avec-microsoft-agent-framework>) · [English](<https://sebastien.rigaux.be/en/tech-watch/links/agent-loops-in-c-with-microsoft-agent-framework>)

[Back to tech watch](<https://sebastien.rigaux.be/en/tech-watch>)
