Skip to content

Installation

Affiant ships as ten NuGet packages, all versioned together, targeting net10.0. You install only the ones your project needs — the dependency graph is a strict DAG rooted at Affiant.Abstractions, so referencing a higher package pulls in everything beneath it automatically.

  • The .NET 10 SDK. All ten packages target net10.0.
  • A host built on Semantic Kernel, Microsoft Agent Framework, or Microsoft.Extensions.AI — Affiant’s interception seam is one of these three orchestrators’ own tool-calling pipeline, so your project needs one of them already wired up (or one you’re about to wire up alongside Affiant — see Quickstart, which walks the Semantic Kernel path, and Interception Backends for how the other two differ).
  • If you plan to use Affiant.EntityFramework, a database: SQLite for local development, PostgreSQL for production. Both are supported backing stores. Affiant.Docket itself needs no database — it ships an in-memory store and is always required for the backend-neutral expiry sweep, regardless of which persistence backend you choose.

Every install command below uses --prerelease. Affiant has not reached a stable 1.0.0 release yet — read the version note at the bottom of this page before you pin a version in a production project.

Package What it’s for Depends on
Affiant.Abstractions Every primitive type (Affidavit, ProvenanceTag, ToolEnvelope, DocketEntry, …) and every framework interface (IWriteExecutor, IFieldMapper<T>, IDocketStore, IApprovalPolicy, …). Zero Affiant dependencies. (none)
Affiant.Core Concrete services: ContextFabric, ReviewGate, task-inference merge, the deterministic short-circuit, DI wiring (AddAffiantCore, AddAffiantTool<T>). Abstractions
Affiant.SemanticKernel The Semantic Kernel (SK) interception bridge — the IAutoFunctionInvocationFilter pipeline, per-provider connector capabilities, structured-output inference (AddAffiantSemanticKernel, AddAffiantInferenceOrchestration). Core
Affiant.AgentFramework The Microsoft Agent Framework (MAF) interception bridge — reflects a tool type into an AffiantToolCatalog, attaches via AIAgent.WithAffiant(...), and runs the hosted-tool coverage audit (AddAffiantAgentFramework). Core
Affiant.Extensions.AI The Microsoft.Extensions.AI (M.E.AI) interception bridge — wraps each AIFunction and attaches via ChatOptions.WithAffiant(...), for hosts that talk to IChatClient directly with no agent framework (AddAffiantExtensionsAI). Core
Affiant.EntityFramework EF Core persistence for chat sessions and dockets — row-per-message schema, and the SQLite/PostgreSQL IChatSessionStore and IDocketStore implementations (AddAffiantEntityFramework). Abstractions, Core
Affiant.Docket The review queue’s backend-neutral half — the in-memory IDocketStore plus the expiry sweep (AddAffiantDocket). Always required, even when the actual store comes from Affiant.EntityFramework. Abstractions, Core
Affiant.Policies The fluent approval policy graph — Standing Orders (pre-authorized auto-approval), Referrals (escalation), risk scoring (AddAffiantPolicies). Core
Affiant.Transport.SignalR SignalR streaming transport and the Evidence Card round-trip hub (AddAffiantSignalR<THub>). Core
Affiant.Testing.ComplianceHarness Test helper that proves every write strategy has a paired fixture asserting substantive provenance, not just shape. For your CI, not just ours. Core

Pick one of Affiant.SemanticKernel, Affiant.AgentFramework, or Affiant.Extensions.AI — never wire more than one over the same tool catalog. See Interception Backends for how to choose.

Affiant.Docket and Affiant.EntityFramework are peers, not a chain: Affiant.Docket is required on every host (it supplies the expiry sweep and the in-memory store), and Affiant.EntityFramework is required in addition to it, not instead of it, whenever you want a durable, SQL-backed Docket. Installing Affiant.Docket alone no longer pulls Affiant.EntityFramework, EF Core, SQLite, or Npgsql along with it — that coupling was removed so a fully in-memory host doesn’t carry a database driver it never uses.

An agent host that writes to a real database typically wants the full review path: context extraction and the review gate, one interception bridge, a place to persist chat sessions and docket entries, and a transport for streaming Evidence Cards to a reviewer. This example uses the Semantic Kernel bridge; swap Affiant.SemanticKernel for Affiant.AgentFramework or Affiant.Extensions.AI if your host runs on one of those instead.

Terminal window
dotnet add package Affiant.Core --prerelease
dotnet add package Affiant.SemanticKernel --prerelease
dotnet add package Affiant.EntityFramework --prerelease
dotnet add package Affiant.Docket --prerelease
dotnet add package Affiant.Transport.SignalR --prerelease

Add Affiant.Policies if you want Standing Orders (auto-approval for low-risk writes), Referrals (escalation to a senior reviewer), or risk scoring, rather than routing every Affidavit to a reviewer unconditionally:

Terminal window
dotnet add package Affiant.Policies --prerelease

If you’re implementing a framework interface — a custom IDocketStore, a IFieldMapper<T> for your domain model, an IWriteExecutor — without needing any of the concrete services, Affiant.Abstractions alone is enough. It has zero Affiant dependencies.

Terminal window
dotnet add package Affiant.Abstractions --prerelease

To verify that your write strategies produce substantive provenance — not just structurally-shaped Affidavits — add the compliance harness to your test project:

Terminal window
dotnet add package Affiant.Testing.ComplianceHarness --prerelease

After adding packages, a restore should pull in your chosen interception bridge’s own dependencies and, for Affiant.EntityFramework, the EF Core provider packages (SQLite and PostgreSQL) transitively — you don’t need to add those yourself. If dotnet build reports a missing type from Affiant.Abstractions or Affiant.Core after adding an adapter package, check that every Affiant package in the project resolved to the same version; a partial upgrade — one package bumped, another left behind — is the most common cause of DI registration failures at startup, since the adapters’ AddAffiant* extension methods expect the exact service shapes their matching version of Affiant.Core registers.

If your host boots without registering an IDocketStore or IStreamingTransport at all — neither Affiant.EntityFramework nor Affiant.Docket’s in-memory store, or no transport package — AddAffiantCore()’s startup validator throws at boot, naming the missing registration and which package supplies it, rather than failing silently at the first write.

All ten packages release under one shared version number — if you install Affiant.Core at a given version, install every other Affiant package you reference at that same version. The framework has not reached a stable 1.0.0 yet, and the public API surface — type shapes, DI extension signatures, package boundaries — may still change before it does. Pin an exact version in any project you deploy, and re-test after every bump. Once you’ve installed what you need, continue to Quickstart to wire up a first write tool end to end.