## Executive Summary

At .NET Conf 2026, Rachel Kang and Barbara Boyajian presented a comprehensive overview of the next evolution of AI in Visual Studio. Beyond autocomplete and single-turn chat, Visual Studio now operates as an advanced multi-agent orchestrator powered by two major foundational pillars:
1. **The New Agent Harness (General Availability):** Visual Studio has completely integrated the unified **Copilot SDK** agent harness—the exact same core reasoning and agent engine shared across VS Code, GitHub Copilot CLI, and the Copilot desktop app. On identical models, this shared harness resolves up to **21 additional C# benchmark tasks**, introduces sub-agent delegation, working-folder scoping beyond `.sln` boundaries, and enables **real-time mid-task steering**.
2. **Bring Your Own Model (BYOM) & Extreme Choice:** Visual Studio now fully decouples AI features from GitHub account requirements. Developers in regulated, air-gapped, defense, or healthcare environments can connect custom models from Microsoft Foundry, OpenAI, Anthropic, Ollama, or local OpenAI-compatible endpoints (such as LM Studio and OpenRouter), supporting multi-tenant configurations, model API contract switches (`completions` vs. `responses`), and centralized enterprise MDM controls.

![The State of AI in Visual Studio](/dotnetconf2026/archive/19-state-of-ai-in-visual-studio/screenshots/01_title_state_of_ai_vs.webp)

---

## 1. The New Agent Brain: Copilot SDK Harness

Historically, IDE AI was treated as a direct prompt-to-model wrapper. However, real engineering problems require more than just raw LLM reasoning:

```mermaid
flowchart LR
    A[User Goal / Prompt] --> B[Unified Copilot SDK Harness]
    B --> C[Model Reasoning<br/>GPT, Claude, Foundry]
    B --> D[Context Engine<br/>Roslyn AST, Call Graph, Diffs]
    B --> E[Persistent Memory<br/>Project conventions, patterns]
    B --> F[Tool Orchestration<br/>Build, Test Explorer, Git, Debugger]
    F --> G[Autonomous Execution]
```

![New Agent Harness Powered by Copilot SDK](/dotnetconf2026/archive/19-state-of-ai-in-visual-studio/screenshots/02_new_agent_harness_copilot_sdk.webp)

### Why the Shared Copilot SDK Matters
- **Unified Cross-Surface Intelligence:** Rather than Visual Studio maintaining a proprietary chat implementation, Visual Studio now shares the identical harness engine as VS Code and GitHub Copilot App.
- **Shared Advances:** Algorithmic breakthroughs in tool-calling, reflection, memory management, and error correction immediately propagate across all developer surfaces.
- **Measurable Benchmark Gains:** On standardized internal Microsoft C# benchmark test suites, the new agent harness resolved up to **21 additional complex programming tasks** on the exact same model (`GPT-4.5 / GPT-5` class) compared to the previous harness.

![Benchmark: 21 Additional Tasks](/dotnetconf2026/archive/19-state-of-ai-in-visual-studio/screenshots/03_benchmark_21_additional_tasks.webp)

### Old vs. New Chat Repro Comparison
Rachel demonstrated a real-world bug from the Copilot team where multiple-choice dropdown text truncated in narrow sidebars:
- **Previous Chat Experience:** Required extensive thinking time, eventually outputting a lengthy manual "manuscript" of repro instructions for the human developer to execute.
- **New Agent Harness:** Understood the codebase context immediately, invoked the UI renderer tools, and rendered an exact interactive reproduction directly inside the chat window in seconds.

![Repro Comparison Old vs New](/dotnetconf2026/archive/19-state-of-ai-in-visual-studio/screenshots/04_repro_comparison_old_vs_new.webp)

---

## 2. Real-Time Mid-Task Agent Steering

A critical limitation of earlier autonomous agents was the "all-or-nothing" execution model: once prompted, an agent would run until completion or error. If the developer noticed the agent heading down the wrong architectural path, they had to cancel, discard work, and start over.

In Visual Studio's new harness, **Mid-Task Steering** allows developers to inject instructions while the agent is actively executing.

![Mid-Task Agent Steering](/dotnetconf2026/archive/19-state-of-ai-in-visual-studio/screenshots/05_mid_task_agent_steering.webp)

### Live Demo: Resolving Double-Booking in "Care Desk"
In a clinic scheduling application demo, a double-booking bug allowed Dr. Dahlia to be scheduled concurrently at 10:00 AM with two patients:
1. **Initial Prompt:** Rachel instructed Copilot to remove the faulty suggested action and remove the suggested reply.
2. **Steer 1 (Refining Behavior):** While Copilot was planning the file edit, Rachel steered: *"Actually, keep the suggested reply, but explain to the patient that 10:00 AM is unavailable and their current slot is retained."*
3. **Steer 2 (Adding Tests & Building):** While the agent was modifying the scheduling logic, Rachel steered again: *"Add 10 regression tests covering double-booking conflicts, run the tests via Test Explorer, and then rebuild and relaunch the application."*
4. **Visual State Representation:** Steering messages enter as **pending gray pills** and smoothly solidify into **purple confirmations** as the harness incorporates them into the active execution graph without restarting the agent session.

