NEW: Claude Code Security — research preview

Customization

Custom instructions, agents, prompt files, MCP servers, hooks, and BYOK model keys

Read time: 6 min

title: "Customization" description: "Custom instructions, agents, prompt files, MCP servers, hooks, and BYOK model keys" section: "Copilot" readTime: "6 min"

Customize AI in VS Code

Teach the AI about your codebase, coding standards, and workflows so it generates code that fits from the start.

Open the Chat Customizations Editor

Select the Configure Chat (gear icon) in the Chat view, or run Chat: Open Chat Customizations from the Command Palette (Ctrl+Shift+P).

Five Customization Scenarios

1. Define Coding Standards

Use custom instructions (copilot-instructions.md or *.instructions.md) to share project-wide rules. Always-on instructions apply to every request; file-based instructions target specific file types or folders.

2. Automate Repetitive Tasks

Create prompt files (.prompt.md) for tasks you run often — scaffolding a component, preparing a PR, running a code review. Use agent skills (.skill.md) for multi-step workflows involving scripts and external tools.

3. Specialize the AI

Create custom agents (.agent.md) that adopt specific personas — security reviewer, database admin, planner. Each defines behavior, available tools, and model preferences.

4. Connect External Tools

Add MCP servers via mcp.json to give the AI access to databases, APIs, and services. Use hooks to run shell commands at lifecycle events (e.g., run formatter after every file edit, enforce security policies).

5. Install Plugins

Install agent plugins (Preview) to add pre-packaged bundles: slash commands, skills, custom agents, hooks, and MCP servers in one install.

6. Bring Your Own Model Key (BYOK)

Copilot Business and Enterprise users can link their own API keys to use external models directly in VS Code chat. Supported providers:

ProviderModels available
AnthropicClaude Sonnet 4.5, Opus 4, and others
OpenAIGPT-4o, o3, and others
GoogleGemini 2.5 Pro/Flash
Microsoft FoundryAzure-hosted models
OpenRouter100+ models via one key
Ollama / Foundry LocalLocally-running models

Copilot Free, Pro, and Pro+ users can also link keys. Admins control access via the Bring Your Own Language Model Key policy on GitHub.com.

Getting Started (Incremental)

  1. /init in chat → generates copilot-instructions.md tailored to your codebase
  2. Add *.instructions.md files for language/framework-specific rules (with applyTo patterns)
  3. Create prompt files for common workflows; add MCP servers for external services
  4. Build custom agents for specialized roles
  5. Use /create-prompt, /create-instruction, /create-skill, /create-agent, /create-hook in chat to generate files with AI assistance

Generate Customizations from Natural Language

Describe what you want in plain English and Copilot drafts the customization file for you:

Create a custom agent that acts as a database administrator focused on PostgreSQL query optimization

Copilot generates a ready-to-use .agent.md file. The same works for instructions, skills, and hooks.

Control Skill Visibility with skillOverrides

The skillOverrides setting lets you change how skills appear without editing their source files — useful for shared project skills or plugin-provided skills:

// .vscode/settings.json
{
  "github.copilot.chat.skillOverrides": {
    "legacy-context": "name-only",
    "deploy": "off"
  }
}
ValueDescription shownUser-invocable
"on" (default)Full name + descriptionYes
"name-only"Name onlyYes
"user-invocable-only"Hidden from menuYes
"off"Hidden entirelyNo

Monorepo Support

Enable chat.useCustomizationsInParentRepositories to discover customization files from parent repositories when you open a subfolder. VS Code walks up the tree to the .git root and collects all instruction files, prompt files, and agents.

Troubleshooting

If customizations are not applied: Chat view ... menu → Show Agent Debug Logs to inspect which files were discovered and loaded.