Executive Summary
"Every package that you restore is code that you choose to trust."
In this critical security session, Jon Douglas outlines Microsoft's comprehensive roadmap for securing the .NET package supply chain in the era of autonomous AI agents and rapid dependency consumption. As autonomous coding agents and developers restore millions of packages daily, attack vectors—such as typo-squatting, credential leaks, malicious script execution, and instant zero-day payload pushes—have escalated.
Microsoft introduces structural protections spanning four domains:
- NuGet Client Innovations:
- Package Cooldown: Configurable time buffers (e.g., 3 days) in the .NET 11.2 CLI and Visual Studio 18.14, automatically skipping newly published package versions until they have been vetted by the ecosystem.
- Deprecation of Auto-Run Scripts: Visual Studio 18.14 completely eliminates automatic execution of legacy
init.ps1andinstall.ps1PowerShell package scripts. - Staged Publishing & Grouping:
dotnet package stageallows authors to push packages privately for pre-release validation before atomic public promotion. - Homograph Attack Warnings: Deprecation of non-ASCII lookalike characters in package IDs (e.g. Cyrillic lookalikes mimicking
Newtonsoft.Json).
- NuGet.org Registry Hardening:
- Trusted Publishing (OIDC): Phasing out permanent API keys in favor of short-lived OpenID Connect tokens from GitHub Actions and GitLab (reaching 41% adoption, targeting 70%).
- 30-Day API Key Lifetimes: All legacy API keys exceeding 30 days expired automatically on November 1st, enforcing credential rotation.
- Proof of Presence: Enforcing 2FA human verification before staged package groups are released publicly.
- Minutes-to-Removal Triage: Comprehensive upload-time malware scanning reducing report-to-removal triage from days/hours to minutes.
- AI Agent Tooling & Guardrails:
- "Secure My Supply Chain" MCP Server: An official Model Context Protocol tool in Visual Studio providing 11–18 second deterministic supply chain audits directly against NuGet.org feeds.
- Skills Inside Packages (
skills/skill.md): Authors can embed markdown skill files directly into.nupkgarchives, instructing AI agents on safe API usage and configuration patterns.
- Future Roadmap: Detached signatures via NuGet Signing v2 and standardized Package End-of-Life (EOL) lifecycle metadata.
Secure Supply Chain Architecture & Lifecycle
The modern NuGet security architecture enforces verification gates at authoring, publishing, registry indexing, and client consumption stages:
flowchart TD
subgraph Authoring ["Package Authoring & CI/CD"]
CI["CI Build (GitHub Actions / GitLab)"]
OIDC["OIDC Token Exchange<br/>(Trusted Publishing - No API Keys)"]
StageCmd["dotnet package stage push<br/>(Private Staging Group)"]
end
subgraph Registry ["NuGet.org Registry Engine"]
MalwareScan["Automated Upload Malware Scanners"]
ProofOfPresence{"Proof of Presence Gate<br/>(Human 2FA Verification)"}
PublicRelease["Public Registry Listing"]
FastRemoval["Minutes-to-Removal Pipeline<br/>(Malware / Typosquatting Triage)"]
end
subgraph Client ["Client Consumption & AI Agents"]
Cooldown{"Package Cooldown Gate<br/>(e.g., 3-Day Buffer)"}
Skip["Skip Untrusted New Version<br/>(Protect from Zero-Day Attack)"]
Restore["Safe Restore Allowed"]
MCPAudit["'Secure My Supply Chain' MCP Agent<br/>(Audits CPM, nuget.config, CVEs in 15s)"]
AgentSkills["Agent Reads skills/skill.md<br/>(Enforces Safe Code Generation)"]
end
CI --> OIDC --> StageCmd --> Registry
StageCmd --> MalwareScan --> ProofOfPresence
ProofOfPresence -- "Owner Confirms" --> PublicRelease
PublicRelease -. "Active Threats Detected" .-> FastRemoval
PublicRelease --> Cooldown
Cooldown -- "< 3 Days Old" --> Skip
Cooldown -- ">= 3 Days Old" --> Restore
Restore --> MCPAudit
Restore --> AgentSkills
Key Technical Pillars
1. NuGet Client Security Innovations
Package Cooldown
Fast-moving supply chain attacks often push weaponized versions of popular packages, hoping automated CI/CD pipelines will pull them before security researchers react.
- Introduced in .NET 11.2 CLI and Visual Studio 18.14 (Package Manager UI & Console).
- Developers configure a cooldown duration (e.g., 3 days). If a version was published 6 hours ago,
dotnet add packageor restore ignores it, shielding the project from zero-day compromises until community vetting concludes.

Jon Douglas presents 'Securing the NuGet Supply Chain for Developers and Their Agents'.

Configuring a 3-day NuGet cooldown window to automatically skip unvetted package releases.
No More Auto-Run Package Scripts
Historically, packages targeting .NET Framework or Entity Framework executed init.ps1 or install.ps1 PowerShell scripts automatically whenever Visual Studio loaded the solution.
- Breaking Change in VS 18.14: Visual Studio will no longer auto-execute PowerShell scripts embedded in packages.
- Developers must explicitly approve and execute scripts, mitigating remote code execution vectors during solution load. Package authors are instructed to migrate build logic to declarative MSBuild
.targets.

