Agents
Agent types, built-in agents, permissions, sessions, and handing work off in VS Code
title: "Agents" description: "Agent types, built-in agents, permissions, sessions, and handing work off in VS Code" 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, terminal-based | Well-defined tasks while you keep working |
| Cloud | GitHub servers | Creating PRs, team collaboration, working from issues |
| Third-party harnesses | Anthropic Claude, OpenAI Codex | Provider-specific agent workflows (availability depends on your setup) |
A harness provides the tools and workflows of an agent and is separate from the model you pick. Changing the model does not change the harness.
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 |
| Start work from a GitHub issue | Cloud agent |
| Use Anthropic or OpenAI agents specifically | Claude or Codex harness |
Built-in Agents
Select from the agent picker in the Chat view (Ctrl+Alt+I):
- Agent — autonomously plans and implements changes across files, runs terminal commands, invokes tools
- Plan — researches a change and proposes a structured approach before implementation (also
/plan) - Ask — answers questions about your codebase or VS Code without making file changes
You can also create custom agents (.agent.md files, for example in .github/agents/) with specific roles, tools, and model preferences.
Permission Levels
| Level | Behavior |
|---|---|
| Manual permissions (default) | Uses your tool, URL, and terminal approval settings; anything not auto-approved asks for confirmation |
| Allow all | Runs all tool calls without confirmation; a warning appears the first time you select it |
| Autopilot | An agent mode (not a permission level): auto-approves tools, retries on errors, and answers questions that would otherwise block |
Set the default with chat.permissions.default. /yolo (or /autoApprove) bypasses approvals for the current session and /disableYolo restores the default.
Sandboxing restricts file system and network access for terminal commands and still applies under Allow all and Autopilot. It is Preview on macOS, Linux, and WSL2 and Experimental on Windows. Terminal auto-approval is a convenience, not a security boundary.
Handing Off Sessions
Plan locally, then offload implementation:
Common pattern: Local agent (explore/plan) → Copilot CLI or Cloud agent (implement) → pull request for review
Use /fork to copy a conversation into a new session, or Fork Conversation on a request to branch from a checkpoint.
Steer Copilot CLI Sessions Remotely
A running Copilot CLI session can be monitored and steered from GitHub.com or GitHub Mobile:
- In the CLI, run
/remote on(or start withcopilot --remote) and use the access details it shows - Set
"remoteSessions": truein~/.copilot/settings.jsonto enable it by default - Sessions appear at github.com/copilot/agents, and on the repository's Agents tab when the session is inside a GitHub repository
- The machine must stay online (
/keep-aliveprevents sleep), and you must be signed in to the same account
Manage Sessions
The sessions list in the Chat view shows your sessions with status and change statistics. The Agents window shows sessions across all workspaces, with grouping, pinning, and a side-by-side grid. It also supports remote sessions over SSH or dev tunnels.
For a local session, use the Agent Debug Logs panel to retrace what happened in a run.
Cloud Agent
The cloud agent runs on GitHub servers, works in an ephemeral environment, and returns pull requests. See Cloud Agent for details.
Agents and Tools
Agents use built-in tools plus tools from MCP servers and VS Code extensions. Configure which tools are enabled with the Tools control in the Chat view, and type # in the input to browse them.