Build a C# AI Agent with Microsoft Agent Framework
Summary
The .NET Blog introduces a four-part live C# series that builds a personal finance education assistant with Microsoft Agent Framework’s agent harness. The project begins by wrapping an IChatClient in AsHarnessAgent and adding a stock-price tool, web search, and planning with a todo list. The harness supplies orchestration features including function-invocation history, context compaction, file memory, approvals, skills, and OpenTelemetry instrumentation, while developers choose the tools and boundaries. The second session adds access to a portfolio CSV inside an approved working directory, automatically permits read-only file operations, and requires human approval for writes, destructive actions, and simulated trades. A new sample implements a five-second timeout per approval attempt, up to five attempts, retries for missing or invalid input, and automatic denial when the limit is reached; the article also compares local JSON memory with managed Foundry Memory. The third session covers discoverable skills, confined shell commands, CodeAct for controlled code execution, and concurrent background agents for independent research. The author stresses that approval is not a substitute for isolation when shell or code execution is enabled. The final session adds OpenTelemetry traces, Microsoft Purview governance, repeatable evaluations, and deployment as a Foundry Hosted Agent, with host-specific capability choices. The series streams on the .NET YouTube channel and Microsoft Reactor on four consecutive Thursdays in September, with sessions remaining available on demand; the complete C# samples are published in the MafClaw repository. Finance examples use mock prices and transactions and are not financial advice.