Build with agents in VS Code
Visual Studio Code comes with AI agents built in. Describe what you want to build, and an agent plans the approach, writes the code, and verifies the result across your entire project. Agents handle tasks end-to-end: build features across multiple files, debug and fix failing tests, refactor between frameworks, test web apps with the integrated browser, or ship a pull request for team review.
Choose how you work
VS Code gives you two surfaces for working with agents. Pick the one that fits your current task and switch freely between them. Both share the same agent sessions, settings, and keybindings, so switching costs nothing.
Agent-first
Orchestrate agents across projects with chat as the primary interface.
Code-first
Agents assist alongside your editor, debugger, and extensions.
Switch anytime
Both surfaces share sessions, settings, and keybindings. Move between them freely.
Run any agent with any model
Agents run where the work needs to happen. Run them locally for interactive work, in the background for autonomous tasks, in the cloud for team collaboration through pull requests, or through third-party providers like Anthropic and OpenAI. Hand off a task from one agent type to another at any point, and the relevant context carries over.

Pick from dozens of models across OpenAI, Anthropic, Google, and more, or bring your own API key to use any model from any provider. Switch models at any time without changing your workflow. Learn more about agent types and language models.
Make agents work your way
Agents work best when they understand your project's conventions and have the right tools. VS Code gives you several ways to tailor agents so they produce code that fits your codebase and team practices from the start.
Custom instructions
Define coding standards and conventions so agents generate code that matches your style.
Custom agents
Create agents with a specific role, such as a code reviewer or documentation writer.
Agent skills
Teach agents specialized capabilities that work across VS Code, CLI, and cloud agents.
MCP servers
Connect external tools and services so agents can access databases, APIs, and more.
Learn more about customizing agents.
Trust and control
Agents can read and edit files, run terminal commands, and call external services. VS Code keeps you in control: approve or deny tool calls before they run, set a permission level that matches the autonomy you are comfortable with, and enable agent sandboxing to restrict file system and network access at the OS level. Learn more about trust and safety and AI security.
Organizations can centrally manage which AI features, models, and tools are available across their teams. Admins define policies that control agent capabilities, restrict MCP servers or extensions, and enforce compliance requirements, so developers get a consistent, governed experience out of the box. Learn more about enterprise AI policies.
Get started
AI features are built into VS Code. To enable them, sign in with your GitHub account:
- Hover over the Copilot icon in the Status Bar and select Use AI Features.
- Follow the prompts to sign in. If you don't have a subscription yet, you are signed up for the free plan with monthly limits on suggestions and chat.
- You can now use AI features in VS Code.
You can also bring your own API key to use models from any provider without a Copilot subscription. Learn more about language models.
For detailed setup options, including GitHub Enterprise accounts and disabling AI features, see Set up GitHub Copilot.