GauntletCI 2.7.1

There is a newer prerelease version of this package available.
See the version list below for details.
dotnet tool install --global GauntletCI --version 2.7.1
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local GauntletCI --version 2.7.1
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=GauntletCI&version=2.7.1
                    
nuke :add-package GauntletCI --version 2.7.1
                    

GauntletCI

GauntletCI Logo

GauntletCI GitHub last commit GitHub stars NuGet downloads License


Your tests passed. Your PR was approved. Your change still broke production.

Tests confirm existing behavior. Code review confirms intent.

Neither validates what your change actually does.

GauntletCI detects Behavioral Change Risk in pull request diffs, identifying logic shifts, missing validations, and hidden regressions that pass tests and code review.


๐Ÿš€ What is GauntletCI?

GauntletCI is a pre-commit, diff-first change-risk detection tool.

It analyzes what changed in your code and flags unverified behavioral changes before they reach code review.

  • โšก Sub-second analysis: no compilation, no AST, no network
  • ๐Ÿ”’ Runs locally: no code leaves your machine
  • ๐ŸŽฏ High-signal output: designed to surface up to 3 findings per run

It answers one question:

Did this change introduce behavior that is not properly validated?

GauntletCI detects Behavioral Change Risk: unverified behavior changes introduced by a diff.


โฑ What you get in 5 minutes

  • Install the tool
  • Run it on your current changes
  • See up to 3 high-signal findings (or none)

No setup required.


๐ŸŽฌ See it live

Want to see GauntletCI catch real bugs in real PRs before installing anything?

The GauntletCI-Demo repo is a realistic ASP.NET Core OrderService with 6 always-open scenario PRs. Each PR makes a plausible multi-file change with a single risky line buried inside. GauntletCI runs on every PR: open one and read the workflow output:

PR Scenario Expected verdict
01 Safe typo fix โœ… clean: no findings
02 Silent catch { } around payment call โŒ GCI0007 Error Handling Integrity
03 Hardcoded API key in Program.cs โŒ GCI0012 Secret Hygiene
04 CancellationToken dropped from IPaymentClient โŒ GCI0004 Public API Contract
05 Customer email logged in LogInformation โŒ GCI0029 PII Logging Leak
06 Static counter mutated without sync โŒ GCI0016 Concurrency Safety

โ†’ Browse the live demo PRs

Want to drive it yourself? Fork or clone GauntletCI-Demo and run the scenarios on your own copy; the demo repo's README has a one-click fork-and-run path plus a local-CLI walkthrough.


๐Ÿ“– Why This Exists

Tests and code review do not reliably validate behavioral changes.

Even experienced developers miss things in diffs.

Not because they lack skill, but because diffs are deceptive.

A small change can silently alter behavior:

  • A null check changes execution flow
  • A guard clause introduces new exceptions
  • A method signature changes without test updates
  • A dependency call is modified without validation
  • A conditional branch shifts logic

These are not syntax errors. They are behavior changes, and they regularly slip through code review.


The Missing Layer: Change Validation

Modern development pipelines have strong tooling, but each layer answers a different question:

  • Static analysis checks code quality
  • Security tools check vulnerabilities
  • Tests verify expected behavior
  • Code review checks intent

None of them validate the behavioral impact of a change.

GauntletCI introduces a new layer: Behavioral Change Risk detection

It focuses only on the delta between versions and asks:

Is this change safe?


The Change That Looked Safe

A single line was removed from a production service:

 public async Task<Order> CreateOrderAsync(CreateOrderRequest request)
 {
-    if (request is null) throw new ArgumentNullException(nameof(request));
     var order = new Order(request.CustomerId, request.Items);
     return await _repo.SaveAsync(order);
 }
  • 1 line removed
  • Tests passed
  • PR approved ("cleaned up redundant null check")

Callers relying on the early ArgumentNullException now receive a NullReferenceException deeper in the call stack, with no context. The change shipped.

GauntletCI flagged it before the commit was created:

[High] GCI0003: Guard clause removed at line 3. ArgumentNullException no
longer thrown on null input. Callers relying on this contract will see
NullReferenceException deeper in the call stack.

This is Behavioral Change Risk: a change that compiles, passes tests, and passes review -- but alters runtime behavior in a way none of those checks can see.


๐Ÿ† Proven Reliability

GauntletCI rules have been validated against real-world pull requests:

Project What GauntletCI Caught
dotnet/efcore O(nยฒ) performance risk (LINQ in loops)
StackExchange.Redis Context mutation in property getter
Dapper Null-forgiving operator misuse
SharpCompress Numeric overflow risk
AngleSharp Enum member removal breaking serialization

โšก Quick Start

dotnet tool install -g GauntletCI

# Run before committing
gauntletci analyze --staged

๐Ÿงช What you see on first run

GauntletCI terminal demo

Running against StackExchange.Redis PR#2995 - GauntletCI flags a swallowed exception in production connection handling. GIF recorded with ScreenToGif (open source)

Typical output includes up to 3 high-signal findings.


๐Ÿ”‡ Designed for high signal

GauntletCI avoids noise by design:

  • Diff-only analysis (only what changed)
  • No style or formatting checks
  • Focused on behavioral risk only
  • Baseline suppression for legacy code

๐Ÿ“Š Baseline Delta Mode

Introduce GauntletCI into any codebase without noise:

