{"id":253199,"date":"2025-05-13T10:26:51","date_gmt":"2025-05-13T17:26:51","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/visualstudio\/?p=253199"},"modified":"2025-05-20T16:27:33","modified_gmt":"2025-05-20T23:27:33","slug":"agent-mode-has-arrived-in-preview-for-visual-studio","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/visualstudio\/agent-mode-has-arrived-in-preview-for-visual-studio\/","title":{"rendered":"Agent mode has arrived in preview for Visual Studio"},"content":{"rendered":"<p><strong>Plan, build, test, and fix \u2014 all from one prompt.<\/strong><\/p>\n<p><div  class=\"d-flex justify-content-left\"><a class=\"cta_button_link btn-primary mb-24\" href=\"https:\/\/visualstudio.microsoft.com\/vs\/downloads\/\" target=\"_blank\">Download Visual Studio 17.14<\/a><\/div><\/p>\n<p><strong>Agent mode<\/strong> is now available in <strong>public preview<\/strong> for all users in Visual Studio 17.14. Agent mode in Visual Studio allows you to define tasks using natural language, with Copilot autonomously planning, editing your codebase, invoking tools, and iterating to resolve issues. Unlike Copilot Chat or Edits, agent mode doesn\u2019t stop at one suggestion or file edit but works iteratively until the task is complete.<\/p>\n<p><iframe title=\"Introducing agent mode in Visual Studio\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/7_duh0HoT9o?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/p>\n<h2>What can agent mode do?<\/h2>\n<p>Agent mode doesn\u2019t just help you write code \u2014 it helps you finish the job. All of this is done iteratively, meaning that Copilot will continue to examine and perform your task on its own output and the result of that output until it completes your prompt. This means agent mode can:<\/p>\n<ul>\n<li>\ud83d\udca1<strong>Autonomously determine the relevant context<\/strong> and files to edit.<\/li>\n<li>\ud83d\udcbb <strong>Suggest terminal commands<\/strong> for you to approve and run.<\/li>\n<li>\ud83d\udd01 <strong>Iterate<\/strong> until the task is complete \u2014 checking for errors, and running builds\/tests to validate results.<\/li>\n<li>\ud83d\udce1 <strong>Invoke trusted tools via MCP servers<\/strong> \u2014 including linters, test runners, and static analyzers in your dev environment.<\/li>\n<\/ul>\n<p>We\u2019re also simplifying the Copilot experience by making agent mode the new default way to apply code changes. You can think of agent mode as the next evolution of Edits which developers have come to love in GitHub Copilot chat with even more power!<\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-253200\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2025\/05\/word-image-253199-1.png\" alt=\"Agent mode turned on in VS\" width=\"500\" height=\"291\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2025\/05\/word-image-253199-1.png 500w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2025\/05\/word-image-253199-1-300x175.png 300w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/p>\n<h2>How to enable it<\/h2>\n<p>Agent mode is off by default in this preview phase. To turn it on:<\/p>\n<ol>\n<li>Use Visual Studio 17.14 GA or later<\/li>\n<li>Go to Feature Search (Ctrl + Q)<\/li>\n<li>Search: agent<\/li>\n<li>Enable: Copilot Chat: Agent Enabled<\/li>\n<li>In the Copilot Chat window switch to \u201cAgent\u201d and try a high-level prompt. You can access the Copilot Chat window from the Copilot badge in the upper right of the IDE.<\/li>\n<\/ol>\n<h2>Using agent mode<\/h2>\n<p>Agent mode is a powerful tool that can be applied in many scenarios. It can create apps from scratch, refactor code across multiple files, write and run tests, generate documentation, integrate new libraries, implement terminal-heavy tasks, and answer questions about complex codebases. It enhances productivity by orchestrating your development flow while keeping you in control. When determining if agent mode is the right tool for the job, consider the following.<\/p>\n<ul>\n<li><strong>Edit scope<\/strong>: Agent mode takes the reins, autonomously searching your codebase and determining the relevant context and files to edit.<\/li>\n<li><strong>Task complexity<\/strong>: For intricate tasks that go beyond simple code edits, agent mode shines. It handles tool invocations and terminal commands, making it ideal for complex projects.<\/li>\n<li><strong>Duration<\/strong>: Agent mode is thorough, involving multiple steps to process a request. It might take longer to get a response as it determines the context, plans the action, and more.<\/li>\n<li><strong>Self-iteration<\/strong>: One of the standout features of agent mode is its ability to evaluate the outcome of generated edits and iterate multiple times to resolve intermediate issues.<\/li>\n<li><strong>Multiple requests<\/strong>: Depending on the complexity of the task, agent mode might result in multiple requests to the backend from a single prompt.<\/li>\n<\/ul>\n<p><span data-contrast=\"auto\">Once you&#8217;ve determined that agent mode is the right tool for the job, you just need to give it a good prompt. Here are some example prompts to give you an idea of what you can ask the agent to do:<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<ul>\n<li><span data-contrast=\"auto\">&#8220;Add error handling to this API&#8221;<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/li>\n<li><span data-contrast=\"auto\">&#8220;Convert this project to use environment variables&#8221;<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/li>\n<li><span data-contrast=\"auto\">&#8220;Write tests for this class and fix anything that fails&#8221;<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/li>\n<li><span data-contrast=\"auto\">\u00a0&#8220;Add structured logging with Serilog&#8221;<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/li>\n<li><span data-contrast=\"auto\">&#8220;Replace <\/span><span data-contrast=\"auto\">HttpClient<\/span><span data-contrast=\"auto\"> with <\/span><span data-contrast=\"auto\">IHttpClientFactory&#8221;<\/span><\/li>\n<\/ul>\n<p>A key to better, more accurate responses from Copilot is providing it with sufficient context about your preferred coding standards, team preferences, libraries, and more. You can provide this context with <strong>custom instructions<\/strong>. The custom instructions feature enables you to automatically add pre-specified contextual details to your chat questions. To configure custom instructions, follow the <a href=\"https:\/\/learn.microsoft.com\/visualstudio\/ide\/copilot-chat-context?view=vs-2022#enable-custom-instructions\">documentation instructions<\/a>.<\/p>\n<h2>Boost agent mode with MCP servers<\/h2>\n<p>This release further extends the power of agent mode by supporting <a href=\"https:\/\/modelcontextprotocol.io\/introduction\">Model Context Protocol (MCP<\/a>) servers. MCP servers provide additional context to the Copilot agent and give it access to tools, data, and resources. The MCP website describes MCP as a universal adaptor for AI applications. In the same way that a universal adaptor lets you connect your physical devices to accessories, MCP lets you connect AI applications to other data and tools without needing to build a custom connection to each data source. For example, you can connect directly to your database and analyze schemes, pull in information for GitHub repos such as issues and pull requests, automate end-to-end testing with Playwright, or you can even build your own with several SDKs including C#! <span data-contrast=\"auto\">Here are a few other examples of what you can do with MCP servers:<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<p><b><span data-contrast=\"auto\">Interact with your cloud environment<\/span><\/b><span data-contrast=\"auto\">: For example, the official Azure MCP server gives access to list, query, and interact with services and tools like Azure Storage, Cosmos DB, the Azure CLI, and more.<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<p><b><span data-contrast=\"auto\">Query and manage database: <\/span><\/b><span data-contrast=\"auto\">Execute queries against Cosmos DB containers, get Azure Storage container properties and metadata, and manage blob containers and blobs.<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<p><b><span data-contrast=\"auto\">Search and manage version control platform<\/span><\/b><span data-contrast=\"auto\">: For example, the GitHub API allows batch creation of issues or batch updates of files, can search for code and issues across GitHub repositories, and more.<\/span><span data-ccp-props=\"{&quot;134233117&quot;:false,&quot;134233118&quot;:false,&quot;201341983&quot;:0,&quot;335551550&quot;:1,&quot;335551620&quot;:1,&quot;335559685&quot;:0,&quot;335559737&quot;:0,&quot;335559738&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-253201\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2025\/05\/word-image-253199-2.jpeg\" alt=\"Filter tools options for agent mode\" width=\"987\" height=\"621\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2025\/05\/word-image-253199-2.jpeg 987w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2025\/05\/word-image-253199-2-300x189.jpeg 300w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2025\/05\/word-image-253199-2-768x483.jpeg 768w\" sizes=\"(max-width: 987px) 100vw, 987px\" \/><\/p>\n<h2>More updates with new monthly release schedule for Copilot<\/h2>\n<p>We\u2019re constantly evolving to get Copilot features out so that you, the developer, are never behind. As such, we\u2019re excited to announce that Visual Studio is moving to a monthly release schedule for Copilot updates. You can access the latest Copilot updates by continuing to update Visual Studio to the latest version.<\/p>\n<h3>Check out the new Visual Studio Hub<\/h3>\n<p>Stay connected with everything Visual Studio in one place! Visit the <a href=\"https:\/\/visualstudio.microsoft.com\/hub\/\">Visual Studio Hub<\/a> for the latest release notes, YouTube videos, social updates, and community discussions.<\/p>\n<h3>Appreciation for your feedback<\/h3>\n<p>Your feedback helps us improve Visual Studio, making it an even more powerful tool for developers. We are immensely grateful for your contributions and look forward to your continued support. By sharing your thoughts, ideas, and any issues you encounter through <a href=\"https:\/\/developercommunity.visualstudio.com\/VisualStudio\">Developer Community<\/a>, you help us improve and shape the future of Visual Studio.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Plan, build, test, and fix \u2014 all from one prompt. Agent mode is now available in public preview for all users in Visual Studio 17.14. Agent mode in Visual Studio allows you to define tasks using natural language, with Copilot autonomously planning, editing your codebase, invoking tools, and iterating to resolve issues. Unlike Copilot Chat [&hellip;]<\/p>\n","protected":false},"author":99474,"featured_media":253214,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[6887,6888,6967,6963,155],"tags":[6986,6973,6924],"class_list":["post-253199","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-artificial-intelligence","category-copilot","category-github-copilot","category-productivity","category-visual-studio","tag-agent-mode","tag-ai-agents","tag-github-copilot"],"acf":[],"blog_post_summary":"<p>Plan, build, test, and fix \u2014 all from one prompt. Agent mode is now available in public preview for all users in Visual Studio 17.14. Agent mode in Visual Studio allows you to define tasks using natural language, with Copilot autonomously planning, editing your codebase, invoking tools, and iterating to resolve issues. Unlike Copilot Chat [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/posts\/253199","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/users\/99474"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/comments?post=253199"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/posts\/253199\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/media\/253214"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/media?parent=253199"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/categories?post=253199"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/tags?post=253199"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}