ANcpLua.Agents.Evaluation 2.0.1

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

ANcpLua.Agents.Evaluation

A fluent, fail-closed evaluation suite for Microsoft Agent Framework agents. One builder — EvaluationSuite — composes deterministic local checks, LLM-judged quality, and any other IAgentEvaluator stage over a single agent run, then ends in a hard gate: the process exits non-zero unless there is positive, green evidence for every evaluated item.

Compatible with: Microsoft.Agents.AI 1.13.x Tested against: Microsoft.Agents.AI 1.13.0

Channel: stable. This package must not reference Microsoft Agent Framework preview, RC, or alpha packages.

Surface

return await EvaluationSuite.Create("pr-gate")
    .Agent(agent, "Give me a one-day itinerary for Paris.")
    .Expecting("Eiffel Tower")                                     // ground truth, one per query
    .Check(EvalChecks.NonEmpty(), EvalChecks.ContainsExpected())    // deterministic, no model
    .ExpectTools(ToolExpectation.AllOf("get_weather"))              // red until the agent really calls it
    .Custom("no_refusal", item =>                                   // your own rule, with a reason
        (!item.Response.Contains("I can't help"), "no refusal language"))
    .Quality(new RelevanceEvaluator(), judge, minScore: 4.0)        // LLM-judged, thresholded
    .GateAsync();   // prints the breakdown; 0 only if every stage ran and every item passed

RunAsync() returns the SuiteReport instead, for callers that want the raw verdict object; report.AssertOrThrow() is the entry point for a test framework and names every failing item.

Why fail-closed

The raw engine's default verdict is pass = not-positively-failed: a quality score with no interpretation, a boolean check that never got a value, and a vacuous tool check all read as pass. This package inverts that to pass = positively asserted:

  • Quality(...) stamps a hard pass/fail from minScore, so a low or missing score fails closed.
  • ToolExpectation.WithArguments(...) fails when there is nothing to compare against.
  • SuiteReport classifies an un-scored, empty, or errored item as Error — never a pass.
  • A requested stage that cannot run is an error, never a silent skip — and the sibling stages' verdicts still survive and still print.
  • A check that throws costs one item, not the whole stage. LocalEvaluator invokes checks directly, so an exception out of one predicate would otherwise abort the batch and take every sibling verdict — including the real failures you needed to see — down with it.

A positively-asserted failure outranks an indeterminacy: an empty response that fails a NonEmpty check is reported as Fail, not Error. Calling it an error would dress a genuine red up as a broken harness.

Stages this package does not depend on

Stage(name, evaluator) takes any IAgentEvaluator and runs it over the same single run, under the same gate. That is the seam for server-side providers whose SDKs ship on a preview channel — Azure AI Foundry's FoundryEvals, for example — so this package's own dependency closure stays stable:

suite.Stage("foundry", new FoundryEvals(projectClient, model, FoundryEvals.Relevance));

Custom checks

Custom takes a bool or a (bool Passed, string Reason) tuple — both convert to CheckOutcome. Prefer the tuple: every built-in check reports a reason, and a bare false is the one verdict in the report that cannot say why.

.Custom("min_length", item => (item.Response.Length >= 100, $"{item.Response.Length} chars, wanted >= 100"))
Product Compatible and additional computed target framework versions.
.NET 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.1 115 8/21/2026
2.0.0 122 8/20/2026
1.13.10 101 8/20/2026