gauntletci baseline create
gauntletci analyze --staged

Only new risks introduced by the current change are shown.


๐Ÿš€ What it detects

Behavior & Contract Safety

  • Behavior changes without tests
  • API and serialization changes

Data & State Integrity

  • Numeric truncation / overflow risks
  • State mutation issues

Async & Resource Safety

  • Blocking async calls
  • Disposable leaks

Security & Privacy

  • SQL injection risks
  • Hardcoded secrets
  • PII exposure (auto-redacted)

Observability & Failure Handling

  • Missing logging
  • Silent failures

๐Ÿ“ Detection Coverage

GauntletCI includes 30 built-in detection rules across:

  • Behavior & Contracts
  • Security
  • Data Integrity
  • Async & Concurrency
  • Observability
  • Architecture
  • Test Quality

Rule IDs range from GCI0001-GCI0050. Rule IDs are non-contiguous because the rule set evolved over time: some early rules were retired, merged, or replaced as the engine matured. The gaps reflect that history. Existing rule IDs are never renumbered so that baseline fingerprints and suppression annotations remain stable across upgrades.


Add GauntletCI to GitHub Actions

Start in advisory mode first so your team can review findings before blocking merges.

Create .github/workflows/gauntletci.yml:

name: GauntletCI

on:
  pull_request:

permissions:
  contents: read
  pull-requests: write

jobs:
  risk-analysis:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
        with:
          fetch-depth: 0

      - uses: EricCogen/GauntletCI@main
        with:
          fail-on-findings: "false"
          inline-comments: "true"

Once the signal quality is tuned for your repo, change fail-on-findings to "true" to block risky changes.

GitHub Action inputs

Input Default Description
commit PR head commit Commit SHA to analyze
no-llm true Run deterministic rules only
fail-on-findings true Fail the check when findings are produced
inline-comments false Post findings as inline PR comments
ascii true Use ASCII-only output
dotnet-version 8.0.x .NET SDK version
gauntletci-version 2.0.0 NuGet tool version to install

โšก Most common usage

gauntletci analyze --staged
gauntletci analyze --commit <sha>

โŒ What it is not

  • Not a linter
  • Not a static analysis replacement
  • Not a test runner
  • Not a formatter

GauntletCI focuses only on change-risk, not general code quality.


โš ๏ธ When no findings are detected

  • No change-risk signals were identified
  • This does not guarantee correctness
  • It indicates no high-confidence risks were found

What to do with a finding

A GauntletCI finding is not a claim that the code is definitely broken.

Treat it as a review prompt:

  1. Confirm whether the behavior changed.
  2. Check whether tests or validation cover the changed path.
  3. Add validation, update tests, or document why the change is intentional.
  4. Suppress only when the risk is understood and accepted.

๐Ÿค– Local LLM Integration (Optional)

LLM integration enhances explanation only.

  • All detection logic is deterministic
  • Runs locally via Ollama
  • No data leaves your machine

๐Ÿ”’ Privacy

  • All analysis runs locally
  • No code leaves your machine
  • Auto-redaction prevents sensitive data exposure
  • Telemetry is optional and anonymous

๐Ÿ“„ License

Elastic License 2.0

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 was computed.  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 was computed.  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.

This package has no dependencies.

Version Downloads Last Updated
2.8.0-alpha1 93 5/14/2026
2.7.1 424 5/8/2026
2.2.0 105 5/1/2026
2.1.2 107 5/1/2026
2.1.1 273 4/28/2026
2.1.0 110 4/26/2026
2.0.4 111 4/25/2026
2.0.3 149 4/24/2026
2.0.2 165 4/24/2026
2.0.1 150 4/24/2026
2.0.0 158 4/14/2026

v2.2.0: Phase 16 layered guards for GCI0006 - edge case handling now includes 10+ null-check patterns (null-coalescing ??, ??, HasValue, null-conditional ?.), NRT awareness (record types, init accessors, directives), Nullable<T> value-type safety, and LINQ projection detection. LINQ projection patterns (.Select(x => x.Value)) now recognized as intentional mappings. All guards tested with 27 comprehensive test cases. Production precision: 96.5%+ (estimated, up from 95.56% baseline). Test count: 1275 (100% passing). Includes all Phase 15B context-aware improvements. v2.1.2: Phase 8 quality assurance - added 14 new tests for GCI0053 (lockfile changes without source), verified 47 existing tests for GCI0048/GCI0049/GCI0050. Disabled GCI0052 (requires GitHub env context). Test count: 1258 (100% passing). v2.1.1: Improved NuGet README with resized logo and plain markdown for correct rendering on NuGet.org. v2.1.0: Corpus noise reduction: per-file dedup for GCI0003/GCI0004 (-71%/-72%), diff context expanded to 10 lines. Deep-link audit: rule pages show real-world case studies, articles link to case studies. File source context passed to rules for cross-reference analysis. v2.0.3: PR review summary body now embeds full Why/Action/Evidence/Confidence/Severity in collapsible details sections. v2.0.2: Findings sharing RuleId/FilePath grouped into one block; GitHub Checks rich markdown summary; PR review comments use run-log layout. v2.0.1: New CLI flags, config blocks, network license validation, Phi-4 Mini migration. v2.0.0: 42 built-in rules, local LLM expert distillery, MCP server, Ollama embedding engine, corpus pipeline, GitHub Actions annotations, full audit log.