Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Build and deploy AI applications on Azure AI Foundry using Microsoft's model catalog and AI services
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
foundry-agent/observe/references/optimize-deploy.md
1# Steps 6–7 — Optimize Prompt & Deploy New Version23## Step 6 — Optimize Prompt45> ⛔ **Guardrail:** When optimizing after a dataset update, do NOT remove dataset rows or weaken evaluators to recover scores. Score drops on a harder dataset are expected — they mean test coverage improved, not that the agent regressed. Optimize for NEW failure patterns only.67Use **`prompt_optimize`** with:89| Parameter | Required | Description |10|-----------|----------|-------------|11| `developerMessage` | ✅ | Agent's current system prompt / instructions |12| `deploymentName` | ✅ | Model for optimization (e.g., `gpt-4o-mini`) |13| `projectEndpoint` or `foundryAccountResourceId` | ✅ | At least one required |14| `requestedChanges` | | Concise improvement suggestions from cluster analysis |1516**Example `requestedChanges`:** *"Be more specific when answering geography questions"*, *"Always cite sources when providing factual claims"*1718> Use the optimized prompt returned by the tool. Do NOT manually rewrite.1920## Step 7 — Deploy New Version2122> **Always confirm before deploying.** Show the user a diff or summary of prompt changes and wait for explicit sign-off.2324After approval:25261. Use **`agent_update`** to create a new agent version with the optimized prompt272. Use **`agent_get`** to verify the updated version is `running`283. If the updated version is not `running`, read and follow the [troubleshoot skill](../../troubleshoot/troubleshoot.md) before continuing2930## Next Steps3132When the new version is running → proceed to [Step 8: Re-Evaluate](compare-iterate.md).33