PrimusSaaS.Security.Heuristics 2.0.2

dotnet add package PrimusSaaS.Security.Heuristics --version 2.0.2
                    
NuGet\Install-Package PrimusSaaS.Security.Heuristics -Version 2.0.2
                    
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="PrimusSaaS.Security.Heuristics" Version="2.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="PrimusSaaS.Security.Heuristics" Version="2.0.2" />
                    
Directory.Packages.props
<PackageReference Include="PrimusSaaS.Security.Heuristics" />
                    
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 PrimusSaaS.Security.Heuristics --version 2.0.2
                    
#r "nuget: PrimusSaaS.Security.Heuristics, 2.0.2"
                    
#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 PrimusSaaS.Security.Heuristics@2.0.2
                    
#: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=PrimusSaaS.Security.Heuristics&version=2.0.2
                    
Install as a Cake Addin
#tool nuget:?package=PrimusSaaS.Security.Heuristics&version=2.0.2
                    
Install as a Cake Tool

PrimusSaaS.Security.Heuristics

This package provides a fast, lightweight, and local-only security scanner for .NET applications. It uses regex-based heuristic analysis to detect suspicious code patterns and potential security risks without requiring any external AI services or API keys.

Features

  • No AI Required: Runs entirely locally.
  • Fast Execution: Uses compiled regular expressions for high-performance scanning.
  • Configurable: Add your own custom regex patterns or disable default ones.
  • Privacy-First: No code is sent to the cloud.

Installation

dotnet add package PrimusSaaS.Security.Heuristics

Usage

Register the analyzer in your dependency injection container:

using PrimusSaaS.Security.Heuristics;

// Default configuration
builder.Services.AddSingleton<IBehavioralAnalyzer, HeuristicBehavioralAnalyzer>();

// OR with custom options
builder.Services.AddSingleton<IBehavioralAnalyzer>(sp => 
    new HeuristicBehavioralAnalyzer(
        sp.GetRequiredService<ILogger<HeuristicBehavioralAnalyzer>>(),
        new HeuristicAnalyzerOptions 
        {
            IncludeDefaultPatterns = true,
            CustomPatterns = new List<CustomPatternDefinition>
            {
                new CustomPatternDefinition 
                {
                    Name = "Forbidden Method",
                    RegexPattern = @"\bDangerousMethod\b",
                    Confidence = 0.9,
                    Description = "This method is deprecated and unsafe."
                }
            }
        }
    ));

Default Patterns

The scanner detects patterns such as:

  • Infinite loops (while(true))
  • Suspicious delays (Thread.Sleep with large values)
  • Dynamic assembly loading (Assembly.Load)
  • Reflection usage (MethodInfo.Invoke)
  • Unbounded file writes
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
2.0.2 91 4/19/2026
2.0.1 110 3/11/2026

v2.0.0:
- Standardized Framework Release.
- Renamed all packages to PrimusSaaS.* namespace.
- Synchronized versions across the entire suite.
- Enhanced metadata and fixed consistency issues.