> ## Documentation Index
> Fetch the complete documentation index at: https://hobbyist-e43fa225.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create an agent with Microsoft Foundry Toolkit for Visual Studio Code

> Choose a prompt or hosted agent and start with Agent Builder, samples, or GitHub Copilot in Microsoft Foundry Toolkit for Visual Studio Code.

Use Microsoft Foundry Toolkit for Visual Studio Code to configure a prompt
agent or develop a code-based hosted agent. Choose a creation route based on
whether instructions and supported tools meet your needs, or you need custom
runtime logic.

## Prerequisites

* [Install Microsoft Foundry Toolkit for Visual Studio Code](/developer-tools-and-integrations/install-foundry-toolkit-visual-studio-code).
* For agents that use Foundry resources,
  [set up a Foundry project](/developer-tools-and-integrations/set-up-foundry-project-visual-studio-code).
  Follow the guide for your chosen route for model, permission, and runtime
  requirements.
* For Copilot-assisted coding, access to
  [GitHub Copilot in Visual Studio Code](https://code.visualstudio.com/docs/copilot/overview).

## Choose an agent type

Foundry supports [prompt agents and hosted agents](/agents/development-lifecycle#agent-types-in-microsoft-foundry).
Both agent types can use tools and integrate into applications. Prompt agents aren't
limited to prototypes.

| Compare           | Prompt agent                                                                                                  | Hosted agent                                                                             |
| ----------------- | ------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
| Define behavior   | Configure a model, instructions, and supported tools.                                                         | Implement custom logic with a framework or your own code.                                |
| Use it for        | Tasks that instructions and supported tools can handle, such as answering questions or summarizing documents. | Custom orchestration, dependencies, or runtime behavior, such as a multi-agent workflow. |
| What you maintain | The agent configuration and saved versions.                                                                   | The agent code, dependencies, packaging, and deployment configuration.                   |
| Where to start    | Agent Builder.                                                                                                | Hosted-agent samples or Copilot-assisted coding.                                         |

Start with a prompt agent when its configuration options meet your needs.
Choose a hosted agent when you need more control over execution. For details,
see [When to use hosted agents](/agents/hosted-agents#when-to-use-hosted-agents).

## Open Create Agent

Open the creation page to choose how to build your agent.

1. In the Activity Bar, select **Foundry Toolkit**.
2. Under **Developer Tools**, expand **Build**, and select **Create Agent**.

<Frame>
  <img src="https://mintlify.s3.us-west-1.amazonaws.com/hobbyist-e43fa225/images/create-agent.png" alt="Screenshot of Create Agent with options to code from samples, code with Copilot, or build an agent in Agent Builder." />
</Frame>

If Developer Tools uses **Group by Resource**, find **Create Agent** under
**Agent Dev Tools** instead of **Build**.

## Choose a creation route

Select the route that matches your agent type, and then follow its guide to
configure, test, and save or deploy the agent.

| Route                   | Action in Create Agent                                                                                                 | Next guide                                                                                                                                                                                         |
| ----------------------- | ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Agent Builder           | Select **Build an agent** to configure a prompt agent without a hosted-agent code project.                             | [Create a prompt agent](/developer-tools-and-integrations/create-prompt-agent-visual-studio-code).                                                                                                 |
| Hosted-agent samples    | Under **Code an agent from samples**, select a framework or **Browse all samples**. Choose a sample for your scenario. | For code-based orchestration, [create hosted agents](/developer-tools-and-integrations/vs-code-agents-workflow-pro-code). For other scenarios, follow the selected sample's generated `README.md`. |
| Copilot-assisted coding | Select **Code an agent with Copilot** to develop agent code with GitHub Copilot and Foundry skills.                    | [Use the Microsoft Foundry Skill in coding agents](/get-started/use-microsoft-foundry-skill). Review generated code and test it before deployment.                                                 |

Agent Builder also supports locally stored prompts. Their storage, tools, and
evaluation options differ from Foundry prompt agents. See
[Work with local prompts](/developer-tools-and-integrations/create-prompt-agent-visual-studio-code#work-with-local-prompts).

## Choose how to orchestrate or schedule work

For new code-based workflows, use Microsoft Agent Framework through the sample
or Copilot route. To invoke an existing agent on a trigger or schedule, see
[Routines in Foundry Agent Service (preview)](/agents/routines).

<Info>
  Declarative workflows in Microsoft Foundry are in preview and retire on
  December 1, 2026. This retirement doesn't affect code-based orchestration in
  hosted agents. To work with an existing declarative workflow, see
  [Use and migrate declarative agent workflows](/developer-tools-and-integrations/vs-code-agents-workflow-low-code).
</Info>

## Related content

Use these guides as you develop and integrate your agent:

* [Microsoft Foundry Toolkit for Visual Studio Code overview](/developer-tools-and-integrations/get-started-projects-visual-studio-code)
* [Agent development lifecycle](/agents/development-lifecycle)
* [Publish an agent application](/agents/agent-applications)
