NEW: Claude Code Security — research preview →

Agents

Agent types, built-in agents, permissions, sessions, and handing work off in VS Code

Read time: 5 min

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

TypeWhere it runsBest for
LocalYour machine, interactiveIterative work, VS Code tools, MCP servers
Copilot CLIYour machine, terminal-basedWell-defined tasks while you keep working
CloudGitHub serversCreating PRs, team collaboration, working from issues
Third-party harnessesAnthropic Claude, OpenAI CodexProvider-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

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
Start work from a GitHub issueCloud agent
Use Anthropic or OpenAI agents specificallyClaude 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

LevelBehavior
Manual permissions (default)Uses your tool, URL, and terminal approval settings; anything not auto-approved asks for confirmation
Allow allRuns all tool calls without confirmation; a warning appears the first time you select it
AutopilotAn 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 with copilot --remote) and use the access details it shows
  • Set "remoteSessions": true in ~/.copilot/settings.json to 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-alive prevents 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.