Reins.Analyzers 0.1.1

dotnet add package Reins.Analyzers --version 0.1.1
                    
NuGet\Install-Package Reins.Analyzers -Version 0.1.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Reins.Analyzers" Version="0.1.1">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Reins.Analyzers" Version="0.1.1" />
                    
Directory.Packages.props
<PackageReference Include="Reins.Analyzers">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Reins.Analyzers --version 0.1.1
                    
#r "nuget: Reins.Analyzers, 0.1.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Reins.Analyzers@0.1.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Reins.Analyzers&version=0.1.1
                    
Install as a Cake Addin
#tool nuget:?package=Reins.Analyzers&version=0.1.1
                    
Install as a Cake Tool

Reins.Analyzers

CI NuGet License: MIT

Compile-time guardrails for .NET AI agent code. Reins is a Roslyn analyzer + code fix library that catches security, reliability, and cost mistakes in code built on the Microsoft Agent Framework (Microsoft.Agents.AI) and the Microsoft.Extensions.AI IChatClient abstractions — before the code ever calls a model.

Reins is a compile-time complement to runtime governance tooling: runtime guardrails stop a bad request in production; Reins stops the bug from being merged.

Install (30 seconds)

<PackageReference Include="Reins.Analyzers" Version="0.1.0" PrivateAssets="all" />

That's it. Reins is a development dependency — it adds nothing to your application's output or its dependency graph. Projects that don't reference an AI agent framework pay zero analysis cost.

Rules

ID Category Severity Rule
REINS0001 Reliability Warning CancellationToken not forwarded to agent invocation
REINS0002 Security Error Hardcoded credential in AI client construction
REINS0003 Cost Warning Model invocation inside a loop
REINS0004 Reliability Warning Unbounded agentic loop
REINS0005 Reliability Suggestion Agent invocation without timeout linkage
REINS0006 Security Warning Tool method with raw string parameter lacking validation
REINS0007 Observability Info Agent constructed without OpenTelemetry instrumentation
REINS0008 Cost Suggestion Conversation history grown in loop without reduction

Severity philosophy

Precision over recall. A noisy analyzer is a dead analyzer:

  • Rules that detect a definite defect (hardcoded credentials) default to Error.
  • Rules with high-confidence heuristics default to Warning.
  • Rules based on the absence of something that may legitimately live elsewhere (timeouts in Polly, OTel in DI) default to Suggestion/Info and are documented as opt-in.

Every rule doc has a "Known false positives" section. A rule with more than a 2% false-positive rate on real code gets pulled or downgraded.

Tune severities per repo via .editorconfig:

dotnet_diagnostic.REINS0007.severity = warning   # opt in harder to OTel
dotnet_diagnostic.REINS0003.severity = none      # this repo batches deliberately

See docs/configuration.md for .editorconfig recipes and CI/SARIF integration.

Building

dotnet build -warnaserror
dotnet test
dotnet pack -c Release

The samples/Reins.Sample.Agent project intentionally violates every rule and doubles as an integration test.

Contributing

See CONTRIBUTING.md — including the rule proposal process and the precision bar new rules must meet.

License

MIT

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.1 89 7/24/2026
0.1.0 91 7/24/2026