Use Foundry Toolkit Copilot tools for AI agent development
AI agents: See llms.txt for documentation discovery and navigation. Documentation articles are also available as Markdown by appending .md to the article URL. Join VS Code at Microsoft Ignite or catch the sessions online. A year of VS Code, wrapped. Explore the highlights. Use Foundry Toolkit Copilot tools for AI agent development View as Markdown Ask in VS Code Ask in VS Code Insiders Foundry Toolkit adds model and agent development guidance to GitHub Copilot Chat.
Use its tools and skills to choose a model, generate application code, configure local debugging, and prepare evaluation and deployment. This walkthrough develops a Python agent that summarizes text using a model deployed in Microsoft Foundry. You first check the model in the Playground, then ask Copilot to create code that uses that deployment. Testing and cloud deployment remain separate steps. The guidance tools return instructions and best practices to Copilot.
Copilot uses those instructions with its other tools to propose code changes or run commands. A tool response alone does not mean that code was saved, a test ran, or a service was deployed. Review changes and execution requests before proceeding. If you only need a model client sample, use View Code in the Playground . For a prompt agent configured through instructions and tools rather than a code project, use Agent Builder .
Prerequisites The current public Foundry Toolkit extension and its prerequisites . Access to GitHub Copilot Chat in VS Code . A folder open for the agent project. Use a separate project folder rather than an unrelated application's workspace. Access to a selected Foundry project . You can choose a model during the walkthrough, but need a compatible model deployment before testing inference. Python and the dependencies required by the generated project.
Follow its setup instructions and review the hosted-agent prerequisites before running or deploying it. Remote model requests can consume quota or incur charges even when the agent runs locally. Use non-sensitive test inputs and keep credentials out of prompts and committed files. Enable Copilot tools in Foundry Toolkit Enable the relevant tools so Copilot can use Toolkit guidance while working on your project. Open the Chat view ⌃⌘I (Windows, Linux Ctrl+Alt+I ) .
Select the Copilot harness and Agent role for the session. Run Chat: Open Customizations from the Command Palette, then select Tools . For shared tool-management instructions, see Manage available tools . Find the Foundry Toolkit tools and enable those relevant to your task. Common guidance tools include: Get AI Model Guidance for model discovery and setup guidance. Get Agent Code Generation Best Practices for agent development guidance.
Get Evaluation Code Generation Best Practices for evaluation code guidance. Get Tracing Code Generation Best Practices for instrumentation guidance. Supporting tools provide selected-project context, list deployed models, prepare debugging, and guide evaluation planning. The list is not limited to these four tools. Toolkit also contributes skills , which provide instructions for a broader workflow. You can describe your goal in chat without manually invoking each tool.
Note The model selected in chat powers Copilot. It is separate from the model deployment your generated application calls. Enabling Toolkit tools does not change your application's model or create a deployment. For chat model selection, see Language models in chat . Choose and test a model Get AI Model Guidance supplies Foundry-oriented guidance for discovering models, preparing a deployment, and trying it in Toolkit.
Describe your inputs, expected outputs, hosting requirements, and constraints rather than relying on a fixed default model. Ask Copilot to identify model options for the summarization task: I am building a Python agent that summarizes support notes into three bullet points. Use Foundry Toolkit model guidance to help me choose a Microsoft Foundry model. Check the models already deployed in my selected Toolkit project first.
Explain input limits and trade-offs I should test. Do not create Azure resources. Review the response. List Microsoft Foundry Models returns deployments in the selected project, not every model in the catalog. If you need another model, follow model discovery and deployment and review availability, quota, and access before creating it. Open your chosen deployment in Model Playground . Test a short support note and a longer example with the same summarization instruction.
Check whether the response preserves important details and follows the requested format. Use Compare if you have multiple candidates. Record the deployment name you want the application to use. Model guidance is a starting point, not a benchmark or a promise about cost or quality. Verify the current model's capabilities and lifecycle, then test representative inputs. Playground comparison does not replace repeatable evaluation.
Generate and test agent code Get Agent Code Generation Best Practices supplies instructions that complement the Microsoft Foundry skill. Use it to guide Copilot's code changes for the scenario and model you tested. In the project folder, ask Copilot to create the agent. Replace <deployment-name> with the deployment you selected: Create a Python agent with Microsoft Agent Framework that summarizes support notes into three bullet points.
Use my selected Foundry Toolkit project and its existing model deployment named <deployment-name>. Use Foundry Toolkit agent development guidance. Include setup instructions and VS Code configurations for local debugging with Agent Inspector. Do not provision new Azure resources or deploy the agent yet. Confirm the project and deployment when Copilot requests them. Review the proposed changes before accepting them. Check the instructions, dependencies, credential handling, entry point, and model deployment configuration.
Save the files you intend to keep. For the Python debugging path, check that .vscode configurations are at the workspace root so VS Code can find them. Follow the generated project's setup instructions, then run and test the agent locally . Use its generated debug configuration with F5 when available. In Agent Inspector , send the same support note you tested in the Playground and review the response. Repeat after changing the instructions.
Opening Inspector alone does not start the agent server. Generated code and debug configuration require review and execution; they are not proof that the agent works or is deployed. If you later add tools, test a request that requires a real tool result and inspect its inputs and output. A model-only answer or a mocked result does not verify the live integration. For shared connections and tool prerequisites, use Tool Catalog .
Add evaluation tests After the agent works interactively, add repeatable tests to check whether changes improve the result or introduce regressions. Get Evaluation Code Generation Best Practices provides Python evaluation guidance, with different paths for local tests and Foundry evaluation. Continue the same chat conversation with a concrete evaluation goal: Add local Python evaluation tests for this summarization agent using Foundry Toolkit evaluation guidance.
Check that each result contains three bullet points and preserves the important facts in my sample support notes. Explain which checks are deterministic and which require a judge model. Show the dataset, test code, and run instructions before executing tests. Review the dataset, expected results, evaluator selection, and any judge-model requirements. Then follow Run agent evaluations as tests to execute the suite and inspect results.
For service-side runs, use Run and review evaluations in Foundry . The guidance tool does not itself run your dataset. Application execution, scoring, and storing results are separate actions with their own runtime, model access, and cost requirements. Add tracing Use traces
The rest of this page is on the live site.