Clarify FAOS optimization guidance and custom evaluator contracts - #2251
Merged
Conversation
Address PR microsoft#2174 review comments by expanding FAOS as Foundry Agent Optimization Service on first use and making the Step 8 Python config snippet copy-paste safe. The minimum contract example now imports os and preserves the app's existing model-selection fallback instead of hard-coding MODEL_DEPLOYMENT_NAME unless that is already what the app uses. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
# Conflicts: # plugin/skills/microsoft-foundry/SKILL.md
When creating custom evaluator prompts, treat the runtime-enforced JSON schema as authoritative: result plus reason. Preserve user-provided rubric text, but remove or normalize conflicting output schemas such as score/reasoning or duplicate OUTPUT FORMAT blocks before calling evaluator_catalog_create. Add observe skill test coverage for the promptText guardrail so future edits keep the result/reason contract visible. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Remove the 0-to-1 scoringType/minScore/maxScore details from the sample custom evaluator prompt. The important guardrail is the output contract: preserve the rubric, but avoid conflicting output schemas because the runtime enforces result/reason. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Restore plugin/skills/microsoft-foundry/SKILL.md from upstream/main so this PR no longer carries a line-ending-only change for the top-level skill file. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Luffy Chen (XOEEst)
marked this pull request as ready for review
May 13, 2026 07:27
Luffy Chen (XOEEst)
requested review from
Xiaofu Huang (XiaofuHuang),
anchenyi,
Ankit Sinha (ankitbko),
Jon Gallant (jongio) and
Christopher T Earley (tendau)
as code owners
May 13, 2026 07:27
Contributor
There was a problem hiding this comment.
Pull request overview
This PR clarifies Microsoft Foundry Agent documentation around (1) the runtime-enforced custom evaluator prompt output contract (result + reason) and (2) FAOS local optimization package structure and environment variable guidance, and adds a unit test intended to enforce the new evaluator-contract guidance.
Changes:
- Update observe/deploy documentation to require custom evaluator prompts to align with the runtime-enforced
result/reasonJSON contract and to remove conflicting user-provided output schemas (e.g.,score/reasoningor duplicate output blocks). - Standardize FAOS optimization guidance for a split-file local
agent_optimizationpackage and tighten guidance around optimization-related environment variables (including avoiding platform-reservedAGENT_*vars in hosted vNext payloads). - Add a unit test asserting the presence of the new evaluator output-contract guidance in docs.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/microsoft-foundry/foundry-agent/observe/unit.test.ts | Adds a unit test intended to enforce documentation requirements for the result/reason custom evaluator output contract. |
| plugin/skills/microsoft-foundry/foundry-agent/observe/references/deploy-and-setup.md | Adds explicit guidance to remove/rewrite conflicting output-format instructions before creating custom evaluators. |
| plugin/skills/microsoft-foundry/foundry-agent/observe/observe.md | Adds a behavioral rule + warning callout documenting the enforced result/reason contract and prohibiting conflicting schemas. |
| plugin/skills/microsoft-foundry/foundry-agent/faos-optimize/references/python-patterns.md | Updates environment variable guidance and documents the canonical split-file agent_optimization package structure. |
| plugin/skills/microsoft-foundry/foundry-agent/faos-optimize/faos-optimize.md | Updates FAOS optimize workflow docs with canonical package structure and env var guidance; fixes table formatting. |
| plugin/skills/microsoft-foundry/foundry-agent/deploy/deploy.md | Adds a deploy workflow callout reinforcing removal of conflicting evaluator output-format instructions. |
vebudumu
approved these changes
May 13, 2026
Justin Gonzales (jugonzales)
approved these changes
May 13, 2026
Luffy Chen (XOEEst)
requested review from
Justin Gonzales (jugonzales) and
vebudumu
and removed request for
Justin Gonzales (jugonzales)
May 13, 2026 21:03
vebudumu
approved these changes
May 13, 2026
Justin Gonzales (jugonzales)
approved these changes
May 13, 2026
Christopher T Earley (tendau)
approved these changes
May 13, 2026
This was referenced May 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request updates documentation and tests for the Microsoft Foundry Agent to clarify and enforce the correct usage of custom evaluator output contracts, improve guidance on environment variable handling, and standardize the structure of the local optimization package. The most important changes are grouped below:
Evaluator Output Contract Enforcement:
deploy.md,observe.md, anddeploy-and-setup.mdto require that custom evaluator prompts use only the runtime-enforcedresultandreasonJSON fields, removing or rewriting any user-provided output-format instructions that conflict (e.g.,score/reasoningschemas or duplicateOUTPUT FORMATblocks). [1] [2] [3] [4]observe/unit.test.tsto verify that documentation enforces theresult/reasonoutput contract and does not allow conflicting schemas.Optimization Package Structure and Environment Variables:
agent_optimizationpackage to a split-file structure (__init__.py,_config.py,_resolver.py) and documented the public API and responsibilities for each file in bothfaos-optimize.mdandpython-patterns.md. [1] [2]FAOS_OPTIMIZATION_*environment variable aliases should not be generated unless explicitly requested; onlyAGENT_OPTIMIZATION_*andOPTIMIZATION_CONFIGare part of the base contract.AGENT_*variables in user-authoredagent.yamlfiles, especially for hosted agent vNext, and to document rather than inject optional optimization variables by default. [1] [2]Formatting and Table Consistency:
faos-optimize.mdandpython-patterns.md. [1] [2] [3]These changes help ensure that custom evaluators are compatible with the enforced output schema, reduce configuration errors in deployment, and make the optimization package easier to maintain and extend.This pull request clarifies and enforces the output contract for custom evaluator prompts in the Microsoft Foundry Agent documentation and tests. It ensures that all custom evaluator prompts conform to the runtime-enforced JSON schema (
resultandreason) and removes or rewrites any conflicting user-provided output instructions. The changes also update related documentation to guide users on proper evaluator prompt formatting and add unit tests to verify these requirements.Evaluator Prompt Output Contract Enforcement:
observe.md,deploy.md, anddeploy-and-setup.mdto require that custom evaluator prompts use only the runtime-enforced output schema:resultandreason. All conflicting user instructions (e.g.,score/reasoning, duplicate output blocks, or alternate JSON schemas) must be removed or rewritten before creating evaluators. [1] [2] [3]promptTextfor custom evaluators.Testing and Validation:
observe/unit.test.tsto verify that the documentation and reference files require the custom evaluator output contract and prohibit conflicting schemas.These changes help prevent schema mismatches and ensure consistent evaluator behavior across the Foundry Agent workflow.## Description
Checklist
cd tests && npm test)npm run test:skills:integration -- <skill>)USE FOR/DO NOT USE FOR/PREFER OVERclauses: confirmed no routing regressions for competing skillsRelated Issues