---

## 3. Autonomous Execution & Self-Healing Testing

The agent executed the edits across the domain models, handlers, and unit test files:

![Test Explorer Regression Tests](/dotnetconf2026/archive/19-state-of-ai-in-visual-studio/screenshots/06_test_explorer_regression_tests.webp)

### Self-Healing Test Loop
- The agent automatically launched the Visual Studio **Test Explorer** and initiated execution of all 50 tests (40 existing + 10 new regression tests).
- When 1 test failed due to an edge-case assertion, the human developer did not intervene.
- **Autonomous Error Reflection:** The harness caught the test failure output, analyzed the stack trace, inspected the test assertion, edited the scheduling service code to handle the edge case, and re-triggered Test Explorer.
- All **50/50 tests passed green**, followed by an automated clean solution build and application relaunch.

![Autonomous Self-Healing Tests](/dotnetconf2026/archive/19-state-of-ai-in-visual-studio/screenshots/07_autonomous_self_healing_tests.webp)

---

## 4. Bring Your Own Model (BYOM) & Provider Choice

Barbara Boyajian demonstrated Visual Studio's ground-up support for **Bring Your Own Model (BYOM)**. This architectural decoupling allows organizations in regulated sectors (healthcare, defense, finance) or air-gapped environments to utilize Visual Studio's full AI and agentic capabilities with zero dependency on GitHub cloud services.

![BYOM Provider Choice Ecosystem](/dotnetconf2026/archive/19-state-of-ai-in-visual-studio/screenshots/08_byom_provider_choice_ecosystem.webp)

### Key Capabilities of BYOM
- **Zero GitHub Authentication Required:** Visual Studio operates fully signed out of GitHub accounts while retaining all Copilot Chat, steering, and agentic workflows.
- **Broad Provider Support:**
  - Microsoft Foundry
  - OpenAI (Direct API keys)
  - Anthropic (Claude 3.5/3.7 models)
  - Ollama (Local open-weight models)
  - OpenAI-Compatible Custom Endpoints (LM Studio, OpenRouter, vLLM, LocalAI)
- **Multi-Tenant Concurrent Configurations:** Developers can register multiple deployments of the same provider simultaneously (e.g., a Microsoft Foundry deployment named `Work` alongside a second Foundry deployment named `Testing`).

![BYOM Multi-Configuration Foundry and OpenAI](/dotnetconf2026/archive/19-state-of-ai-in-visual-studio/screenshots/09_byom_multi_config_foundry_openai.webp)

### Model API Contracts: `completions` vs. `responses`
Visual Studio now exposes lower-level protocol contracts under model settings:
- **Completions API:** Traditional text/chat streaming format.
- **Responses API:** Emerging next-generation streaming structured protocol supported by newer reasoning models (e.g., GPT-5 Turbo / GPT-5.6 Soul class), unlocking rich multi-turn tool interaction.

### Local On-Device AI via LM Studio
Barbara demonstrated configuring **LM Studio** serving a local model over `http://localhost:1234/v1`:
- Required no API keys.
- Executed full agentic tasks: analyzing Git commit history (`git log`), explaining architectural changes, and generating precise, non-obvious C# documentation comments directly within the local solution.

![LM Studio Local Endpoint Custom](/dotnetconf2026/archive/19-state-of-ai-in-visual-studio/screenshots/10_lmstudio_local_endpoint_custom.webp)

---

## 5. Enterprise Governance & Managed Settings

As agentic capabilities grow, enterprise administrators need centralized policies to control autonomy levels and ensure compliance.

![Managed Settings Enterprise Governance](/dotnetconf2026/archive/19-state-of-ai-in-visual-studio/screenshots/11_managed_settings_enterprise_governance.webp)

### Centralized Distribution Channels
Admins can define and push policies through:
- **GitHub Server / Enterprise Cloud policies**
- **Mobile Device Management (MDM)** / Microsoft Intune
- **File-based local policy templates**

### Autopilot vs. Interactive Mode Policies
In the live demonstration:
- On an approved internal developer account, **Autopilot** mode runs uninhibited, performing autonomous multi-file edits, terminal executions, and test runs.
- When switching to a restricted enterprise account, the admin policy automatically restricts Autopilot, forcing the agent into **Interactive Mode** where every file write and Git command requires explicit developer approval.

---

## 6. What's Next: Visual Studio AI Roadmap

The session concluded by highlighting upcoming engineering investments driven by developer feedback:
1. **Multi-Agent Coordination:** Managing pools of specialized agents (reviewers, refactorers, test runners) operating concurrently.
2. **AI-Assisted Code Review:** Streamlining the review of large AI-generated diffs with semantic summaries and risk scoring.
3. **Agent Visibility:** Granular diagnostic timelines revealing exactly which tools, memory entries, and context files were loaded during autonomous execution.
