How to Ship Production-Ready Features with VS Code Autopilot (Without Getting Hacked)
VS Code’s new Autopilot mode lets an AI agent run autonomously in Copilot Chat — automatically approving tool calls, retrying errors, and answering its own prompts until the task is marked complete. Combined with the new weekly Stable release cadence, it gives builders a faster feedback loop for agentic coding while forcing us to treat AI agents as semi-trusted collaborators that can execute arbitrary commands on our machines.
Why this matters for builders
Autopilot is the first permission level in Copilot Chat that removes all manual gates. It sits above “Default” and “Bypass Approvals” and is designed for long-running, multi-step tasks where constant interruptions kill momentum. Microsoft intends to make the Autopilot option available by default (you still have to explicitly choose it per chat).
This unlocks a new workflow: you describe a feature once, walk away, and return to a completed implementation, tests, and PR description. The risk is obvious — non-deterministic agents + full filesystem/terminal access + auto-approval = prompt injection or tool-poisoning attacks become far more dangerous.
Google’s simultaneous launch of Auto Approve Mode in Gemini Code Assist, complete with dire documentation warnings, shows the entire industry is racing toward agentic coding while still figuring out the safety model.
When to use Autopilot
Use it when:
- You need to implement a well-scoped, multi-file feature (refactoring, new API endpoint + client + tests, migration across 12 files)
- The task is deterministic enough that you can give clear success criteria
- You are working inside a sandboxed environment (dev container or terminal sandbox on macOS/Linux)
- You have a strong review process before merging anything the agent touches
Avoid it when:
- You’re touching security-sensitive code, production keys, or customer data
- The task involves third-party MCP tools you didn’t write yourself
- You’re on Windows without additional sandboxing
- The requirements are ambiguous or likely to change mid-task
The full process — Ship safely with Autopilot
1. Define the goal (10 minutes)
Write a one-page spec before touching the AI.
Good spec template:
## Goal
Implement X so that Y happens.
## Success criteria
- [ ] Unit test coverage >85% for new code
- [ ] All existing tests still pass
- [ ] Follows existing architecture patterns
- [ ] No new dependencies
- [ ] Documentation updated in README.md
- [ ] Performance impact < 5ms on hot path
## Out of scope
- Internationalization
- Error telemetry
2. Shape the prompt (the most important 5 minutes)
Craft a system prompt that acts as a contract. Save this as agent-prompt.md in your repo.
You are an expert full-stack engineer. Follow these rules strictly:
1. Never guess. If anything is unclear, ask ONE clarifying question and stop.
2. Before writing any code, output a plan as a markdown checklist.
3. Only use tools after I confirm the plan.
4. Every change must be accompanied by a test.
5. Use existing patterns and naming conventions from the codebase.
6. When complete, output a concise PR description and list of files changed.
Current task: [paste your spec here]
Start a new Copilot Chat in Autopilot mode and paste the entire prompt + spec.
3. Scaffold safely
First interaction should always be in Default or Bypass Approvals mode:
- Open Copilot Chat
- Set permission level to Bypass Approvals (not full Autopilot yet)
- Paste your agent prompt + spec
- Let it output the plan only
Review the plan. Only switch to Autopilot after you approve the plan.
4. Implement with Autopilot
Once the plan looks solid:
- Switch permission level to Autopilot
- Tell the agent: “Plan approved. Execute the full plan using Autopilot.”
- Walk away or work on something else
The agent will now:
- Call tools without asking
- Retry failures automatically
- Answer its own tool questions
- Continue until it believes the task is done
5. Validate ruthlessly
Never merge without this checklist:
- Run the full test suite locally (
npm testor equivalent) - Review every diff manually (Autopilot often takes shortcuts)
- Check for new
console.log,// TODO, or hardcoded values - Run your linter and formatter
- Test the feature end-to-end
- Verify no unexpected files were created or modified
6. Ship
Recommended workflow:
- Let Autopilot create a branch (
feature/autopilot-xyz) - Review the PR it generates
- Add your own comments and requested changes
- Merge only after at least one human review
Copy-paste starter prompts
Minimal safe prompt for Autopilot
You are a senior engineer. Rules:
- Think step by step
- Show me the plan first as a checklist
- Only proceed when I say "execute"
- Write tests before implementation when possible
- Use existing patterns
Task: [your task]
Advanced prompt with guardrails
You have Autopilot permissions but must respect these constraints:
- Never modify files outside the current package
- Never run commands that start with `rm`, `sudo`, `curl` to external domains
- Every edit must include a corresponding test change or new test
- If you need to run a command, show it to me first
Task: [task]
Pitfalls and guardrails
### What if the agent goes off the rails? Immediately stop the chat. VS Code now has a prominent “Stop” button in Autopilot. Use it. Then switch back to Default mode, paste the current state, and give corrective instructions. The weekly release cadence means you can update VS Code quickly if a bug in the agent is fixed.
### What if prompt injection happens? Use the recommended mitigations:
- Enable experimental terminal sandboxing (macOS/Linux only)
- Work inside a dev container (
Remote - Containersextension) - Never give Autopilot access to production credentials or secret managers
### What if it creates low-quality code? This is the most common failure mode. Autopilot is fast but often lazy. Always treat its output as a first draft. The documentation is clear: auto-approval removes an important protection layer. Human review is non-negotiable.
### The weekly release is breaking my workflow
Pin your Stable version temporarily using the Update: Mode setting set to “Manual” if you need stability for a customer release. Most teams should stay on Stable and update weekly — the AI features are moving too fast to stay behind.
What to do next
After your first successful Autopilot feature:
- Add your agent prompt to the repo root as
COPILOT-PROMPT.md - Create a GitHub Action that runs full test suite on any branch named
feature/autopilot-* - Experiment with giving the agent a specific model (Claude 3.7 Sonnet or GPT-4.1) instead of letting it choose
- Document which types of tasks work well in your domain and which don’t
The combination of weekly VS Code releases and Autopilot mode means the pace of AI-assisted development is about to accelerate dramatically. Builders who establish strong scoping, prompting, and review habits will ship faster and safer than those who treat the agent as magic.
Sources
- Original announcement: https://go.theregister.com/feed/www.theregister.com/2026/03/11/visual_studio_code_moves_to/
- VS Code 1.111 Release Notes
- GitHub Copilot in VS Code documentation
- Google Gemini Code Assist Auto Approve Mode documentation (with warnings)
- Additional context from Visual Studio Magazine and VS Code team statements
This guide is written for builders who already know how to code and want a repeatable, low-risk process for using powerful new agentic tools.

