Session

Plan, execute, approve: a deep dive into the Microsoft Agent Framework Agent Harness

A language model, on its own, only generates text. For it to plan, use tools, remember what it has done, and act without making mistakes, it needs a set of control tooling around it: what everyone now calls the harness.
Until recently, you had to build it yourself. Since July 2026, Microsoft Agent Framework ships it built in and stable, also in .NET.
In this session we will build an agent live, starting from scratch and adding pieces one at a time to understand what each one brings:
- We start with a basic agent that can only chat, and see why that is not an agent. Then we add the harness and the important parts show up: the automatic loop, persistent history, and context compaction when the conversation gets long.
- We try plan mode and execute mode: the agent first thinks and writes its task list, you review it and correct it if needed, and only then do you let it run. The framework keeps reinvoking it on its own until everything pending is done.
- We give it access to the shell and the file system with human approvals in between: we will watch the agent propose commands and wait for our go-ahead before touching anything. This is where an agent goes from toy to a tool you can let loose with some peace of mind.
- We look at CodeAct: instead of chaining twenty tool calls for a procedural task, the agent writes code, runs it in a sandbox, and returns the result in a single pass.
- We add skills the agent loads on demand, and watch everything happening under the hood with the built-in telemetry.
- And we close with the path to production: how that same agent gets packaged and deployed to Foundry as a Hosted Agent, with scale to zero and state that survives restarts.
The session is hands-on from start to finish, with the goal that you leave knowing what the harness in Microsoft Agent Framework gives you for free, what you have to configure yourself, and when it pays off versus building the loop on your own.
Key Takeaways:
- What an agent harness actually is and why it is the most important part of any agent
- How to build agents with HarnessAgent in .NET: loop, planning, memory, and context compaction out of the box
- How to add human-in-the-loop with approvals over the shell and file system
- What CodeAct is and when running code is cheaper than chaining tool calls
- The path from localhost to production with Hosted Agents in Foundry

David Lorenzo

Microsoft MVP Business Apps | AI @ Automation Architect at Prodware

Adeje, Spain

Actions

Please note that Sessionize is not responsible for the accuracy or validity of the data provided by speakers. If you suspect this profile to be fake or spam, please let us know.

Jump to top