foundry-samples / prompt-agents
AGENTS.md476 starsChanged 3 months agoMITView on GitHub
Conventions for AI agents creating or editing declarative prompt and managed-harness agent samples under samples/cli/prompt-agents/. Agents read the nearest AGENTS.md up the tree, so this applies to all samples in this directory. Samples under samples/cli/prompt-agents/ are validated by the CLI prompt-agent pipeline (.azure-pipelines/prompt-agents-samples-ci.yml), not the hosted-agent pipeline (.azure-pipelines/hosted-agents-samples-ci.yml): Every non-excluded sample under samples/cli/prompt-agents/ must either: 1. Provide .azure-pipelines/prompt-agent-tests/cli/<complete-sample-path>/test-spec.yml with a responsible Microsoft alias in sample.owner, supported experiences, deterministic string-input turns, and at least one assistant_text assertion. Do not use raw,…
- Installs packages
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/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/foundry-toolbox/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
4 rules. About 1 is common, 1 is distinctive, and 2 are very specific to this project.
≈1
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 19
Every non-excluded sample under samples/cli/prompt-agents/ must either:
- Very specific: line 24
Do not use raw, session_files, console_log, trace, approvals.mcp, or structured message-array inputs in prompt/managed contracts.
- Distinctive: line 36
Read both references before adding or updating a sample or contract:
- Common: line 41
Run these credential-free checks from the repository root before submitting changes:
≈ “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
Coding Agent Instructions — CLI prompt-agent samples
Conventions for AI agents creating or editing declarative prompt and managed-harness
agent samples under samples/cli/prompt-agents/. Agents read the nearest
AGENTS.md up the tree, so this applies to all samples in this directory.
Choosing the right E2E test contract (prompt/managed vs. hosted)
Samples under samples/cli/prompt-agents/ are validated by the CLI prompt-agent
pipeline (.azure-pipelines/prompt-agents-samples-ci.yml), not the
hosted-agent pipeline (.azure-pipelines/hosted-agents-samples-ci.yml):
| Sample location | Fixture path | Execution profile | Supported turn inputs | Supported assertions |
samples/<python|csharp>/hosted-agents/<path> | .azure-pipelines/hosted-agent-tests/<python|csharp>/<path>/test-spec.yml | hosted | string, JSON mapping, or sequence | assistant_text, raw, session_files, console_log, trace, plus approvals.mcp |
samples/cli/prompt-agents/<path> (no harness) | .azure-pipelines/prompt-agent-tests/cli/<path>/test-spec.yml | prompt | string only | assistant_text only (contains, equals, regex) |
samples/cli/prompt-agents/<path> (harness.type set) | .azure-pipelines/prompt-agent-tests/cli/<path>/test-spec.yml | managed | string only | assistant_text only (contains, equals, regex) |
Every non-excluded sample under samples/cli/prompt-agents/ must either:
- Provide
.azure-pipelines/prompt-agent-tests/cli/<complete-sample-path>/test-spec.ymlwith a responsible Microsoft alias insample.owner, supportedexperiences, deterministic string-input turns, and at least oneassistant_textassertion. Do not useraw,session_files,console_log,trace,approvals.mcp, or structured message-array inputs in prompt/managed contracts;azd ai agent invokeexposes only terminal assistant text, and contract validation rejects unsupported sources even on filtered-out tests. - Or, if the sample requires capabilities outside the prompt CI adapter (such as
client-executed function tools, file-based skills, connections, extra Azure
resources like Azure AI Search, or lifecycle hooks), add an entry with a
non-empty reason in
.azure-pipelines/scripts/prompt-agents/blacklist.json.
References and local validation
Read both references before adding or updating a sample or contract:
- Prompt-agent E2E runner and manifest/contract limits
- Shared
test-spec.ymlschema reference
Run these credential-free checks from the repository root before submitting changes:
python -m pip install -r .github/scripts/requirements.txt
python .github/scripts/hosted_agent_test_spec.py validate \
--spec .azure-pipelines/prompt-agent-tests/cli/<complete-sample-path>/test-spec.yml
python .github/scripts/hosted_agent_test_spec.py plan \
--spec .azure-pipelines/prompt-agent-tests/cli/<complete-sample-path>/test-spec.yml \
--protocol responses \
--profile <prompt|managed> \
--output /tmp/prompt-agent-test-plan.json
python .azure-pipelines/scripts/prompt-agents/discover_samples.py discover --validate-contractsDoes 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.

