foundry-samples / foundry-toolbox
AGENTS.md476 starsChanged 3 months agoMITView on GitHub
- Keep the sample focused on one Agent Framework agent consuming one dedicated, read-only Foundry Toolbox with anonymous Microsoft Learn and native Bing-backed Foundry Web Search. Only public search terms and URLs belong in tool arguments. Write actions, interactive consent, approval cards, workflows, and conversation history are out of scope. - agent/app.py uses ActivityAgentServerHost(digital_worker=True) and its unmodified M365 stack. Preserve /activity/messages, the Teams selectors, and separate azd deploy / azd ai agent publish workflows. - Create the agent and FoundryToolbox…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,542 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository294 other files it gives its agents.
- samples/cli/prompt-agents/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/agent-framework/a2a/01-delegation/caller/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/agent-framework/a2a/01-delegation/executor/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/agent-framework/agent-skills/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/agent-framework/azure-search-rag/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/agent-framework/browser-automation/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/agent-framework/egress-control/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/agent-framework/file-tools/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/agent-framework/foundry-memory-rag/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/agent-framework/foundry-toolbox-mcp-skills/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/agent-framework/foundry-toolbox-server-side/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/agent-framework/harness-data-processing/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/agent-framework/harness-research/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/agent-framework/harness-scaling-capabilities/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/agent-framework/hello-world/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/agent-framework/invocations-echo-agent/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/agent-framework/local-tools/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/agent-framework/mcp-tools/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/agent-framework/observability/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/agent-framework/resilient-workflow/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/agent-framework/simple-agent/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/agent-framework/steerable-workflow/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/agent-framework/steering/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/agent-framework/teams-activity/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/agent-framework/text-search-rag/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/agent-framework/toolbox-auth-paths/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/agent-framework/workflows/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/bring-your-own/invocations/HelloWorld/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/bring-your-own/invocations/human-in-the-loop/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/bring-your-own/invocations/notetaking-agent/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/bring-your-own/invocations_ws/HelloWorld/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/bring-your-own/responses/background-agent/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/bring-your-own/responses/browser-automation/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/bring-your-own/responses/env-vars-agent/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/bring-your-own/responses/HelloWorld/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/bring-your-own/responses/notetaking-agent/AGENTS.mdAGENTS.md
- samples/csharp/hosted-agents/bring-your-own/responses/openai-computer-tool/AGENTS.mdAGENTS.md
- samples/python/autopilot-agents/hello-world/AGENTS.mdAGENTS.md
- samples/python/autopilot-agents/meeting-assistant/AGENTS.mdAGENTS.md
- samples/python/hosted-agents/agent-framework/a2a/01-delegation/caller/AGENTS.mdAGENTS.md
- samples/python/hosted-agents/agent-framework/a2a/01-delegation/executor/AGENTS.mdAGENTS.md
- samples/python/hosted-agents/agent-framework/invocations/01-basic/AGENTS.mdAGENTS.md
- samples/python/hosted-agents/agent-framework/invocations/02-content-safety-guardrail/AGENTS.mdAGENTS.md
- samples/python/hosted-agents/agent-framework/responses/01-basic/AGENTS.mdAGENTS.md
- samples/python/hosted-agents/agent-framework/responses/02-tools/AGENTS.mdAGENTS.md
- samples/python/hosted-agents/agent-framework/responses/04-foundry-toolbox/AGENTS.mdAGENTS.md
- samples/python/hosted-agents/agent-framework/responses/05-workflows/AGENTS.mdAGENTS.md
- samples/python/hosted-agents/agent-framework/responses/06-files/AGENTS.mdAGENTS.md
- samples/python/hosted-agents/agent-framework/responses/07-skills/AGENTS.mdAGENTS.md
- samples/python/hosted-agents/agent-framework/responses/07-teams-activity/AGENTS.mdAGENTS.md
- samples/python/hosted-agents/agent-framework/responses/08-observability/AGENTS.mdAGENTS.md
- samples/python/hosted-agents/agent-framework/responses/09-declarative-customer-support/AGENTS.mdAGENTS.md
- samples/python/hosted-agents/agent-framework/responses/10-downstream-azure/AGENTS.mdAGENTS.md
- samples/python/hosted-agents/agent-framework/responses/11-azure-search-rag/AGENTS.mdAGENTS.md
- samples/python/hosted-agents/agent-framework/responses/12-foundry-skills/AGENTS.mdAGENTS.md
- samples/python/hosted-agents/agent-framework/responses/13-foundry-memory/AGENTS.mdAGENTS.md
- samples/python/hosted-agents/agent-framework/responses/14-browser-automation-agent/AGENTS.mdAGENTS.md
- samples/python/hosted-agents/agent-framework/responses/15-optimization-travel-approver/AGENTS.mdAGENTS.md
- samples/python/hosted-agents/agent-framework/responses/16-content-safety-guardrail/AGENTS.mdAGENTS.md
- The first 60 shown.
The file
We split this AGENTS.md into the rules it gives an agent
9 rules. About 1 is common, 5 are distinctive, and 3 are very specific to this project.
≈1
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 3
Keep the sample focused on one Agent Framework agent consuming one dedicated, read-only Foundry Toolbox with anonymous Microsoft Learn and …
- Distinctive: line 6
Write actions, interactive consent, approval cards, workflows, and conversation history are out of scope.
- Very specific: line 11
Create the agent and FoundryToolbox inside each Activity turn using agent/toolbox.py:create_agent.
- Common: line 16
Use managed identity for hosted model and Toolbox access, and Azure CLI credentials for local execution.
- Distinctive: line 40
Use a capability-first README: short numbered setup steps, shared Hello World prerequisites and approval guidance, then example questions …
- Distinctive: line 46
Keep local development and offline tests out of the required deployment path.
- Distinctive: line 50
Do not refer to development history or duplicate the full common setup guide.
- Very specific: line 51
Keep requirements.txt fully pinned with cross-platform markers, including transitives.
- Very specific: line 54
Run python -m unittest discover -s tests -v in the sample environment.
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Foundry Toolbox Autopilot
- Keep the sample focused on one Agent Framework agent consuming one dedicated, read-only Foundry Toolbox with anonymous Microsoft Learn and native Bing-backed Foundry Web Search. Only public search terms and URLs belong in tool arguments. Write actions, interactive consent, approval cards, workflows, and conversation history are out of scope.
agent/app.pyusesActivityAgentServerHost(digital_worker=True)and its unmodified M365 stack. Preserve/activity/messages, the Teams selectors, and separateazd deploy/azd ai agent publishworkflows.- Create the agent and
FoundryToolboxinside each Activity turn usingagent/toolbox.py:create_agent. Never share MCP connections across turns: their background tasks inherit caller context at connection time. Preserve the SDK's platform headers for both model and Toolbox calls. Never synthesize user headers or call IDs. - Use managed identity for hosted model and Toolbox access, and Azure CLI credentials for local execution. Neither source requires downstream user credentials, project connections, or secrets. Native Web Search is billed under Bing grounding terms, not a free anonymous external MCP service.
- Validate that
TOOLBOX_ENDPOINTbelongs to the configured Foundry project before sending a bearer token. Keep the positive allowlist inagent/toolbox.pyconsistent withtoolbox.yaml; require both sources. Native Web Search istype: web_search, namedweb_search, with a required stringsearch_query. Preserve source links in its embedded text-resource results. Distinguish official Microsoft guidance from other web sources. - Learn wire names may use
.or___between the server label and tool. Accept only the explicit aliases inTOOL_NAMES, reject duplicate aliases, and use exact discovered names for SDK filtering and calls. Nativeweb_searchis unprefixed; do not add an MCP server label or rename it. - Preserve resource cleanup and explicit errors for empty tools, missing sources, unsupported approval policies, failed calls, and empty model replies.
- AgentServer owns telemetry initialization. Preserve the sensitive-content opt-out and disable only unused OpenAI Agents SDK instrumentation.
- Reuse the sibling guided-provisioning script and create/reuse Bicep pattern.
Provisioning must not alter reused resources or role assignments. Manage the
toolbox separately with
azd ai toolbox create --from-file toolbox.yaml. Preserve its labels and read-only allowlists; copy azd's version-pinned MCP endpoint toTOOLBOX_ENDPOINT. When choosing a new version, refresh the endpoint fromazd ai toolbox show --output jsonand redeploy. - Use a capability-first README: short numbered setup steps, shared Hello World prerequisites and approval guidance, then example questions and expected Teams replies. Keep the sample-specific Toolbox requirements and provisioning/configuration/deployment commands here. Assume familiarity only with Hello World, not with other samples. Explain Agent Framework's value for this agent's tool handling without sample comparisons. Keep local development and offline tests out of the required deployment path. Focus the demonstration on questions and user-visible answers, not traces or SDK internals. Keep maintenance guidance brief; developer details belong here or in the source, not in a long post-demonstration appendix. Do not refer to development history or duplicate the full common setup guide.
- Keep
requirements.txtfully pinned with cross-platform markers, including transitives. Do not makepywin32unconditional. Use Python 3.13 explicitly; use a fresh virtual environment when changing Python minor versions. - Run
python -m unittest discover -s tests -vin the sample environment. Tests use real SDKs with HTTP test transports; preserve both-source execution, concurrent caller isolation, Activity ingress, cleanup, and failure coverage. Offline transports do not prove live Foundry permissions or hosted deployment.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

