Tools. Planning. Safe file access. Human approval. Memory. Skills. Shell. Code execution. Background agents. Observability. Governance. Evaluations.
What is an agent harness?
A language model generates text. An agent needs a loop that calls tools, inspects results, updates a plan, remembers information, requests approval for risky actions, manages context, and keeps working until the task is complete. That surrounding runtime is the harness.
In .NET:
AIAgent agent = chatClient.AsHarnessAgent(new HarnessAgentOptions
{
ChatOptions = new ChatOptions
{
Instructions = "You are a personal finance education assistant.",
Tools = [StockTools.GetStockPrice]
}
});
The harness supplies automatic function invocation, history persistence, planning, context compaction, file memory, web search, tool approvals, skills, and OpenTelemetry—each configurable.
What the series builds
Across four sessions, one personal finance education assistant grows through:
- Tools, web search, and a plan — smallest useful agent with a custom stock-price tool and todo planning
- Files, approvals, and memory — portfolio CSV inside an approved working directory;
ApprovalRequiredAIFunction for simulated trades; local vs Foundry Memory; timed approval policy for unanswered prompts - Skills, shell, CodeAct, and background agents — discoverable skills, confined shell, code execution for arithmetic, parallel research agents
- Observability, governance, evaluations, and Foundry Hosted Agent deployment
All prices and transactions in the samples are mock and illustrative—not financial advice.
Why start with the harness?
You can rebuild every piece yourself. Most teams want to spend time on domain behavior: which tools, which data, which approvals, what memory, which skills, which policies, how to evaluate. The harness gives those decisions a composable home. You still own the boundaries.
Source: devblogs.microsoft.com/dotnet/...