Skip to content

.NET: Adding default providers and tools to HarnessAgent#5896

Open
westey-m wants to merge 4 commits into
microsoft:mainfrom
westey-m:harness-agent-add-providers-and-tools
Open

.NET: Adding default providers and tools to HarnessAgent#5896
westey-m wants to merge 4 commits into
microsoft:mainfrom
westey-m:harness-agent-add-providers-and-tools

Conversation

@westey-m
Copy link
Copy Markdown
Contributor

@westey-m westey-m commented May 15, 2026

Motivation and Context

We want the HarnessAgent to come with a set of default tools. Adding a set of providers and tools to the HarnessAgent to allow it to do a lot of work out of the box, with opt-outs for each feature.

Description

  • Adding default providers and tools to HarnessAgent
  • Adding overridable harness instructions (separate from agent instructions)
  • Update samples to use features as needed.

Contribution Checklist

  • The code builds clean without any errors or warnings
  • The PR follows the Contribution Guidelines
  • All unit tests pass, and I have added new tests where possible
  • Is this a breaking change? If yes, add "[BREAKING]" prefix to the title of the PR.

Copilot AI review requested due to automatic review settings May 15, 2026 14:19
@moonbox3 moonbox3 added documentation Improvements or additions to documentation .NET labels May 15, 2026
@github-actions github-actions Bot changed the title Adding default providers and tools to HarnessAgent .NET: Adding default providers and tools to HarnessAgent May 15, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds default HarnessAgent capabilities so agents get common providers, tools, and decorators out of the box, with options to opt out and separate harness-level instructions from agent-specific instructions.

Changes:

  • Adds default ToolApproval, OpenTelemetry, WebSearch, Todo, AgentMode, FileMemory, FileAccess, and AgentSkills configuration to HarnessAgent.
  • Adds HarnessAgentOptions switches and custom store/source options for those defaults.
  • Updates harness samples and unit tests to reflect the new default behavior.

Reviewed changes

Copilot reviewed 12 out of 13 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
dotnet/src/Microsoft.Agents.AI.Harness/HarnessAgent.cs Builds default agent decorators, tools, context providers, and instruction composition.
dotnet/src/Microsoft.Agents.AI.Harness/HarnessAgentOptions.cs Adds opt-out flags and customization properties for default harness features.
dotnet/src/Microsoft.Agents.AI/Harness/AgentMode/AgentModeProvider.cs Expands default plan/execute mode instructions and formatting.
dotnet/src/Microsoft.Agents.AI/Harness/FileMemory/FileMemoryProvider.cs Refines memory guidance text.
dotnet/src/Microsoft.Agents.AI/Harness/Todo/TodoProvider.cs Refines todo guidance text.
dotnet/tests/Microsoft.Agents.AI.Harness.UnitTests/HarnessAgentTests.cs Updates existing tests and adds coverage for default feature inclusion/exclusion.
dotnet/tests/Microsoft.Agents.AI.Harness.UnitTests/HarnessAgentOptionsTests.cs Adds option default and set/get coverage for new properties.
dotnet/samples/02-agents/Harness/Harness_Step01_Research/Program.cs Simplifies research sample to rely on new HarnessAgent defaults.
dotnet/samples/02-agents/Harness/Harness_Step02_Research_WithSubAgents/Program.cs Updates sub-agent sample to use built-in web search and disable unused defaults.
dotnet/samples/02-agents/Harness/Harness_Step03_DataProcessing/Program.cs Updates data processing sample to rely on default file access.
dotnet/samples/02-agents/Harness/Harness_Step03_DataProcessing/README.md Documents the updated default file access behavior and sample data location.
dotnet/samples/02-agents/Harness/Harness_Step03_DataProcessing/Harness_Step03_DataProcessing.csproj Removes old sample data copy item.
dotnet/samples/02-agents/Harness/Harness_Step03_DataProcessing/working/sales.csv Adds sample CSV data under the default working folder.
Comments suppressed due to low confidence (1)

dotnet/src/Microsoft.Agents.AI/Harness/AgentMode/AgentModeProvider.cs:91

  • Use the American English spelling "judgment" here for consistency with the repository's documentation style.
            2. Work autonomously — use your best judgement to make decisions and keep progressing without asking the user questions. The goal is to have a complete, useful result ready when the user returns.

Comment thread dotnet/samples/02-agents/Harness/Harness_Step03_DataProcessing/Program.cs Outdated
Comment thread dotnet/src/Microsoft.Agents.AI/Harness/AgentMode/AgentModeProvider.cs Outdated
Comment thread dotnet/src/Microsoft.Agents.AI/Harness/AgentMode/AgentModeProvider.cs Outdated
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated Code Review

Reviewers: 4 | Confidence: 91% | Result: All clear

Reviewed: Correctness, Security Reliability, Test Coverage, Design Approach


Automated review by westey-m's agents

Comment thread dotnet/samples/02-agents/Harness/Harness_Step01_Research/Program.cs Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation .NET

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants