NEW: Claude Code Security — research preview

Agents

Understanding agent types, built-in agents, and permission levels

Read time: 5 min

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

TypeWhere it runsBest for
LocalYour machine, interactiveIterative work, VS Code tools, MCP servers
Copilot CLIYour machine, backgroundWell-defined tasks while you keep working
CloudGitHub serversCreating PRs, team collaboration, assigning issues
Third-partyProvider (Anthropic/OpenAI)Claude Code, OpenAI Codex workflows

Which Agent Type to Use

TaskUse
Brainstorm or iterate interactivelyLocal agent
Get answers about my codebaseLocal agent (Ask)
Create an implementation planLocal agent (Plan)
Fix test failures, linting errorsLocal agent
Run while I keep workingCopilot CLI or Cloud
Create a PR for team reviewCloud agent
Assign a GitHub issue to an agentCloud agent
Use Anthropic or OpenAI specificallyThird-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

LevelBehavior
Default ApprovalsRead-only and safe tools auto-approved; destructive actions require confirmation
Bypass ApprovalsAll 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:

  1. Select a different agent type from the session type dropdown in the chat input
  2. VS Code creates a new session carrying full conversation history
  3. 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.