<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/stop-your-ai-agent-picking-the-wrong-net-libraries-m6tagi9al" -->

---
title: Stop Your AI Agent Picking the Wrong .NET Libraries
description: AI coding agents default to .NET library picks like AutoMapper, MediatR, MassTransit and FluentAssertions that have all gone commercial since 2025, because...
canonical: https://daily.dev/posts/stop-your-ai-agent-picking-the-wrong-net-libraries-m6tagi9al
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Stop Your AI Agent Picking the Wrong .NET Libraries | daily.dev
og:description: AI coding agents default to .NET library picks like AutoMapper, MediatR, MassTransit and FluentAssertions that have all gone commercial since 2025, because...
og:url: https://daily.dev/posts/stop-your-ai-agent-picking-the-wrong-net-libraries-m6tagi9al
og:image: https://api.daily.dev/og/posts/m6TaGi9aL.png
og:image:alt: Stop Your AI Agent Picking the Wrong .NET Libraries
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Stop Your AI Agent Picking the Wrong .NET Libraries

**[Code with Mukesh](https://daily.dev/sources/codewithmukesh)** · [@iammukeshm](https://daily.dev/iammukeshm) · 21 min read · 3 upvotes · 0 comments

## Summary

AI coding agents default to .NET library picks like AutoMapper, MediatR, MassTransit and FluentAssertions that have all gone commercial since 2025, because their training data predates the licensing changes and they have no way to know a company's revenue, which determines free-tier eligibility. A verified table covers exact last-free versions, current licenses and pricing thresholds as of 29 August 2026, plus the Polly Open Source Maintenance Fee starting 16 November 2026 and the trap where Microsoft.Extensions.Http.Resilience still pulls Polly transitively. A USENIX Security 2025 study found 19.7% of AI-generated package references across 576,000 samples pointed to nonexistent packages, enabling slopsquatting attacks, which is worse on NuGet's flat namespace than npm's scoped one. Four concrete guardrails are proposed: wiring up Microsoft's NuGet MCP Server for live package data, writing decisions into agent instruction files, enforcing failures via NuGet audit warnings-as-errors and Central Package Management, and manually reviewing dependency diffs before logic changes.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://codewithmukesh.com/blog/ai-agent-nuget-package-guardrails-dotnet>

## Questions this post answers

### Is MediatR still free to use without a commercial license?

Only up to version 12.5.0, released April 1, 2025 under Apache-2.0. MediatR 13.0.0 and later, including 14.2.0, are dual-licensed under the Reciprocal Public License 1.5 plus a Lucky Penny Software commercial license, with a free Community tier only for organizations under $5 million gross annual revenue. Commercial pricing starts around $489/year for the Standard tier covering 1-10 developers.

_Track licensing changes like MediatR's shift to commercial terms on daily.dev before they hit your build._

### Does switching to Microsoft.Extensions.Http.Resilience avoid the Polly maintenance fee?

No, it does not remove Polly from the dependency graph. Microsoft.Extensions.Http.Resilience is MIT licensed but pulls Polly.Core, Polly.Extensions and Polly.RateLimiting as transitive dependencies, so Polly remains present in the build. The Open Source Maintenance Fee announcement, effective November 16, 2026 at $20/month per organization over $20,000 revenue, does not explicitly address whether it applies to transitive consumers.

_Developers weighing resilience library choices can follow dependency licensing nuances like this on daily.dev._

### What percentage of AI-generated NuGet package references are hallucinated and do not exist?

19.7% of package references generated by AI models point to packages that do not exist, according to a USENIX Security 2025 study testing 16 models across 576,000 code samples. Commercial models averaged 5.2% while open-weight models averaged 21.7%. Of the hallucinations, 51% were pure fabrications, 38% were conflations of two real package names, and 13% were typo variants, enabling slopsquatting attacks.

_Anyone hardening AI-assisted workflows against dependency risks can find findings like this curated on daily.dev._

## Similar posts on daily.dev

- [Why Are .NET Libraries Going Paid? The Open Source Cost AI Can’t Erase](https://daily.dev/posts/why-are-net-libraries-going-paid-the-open-source-cost-ai-can-t-erase-bnptxyznc) · We Are .NET · 8 upvotes · 0 comments
- [Best Libraries for ASP.NET Core in 2026 \(Opinionated\)](https://daily.dev/posts/best-libraries-for-asp-net-core-in-2026-opinionated--h4hgrvzmn) · Code with Mukesh · 18 upvotes · 0 comments
- [Risky Biz Podcast: Open Source Risk Is Compounding as AI Age...](https://daily.dev/posts/risky-biz-podcast-open-source-risk-is-compounding-as-ai-age--u7hxcobjh) · Socket · 0 upvotes · 0 comments

---

Tags: [#security](https://daily.dev/tags/security), [#ai-agents](https://daily.dev/tags/ai-agents), [#.net](https://daily.dev/tags/.net), [#licensing](https://daily.dev/tags/licensing), [#nuget](https://daily.dev/tags/nuget)

[View this post on daily.dev](https://daily.dev/posts/stop-your-ai-agent-picking-the-wrong-net-libraries-m6tagi9al)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Stop Your AI Agent Picking the Wrong .NET Libraries","url":"https://daily.dev/posts/stop-your-ai-agent-picking-the-wrong-net-libraries-m6tagi9al","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/stop-your-ai-agent-picking-the-wrong-net-libraries-m6tagi9al"},"datePublished":"2026-09-07T08:19:56.499Z","dateModified":"2026-09-13T22:00:15.783Z","description":"AI coding agents default to .NET library picks like AutoMapper, MediatR, MassTransit and FluentAssertions that have all gone commercial since 2025, because...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/0a0e14cb6d754fc93bdf636688884123?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/0a0e14cb6d754fc93bdf636688884123?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Code with Mukesh","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Person","name":"Mukesh Murugan","url":"https://daily.dev/iammukeshm","image":"https://lh3.googleusercontent.com/a-/AFdZucr2UBIpOeVTWohK8XKuXPOutNG6hgyQMz7CYj7LEA=s100","interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"EndorseAction"},"userInteractionCount":1020}},"commentCount":0,"discussionUrl":"https://daily.dev/posts/stop-your-ai-agent-picking-the-wrong-net-libraries-m6tagi9al","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":3},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"security,ai-agents,.net,licensing,nuget","timeRequired":"PT21M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Code with Mukesh","item":"https://daily.dev/sources/codewithmukesh"},{"@type":"ListItem","position":3,"name":"Stop Your AI Agent Picking the Wrong .NET Libraries"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/stop-your-ai-agent-picking-the-wrong-net-libraries-m6tagi9al#faq","mainEntity":[{"@type":"Question","name":"Is MediatR still free to use without a commercial license?","acceptedAnswer":{"@type":"Answer","text":"Only up to version 12.5.0, released April 1, 2025 under Apache-2.0. MediatR 13.0.0 and later, including 14.2.0, are dual-licensed under the Reciprocal Public License 1.5 plus a Lucky Penny Software commercial license, with a free Community tier only for organizations under $5 million gross annual revenue. Commercial pricing starts around $489/year for the Standard tier covering 1-10 developers. Track licensing changes like MediatR's shift to commercial terms on daily.dev before they hit your build."}},{"@type":"Question","name":"Does switching to Microsoft.Extensions.Http.Resilience avoid the Polly maintenance fee?","acceptedAnswer":{"@type":"Answer","text":"No, it does not remove Polly from the dependency graph. Microsoft.Extensions.Http.Resilience is MIT licensed but pulls Polly.Core, Polly.Extensions and Polly.RateLimiting as transitive dependencies, so Polly remains present in the build. The Open Source Maintenance Fee announcement, effective November 16, 2026 at $20/month per organization over $20,000 revenue, does not explicitly address whether it applies to transitive consumers. Developers weighing resilience library choices can follow dependency licensing nuances like this on daily.dev."}},{"@type":"Question","name":"What percentage of AI-generated NuGet package references are hallucinated and do not exist?","acceptedAnswer":{"@type":"Answer","text":"19.7% of package references generated by AI models point to packages that do not exist, according to a USENIX Security 2025 study testing 16 models across 576,000 code samples. Commercial models averaged 5.2% while open-weight models averaged 21.7%. Of the hallucinations, 51% were pure fabrications, 38% were conflations of two real package names, and 13% were typo variants, enabling slopsquatting attacks. Anyone hardening AI-assisted workflows against dependency risks can find findings like this curated on daily.dev."}}]}
```

