Skip to content

.NET: Python/.Net: Agent Harness blog post accompanying samples part 3#6741

Draft
westey-m wants to merge 5 commits into
microsoft:mainfrom
westey-m:harness-blog-part3-samples
Draft

.NET: Python/.Net: Agent Harness blog post accompanying samples part 3#6741
westey-m wants to merge 5 commits into
microsoft:mainfrom
westey-m:harness-blog-part3-samples

Conversation

@westey-m

Copy link
Copy Markdown
Contributor

Motivation & Context

#6361

Description & Review Guide

  • Add samples for the harness blog part 3

Related Issue

Fixes #

Contribution Checklist

  • The code builds clean without any errors or warnings
  • All unit tests pass, and I have added new tests where possible
  • The PR follows the Contribution Guidelines
  • This PR is linked to an issue and there is no other open PR for this issue (see Related Issue above).
  • This is not a breaking change. If it is a breaking change, add the breaking change label (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.

Copilot AI review requested due to automatic review settings June 25, 2026 16:33
@moonbox3 moonbox3 added documentation Usage: [Issues, PRs], Target: documentation in the code base and learn docs python Usage: [Issues, PRs], Target: Python .NET Usage: [Issues, PRs], Target: .Net labels Jun 25, 2026
@github-actions github-actions Bot changed the title Python/.Net: Agent Harness blog post accompanying samples part 3 Python: Python/.Net: Agent Harness blog post accompanying samples part 3 Jun 25, 2026
@github-actions github-actions Bot changed the title Python: Python/.Net: Agent Harness blog post accompanying samples part 3 .NET: Python/.Net: Agent Harness blog post accompanying samples part 3 Jun 25, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Automated Code Review

Reviewers: 5 | Confidence: 84%

✓ Correctness

This PR adds .NET and Python samples for a blog post (Part 3) on scaling agent capabilities. The code is well-structured and correct for a demo. One low-severity edge case exists in the valuation script where a zero price input would cause a ZeroDivisionError, though in practice the mock data always provides positive prices. No high-severity bugs found.

✓ Security Reliability

This PR adds sample code for a blog post demonstrating agent harness capabilities. The security posture is generally good: process arguments use safe list-based APIs (avoiding injection), sensitive operations are gated behind approval prompts, the shell executor has a timeout + deny-list + confined working directory, and security boundaries are clearly documented. The one notable gap is that the .NET SubprocessScriptRunner lacks a built-in process timeout (unlike its Python counterpart which has timeout=30), relying entirely on the caller-supplied CancellationToken.

✓ Test Coverage

This PR adds sample code (both .NET and Python) accompanying a blog post (Part 3 of 'Build your own claw' series). The PR introduces no library/production code — only sample applications and their supporting scripts. Following the established repository convention, harness/claw samples do not have associated unit tests (the existing Step01 sample likewise has no tests). The Python utility scripts (risk_score.py, valuation_metrics.py, subprocess_script_runner.py) are self-contained CLI tools intended as demos; while they would benefit from basic tests, the repo's existing pattern does not require them for sample code. No test coverage concerns rise to blocking level.

✓ Failure Modes

This PR adds sample code for a blog post demonstrating agent harness scaling capabilities. The code is well-structured for a sample, but there is one concrete resource leak on a failure path in the .NET FoundrySkills helper: if McpClient.CreateAsync throws (e.g., network error connecting to the Foundry Toolbox), the HttpClient created just before it is never disposed because the tuple return never executes and the caller's finally block only disposes the null variable.

✓ Design Approach

I found one blocking design issue in the Python Part 3 sample: it documents and instructs portfolio-based workflows, but the sample assets checked in under working/ only include trade confirmations, not the portfolio.csv file those workflows require. That leaves one of the sample’s core demo paths broken out of the box.


Automated review by westey-m's agents

Comment thread python/samples/02-agents/harness/build_your_own_claw/README.md

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds “Part 3 — Scaling capabilities” harness samples for both Python and .NET, expanding the “Build your own claw” series with skills, a confined shell, CodeAct, background agents, and optional Foundry Toolbox MCP skills integration.

Changes:

  • Added Python harness Part 3 runnable sample with local file-based skills (valuation + risk scoring), optional Foundry skills via Toolbox MCP, a confined shell tool, Monty CodeAct, and a background web-search research agent.
  • Added .NET harness Part 3 runnable sample with equivalent capabilities (file skills + optional Foundry skills, confined shell executor, Hyperlight CodeAct, background research agent).
  • Added sample working data (portfolio + trade confirmations) and updated sample readmes/indices to reference Part 3.

Reviewed changes

Copilot reviewed 38 out of 38 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
python/samples/02-agents/harness/build_your_own_claw/working/confirmations/trade confirmation 1.txt Sample trade confirmation fixture for shell tidying demo
python/samples/02-agents/harness/build_your_own_claw/working/confirmations/SPY sell.txt Sample trade confirmation fixture for shell tidying demo
python/samples/02-agents/harness/build_your_own_claw/working/confirmations/googl-jan.txt Sample trade confirmation fixture for shell tidying demo
python/samples/02-agents/harness/build_your_own_claw/working/confirmations/copy of trade (3).txt Sample trade confirmation fixture for shell tidying demo
python/samples/02-agents/harness/build_your_own_claw/working/confirmations/conf_AAPL.txt Sample trade confirmation fixture for shell tidying demo
python/samples/02-agents/harness/build_your_own_claw/working/confirmations/2025-06-21_nvda.txt Sample trade confirmation fixture for shell tidying demo
python/samples/02-agents/harness/build_your_own_claw/subprocess_script_runner.py Python subprocess runner for file-based skill scripts
python/samples/02-agents/harness/build_your_own_claw/skills/valuation/SKILL.md Valuation skill definition/instructions (Python)
python/samples/02-agents/harness/build_your_own_claw/skills/valuation/scripts/valuation_metrics.py Valuation computation script (Python)
python/samples/02-agents/harness/build_your_own_claw/skills/valuation/references/valuation-guide.md Valuation reference guide (Python)
python/samples/02-agents/harness/build_your_own_claw/skills/risk-scoring/SKILL.md Risk-scoring skill definition/instructions (Python)
python/samples/02-agents/harness/build_your_own_claw/skills/risk-scoring/scripts/risk_score.py Concentration risk scoring script (Python)
python/samples/02-agents/harness/build_your_own_claw/skills/risk-scoring/references/risk-bands.md Risk band reference guide (Python)
python/samples/02-agents/harness/build_your_own_claw/README.md Documents Part 3 sample and how to run/what to expect
python/samples/02-agents/harness/build_your_own_claw/claw_step03_scaling_capabilities.py Main Python Part 3 runnable sample (skills/shell/codeact/background agents)
dotnet/samples/02-agents/Harness/README.md Adds .NET Part 3 sample entry to harness samples index
dotnet/samples/02-agents/Harness/BuildYourOwnClaw/Claw_Step03_ScalingCapabilities/working/portfolio.csv Sample portfolio fixture for .NET Part 3
dotnet/samples/02-agents/Harness/BuildYourOwnClaw/Claw_Step03_ScalingCapabilities/working/confirmations/trade confirmation 1.txt Sample trade confirmation fixture for .NET Part 3
dotnet/samples/02-agents/Harness/BuildYourOwnClaw/Claw_Step03_ScalingCapabilities/working/confirmations/SPY sell.txt Sample trade confirmation fixture for .NET Part 3
dotnet/samples/02-agents/Harness/BuildYourOwnClaw/Claw_Step03_ScalingCapabilities/working/confirmations/googl-jan.txt Sample trade confirmation fixture for .NET Part 3
dotnet/samples/02-agents/Harness/BuildYourOwnClaw/Claw_Step03_ScalingCapabilities/working/confirmations/copy of trade (3).txt Sample trade confirmation fixture for .NET Part 3
dotnet/samples/02-agents/Harness/BuildYourOwnClaw/Claw_Step03_ScalingCapabilities/working/confirmations/conf_AAPL.txt Sample trade confirmation fixture for .NET Part 3
dotnet/samples/02-agents/Harness/BuildYourOwnClaw/Claw_Step03_ScalingCapabilities/working/confirmations/2025-06-21_nvda.txt Sample trade confirmation fixture for .NET Part 3
dotnet/samples/02-agents/Harness/BuildYourOwnClaw/Claw_Step03_ScalingCapabilities/TradingTools.cs Approval-required “place_trade” tool wrapper (.NET)
dotnet/samples/02-agents/Harness/BuildYourOwnClaw/Claw_Step03_ScalingCapabilities/SubprocessScriptRunner.cs .NET subprocess runner for file-based skill scripts
dotnet/samples/02-agents/Harness/BuildYourOwnClaw/Claw_Step03_ScalingCapabilities/StockTools.cs Mock stock quote tool providing price + trailing EPS (.NET)
dotnet/samples/02-agents/Harness/BuildYourOwnClaw/Claw_Step03_ScalingCapabilities/skills/valuation/SKILL.md Valuation skill definition/instructions (.NET sample content)
dotnet/samples/02-agents/Harness/BuildYourOwnClaw/Claw_Step03_ScalingCapabilities/skills/valuation/scripts/valuation_metrics.py Valuation computation script (packaged with .NET sample)
dotnet/samples/02-agents/Harness/BuildYourOwnClaw/Claw_Step03_ScalingCapabilities/skills/valuation/references/valuation-guide.md Valuation reference guide (.NET sample content)
dotnet/samples/02-agents/Harness/BuildYourOwnClaw/Claw_Step03_ScalingCapabilities/skills/risk-scoring/SKILL.md Risk-scoring skill definition/instructions (.NET sample content)
dotnet/samples/02-agents/Harness/BuildYourOwnClaw/Claw_Step03_ScalingCapabilities/skills/risk-scoring/scripts/risk_score.py Risk scoring script (packaged with .NET sample)
dotnet/samples/02-agents/Harness/BuildYourOwnClaw/Claw_Step03_ScalingCapabilities/skills/risk-scoring/references/risk-bands.md Risk band reference guide (.NET sample content)
dotnet/samples/02-agents/Harness/BuildYourOwnClaw/Claw_Step03_ScalingCapabilities/ResearchAgent.cs Background web-search-only research sub-agent builder (.NET)
dotnet/samples/02-agents/Harness/BuildYourOwnClaw/Claw_Step03_ScalingCapabilities/README.md .NET Part 3 sample documentation (run instructions + features)
dotnet/samples/02-agents/Harness/BuildYourOwnClaw/Claw_Step03_ScalingCapabilities/Program.cs .NET Part 3 runnable sample wiring skills/shell/codeact/background agents
dotnet/samples/02-agents/Harness/BuildYourOwnClaw/Claw_Step03_ScalingCapabilities/FoundrySkills.cs Helper to connect to Foundry Toolbox MCP for centrally-managed skills
dotnet/samples/02-agents/Harness/BuildYourOwnClaw/Claw_Step03_ScalingCapabilities/Claw_Step03_ScalingCapabilities.csproj New .NET sample project + content copying of skills/working data
dotnet/agent-framework-dotnet.slnx Adds the new .NET sample project to the solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Usage: [Issues, PRs], Target: documentation in the code base and learn docs .NET Usage: [Issues, PRs], Target: .Net python Usage: [Issues, PRs], Target: Python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants