Agents
Understanding agent types, built-in agents, and permission levels
title: "Agents" description: "Understanding agent types, built-in agents, and permission levels" section: "Copilot" readTime: "5 min"
Agents in VS Code
An agent takes a high-level goal, breaks it into steps, edits files across your project, runs commands, and self-corrects when something goes wrong.
Four Agent Types
| Type | Where it runs | Best for |
|---|---|---|
| Local | Your machine, interactive | Iterative work, VS Code tools, MCP servers |
| Copilot CLI | Your machine, background | Well-defined tasks while you keep working |
| Cloud | GitHub servers | Creating PRs, team collaboration, assigning issues |
| Third-party | Provider (Anthropic/OpenAI) | Claude Code, OpenAI Codex workflows |
Which Agent Type to Use
| Task | Use |
|---|---|
| Brainstorm or iterate interactively | Local agent |
| Get answers about my codebase | Local agent (Ask) |
| Create an implementation plan | Local agent (Plan) |
| Fix test failures, linting errors | Local agent |
| Run while I keep working | Copilot CLI or Cloud |
| Create a PR for team review | Cloud agent |
| Assign a GitHub issue to an agent | Cloud agent |
| Use Anthropic or OpenAI specifically | Third-party agent |
Three Built-in Agents
Select from the agent picker in the Chat view (Ctrl+Shift+I):
- Agent — autonomously plans and implements changes across files, runs terminal commands, invokes tools
- Plan — creates a structured step-by-step implementation plan. Hand off to an implementation agent when ready
- Ask — answers questions about your codebase or VS Code without making file changes
You can also create custom agents (.agent.md files) with specific roles, tools, and model preferences.
Permission Levels
| Level | Behavior |
|---|---|
| Default Approvals | Read-only and safe tools auto-approved; destructive actions require confirmation |
| Bypass Approvals | All tool calls auto-approved; agent may ask clarifying questions |
| Autopilot (Preview) | All tools auto-approved, auto-responds to questions, runs to completion |
Handing Off Sessions
Switch agent type mid-task without losing context:
- Select a different agent type from the session type dropdown in the chat input
- VS Code creates a new session carrying full conversation history
- The original session is archived
Common handoff pattern: Local agent (explore/plan) → Copilot CLI (implement in background) → Cloud agent (open PR)
Monitor Copilot CLI Sessions Remotely
Start a Copilot CLI session in VS Code, then continue steering it from GitHub.com or the mobile app.
Enable it in Settings: github.copilot.chat.cli.remote.enabled, then run /remote on in chat.
This lets you kick off a long-running task, close your laptop, and check progress — or steer — from your phone.
Manage Sessions
The Sessions view in the Chat panel lists all active sessions (local, background, cloud). Sessions are sortable and titles sync between VS Code and Copilot CLI. Monitor status, switch between them, review file changes, and pick up where you left off.
Agent debug logs now persist locally across sessions. Use the Agent Debug Log panel to retrace what happened in any previous run.
Cloud Agent
The cloud agent runs on GitHub servers and integrates with GitHub pull requests. Key capabilities:
- Start via REST API — trigger cloud agent tasks programmatically from CI pipelines or scripts
- Auto model selection — the cloud agent picks the best model for the task automatically
- Secrets and variables — pass repo secrets and environment variables to agent sessions
- Usage metrics — track token usage and code review comment types via the API
See Cloud Agent for the full reference.
Agents and Tools
Agents use built-in tools (#edit, #execute, #search, #read) plus tools from MCP servers and VS Code extensions. Configure which tools are enabled via the Tools button in the Chat view.
Rubber Duck (Copilot CLI's conversational debugger) now supports multiple models — switch to a different model mid-session without losing context.