db620d33df
dotnet-build-and-test / dotnet-test-functions (push) Has been cancelled
dotnet-build-and-test / paths-filter (push) Has been cancelled
dotnet-build-and-test / dotnet-build (Debug, windows-latest, net9.0) (push) Has been cancelled
dotnet-build-and-test / dotnet-build (Release, ubuntu-latest, net10.0) (push) Has been cancelled
dotnet-build-and-test / dotnet-build (Release, ubuntu-latest, net8.0) (push) Has been cancelled
dotnet-build-and-test / dotnet-build (Release, windows-latest, net472) (push) Has been cancelled
dotnet-build-and-test / dotnet-test (Release, integration, true, ubuntu-latest, net10.0) (push) Has been cancelled
dotnet-build-and-test / dotnet-test (Release, integration, true, windows-latest, net472) (push) Has been cancelled
dotnet-build-and-test / dotnet-foundry-hosted-it (push) Has been cancelled
dotnet-build-and-test / dotnet-build-and-test-check (push) Has been cancelled
dotnet-build-and-test / Integration Test Report (push) Has been cancelled
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
Scaling its capabilities (Post 3) — .NET
The third runnable sample from the "Build your own claw and agent harness with Microsoft Agent Framework" blog series (Part 3 — Scaling its capabilities). It builds on Post 2's personal finance assistant and makes it more capable along four axes.
What this sample demonstrates
- Skills — finance know-how (
valuation,risk-scoring) is packaged as discoverableSKILL.mdfiles underskills/, which the agent loads on demand. The sample builds its own provider withAgentSkillsProviderBuilder.UseFileSkills([skillsDir], scriptRunner: new SubprocessScriptRunner().RunAsync)so the skills' Python scripts can run, and setsDisableAgentSkillsProvider = trueto replace the harness default. Optionally folds in centrally-managed Foundry skills discovered live from a Foundry Toolbox MCP endpoint viaFoundrySkills.ConnectAsync(...)+UseMcpSkills(...)(opt-in; see below). - Shell — a
LocalShellExecutorconfined to the trade-confirmation vault (working/confirmations/) lets the agent tidy the accumulated confirmation files (reorganize intoyear/month, rename toYYYY-MM-DD_TICKER_BUY|SELL.txt).ConfineWorkingDirectoryre-anchors every command to the vault and aShellPolicydeny-list pre-filters obviously destructive commands. Exposed as therun_shelltool, which prompts for approval before each command runs. (The deny-list is a UX guardrail, not a security boundary — for hard isolation use aDockerShellExecutor.) - CodeAct — a
HyperlightCodeActProvidergives the agent a sandboxed Python interpreter to crunch portfolio numbers by writing and running code. It runs on Hyperlight (a micro-VM), so it requires hardware virtualization. The guest module path is resolved automatically from theHyperlight.HyperlightSandbox.Guest.PythonNuGet package viaPythonGuestModule.GetModulePath(). - Background agents — a lean, web-search-only
ResearchAgentis registered viaHarnessAgentOptions.BackgroundAgents, exposing thebackground_agents_*tools so the main agent can fan out per-ticker research concurrently and aggregate the findings.
Prerequisites
- A Microsoft Foundry project with a deployed model (e.g.
gpt-5.4). - Azure CLI installed and authenticated (
az login). - (For CodeAct) a host with hardware virtualization enabled (Hyperlight runs the Python interpreter in a micro-VM).
Environment variables
export FOUNDRY_PROJECT_ENDPOINT="https://your-project.services.ai.azure.com/api/projects/your-project"
# Optional (defaults to gpt-5.4)
export FOUNDRY_MODEL="gpt-5.4"
# Optional — enable centrally-managed Foundry skills (Foundry Toolbox MCP endpoint URL):
export FOUNDRY_TOOLBOX_MCP_SERVER_URL="https://your-project.services.ai.azure.com/.../toolboxes/your-toolbox/mcp?api-version=v1"
When FOUNDRY_TOOLBOX_MCP_SERVER_URL is not set, the sample runs with the local file skills only and
prints a note.
Running
cd dotnet
dotnet run --project samples/02-agents/Harness/BuildYourOwnClaw/Claw_Step03_ScalingCapabilities
What to expect
The sample starts an interactive loop in execute mode (quick lookups don't need a plan). Try these in order:
Value MSFT for me.— the agent loads thevaluationskill and follows its instructions (reading references and running its script).Score the risk of my portfolio.— the agent readsportfolio.csvand loads therisk-scoringskill./mode plan, thenTidy up my trade confirmations.— switching to plan mode first makes the agent inspectworking/confirmations/and propose a reorganization plan before touching anything; once you approve it switches to execute and uses the shell to reorganize and rename the files, prompting you to approve each command.Work out the total value of my portfolio.— the agent writes and runs Python via CodeAct.Research MSFT, NVDA and SPY and summarize the latest news.— the agent fans the tickers out to the background research agent and aggregates the results.What's the capital of France?— with afinancial-agent-rulesskill published to your Foundry toolbox and Foundry skills enabled (FOUNDRY_TOOLBOX_MCP_SERVER_URL), the agent loads it, recognizes the question is off-topic, and politely declines, steering you back to finance.
See the Part 3 blog post
for more on the financial-agent-rules skill — including the SKILL.md to publish to your Foundry toolbox.