Visual Studio 18.14 disabling automatic execution of legacy init.ps1/install.ps1 PowerShell scripts.
Staged Publishing from the CLI
Developers can now push packages into a private holding status:
# Push package to private staged status
dotnet package stage Contoso.Core.1.0.0.nupkg --group "Contoso-v1.0"
# Check status of staging group
dotnet package stage status --group "Contoso-v1.0"
# Atomically publish and list all packages in the group
dotnet package stage publish --group "Contoso-v1.0" --list

CLI commands for staging, grouping, and atomically publishing package batches.
Homograph Attack Deprecation
Attackers have used lookalike Unicode characters (e.g. Cyrillic letters identical in appearance to Latin characters) to spoof trusted packages like Newtonsoft.Json.
- In .NET 12 preview, NuGet clients emit explicit warnings when referencing non-ASCII package IDs, neutralizing typosquatting visual deceptions.

Deprecating non-ASCII package IDs to prevent visual homograph impersonation attacks.
2. NuGet.org Registry Hardening
Trusted Publishing (OIDC) & API Key Expiration
- Trusted Publishing: Eliminates static API secrets. CI/CD runners (GitHub Actions, GitLab, and Azure DevOps in development) exchange short-lived OIDC tokens directly with NuGet.org.
- Adoption: 41% of monthly publishes now use Trusted Publishing (approaching Microsoft's 70% target).
- Hard Expiration: All newly minted API keys expire in 30 days or less. Existing long-lived API keys older than 30 days were permanently expired on November 1st.

Trusted Publishing adoption reaches 41%, eliminating persistent API keys in CI/CD.

Reducing API key lifetime to 30 days to mitigate credential leaks.
Proof of Presence & Staging Portal
Staged packages undergo automated malware scanning, digital signature validation, and metadata integrity checks while remaining unlisted.
- Proof of Presence Gate: Once validations pass, package owners log into NuGet.org and verify their identity via 2FA before pressing the "Promote Group" button, releasing multi-package updates atomically.

Staging lifecycle: private upload -> malware validation -> proof of presence -> public listing.

NuGet.org Staging Groups management interface with atomic 'Promote Group' action.
Minutes-to-Removal Malicious Package Triage
- NuGet.org now runs deep heuristic and signature malware scanners on every package upload.
- Malicious package report-to-takedown latency has dropped from days or hours to minutes.
- A 30-day package restoration window allows publishers to reverse false-positive detections.

Takedown response time reduced from days/hours down to minutes upon threat detection.
3. Securing the Supply Chain for AI Agents
"Secure My Supply Chain" MCP Tool
With autonomous AI agents altering dependencies, Microsoft introduces the Secure My Supply Chain MCP Server for Visual Studio and Copilot:
- Accessible directly from the Package Manager UI, Package Sources settings, or MSBuild Error List.
- Connects directly to real-time NuGet.org security feeds rather than relying on stale LLM training data.
- Audits
Directory.Packages.props,nuget.config, package source mappings, and project files in 11–18 seconds, providing token-optimized security hardening recommendations.

Introducing the 'Secure My Supply Chain' Model Context Protocol (MCP) server.

AI agent auditing package vulnerability data, Central Package Management, and source mappings in seconds.
Embedding Skills Inside NuGet Packages (skills/skill.md)
In .NET 11, package authors can ship agentic documentation directly inside their package archives:
- Located at
/skills/skill.mdinside the.nupkg. - Informs tools like GitHub Copilot, Claude Code, and Codex how to properly consume the library (e.g., "Always configure clients via
services.AddContosoHttpClient()", "Never setServerCertificateCustomValidationCallbackto true"). - Eliminates manual prompt engineering and grounds coding agents in author-approved security practices.

Shipping skills/skill.md inside .nupkg to guide AI agent code generation.
4. Roadmap & Future Innovations
- Package End of Life (EOL) Metadata: Formalizing an industry-standard lifecycle metadata schema distinct from "deprecated", clearly alerting developers and agents when a package version has exited active maintenance.
- NuGet Signing v2: Introducing detached cryptographic signatures, enabling package signing without modifying the raw binary
.nupkgarchive. - Client Update Notifications: Native notifications in
dotnetandnuget.exewhen newer client tooling is available.

NuGet roadmap: Package End of Life (EOL) statuses, NuGet Signing v2, and client update notifications.
Actionable Steps for Developers This Week
Jon concludes with four critical tasks for engineering teams:
- Turn on Package Cooldown: Enable cooldown policies in
.NET 11.2or Visual Studio 18.14 to insulate your codebase from zero-day supply chain attacks. - Migrate to Trusted Publishing: Transition CI/CD workflows from permanent API keys to OIDC before 30-day key expirations disrupt automated deployments.
- Audit Legacy PowerShell Install Scripts: Review packages relying on
init.ps1orinstall.ps1before upgrading to Visual Studio 18.14. - Deploy the NuGet MCP Agent: Use "Secure My Supply Chain" in Visual Studio to benchmark repository security posture against official NuGet.org telemetry.

Summary of immediate security actions: Cooldown, Trusted Publishing, script audit, and MCP.