AFFIANT

Something is being sworn.

Sworn provenance for every AI write.

Affiant is a deterministic evidence layer for .NET: field-level provenance, sworn affidavits, and a human review gate between your LLM and your database.

The problem

AI agents now write to systems of record — closing work orders, adjusting inventory, amending employee files. They do it quickly, and they do it unwitnessed. When the record is later found wrong, nothing can tell you which field the model was told and which it invented.

The evidence card

A write proposal, on the record.

Docket · Evidence Card

Work order closeout — affidavit

quantityUsed
4
UserStated
partNumber
PN-4411-A
External
laborHours
3.5
Inferred
closeoutNotes
Empty · Not derived — please verify

This reviewer UI holds Approve until a human resolves every Empty field. The framework flags; the host decides.

Write tools never write. The proposal waits, on the record, for a human.

Every field on an affidavit carries a provenance tag — a sworn statement of where the value came from. A value the user gave you and a value the model guessed are never allowed to look the same.

The Empty tag is not an error. It is the framework refusing to pretend. The proposal cannot be approved until a human resolves it.

The live demos

See a real one get sworn.

Two host applications built on Affiant run in public: an aircraft-maintenance desk and a small HR department. Ask either agent to change something and the proposal comes back as an Evidence Card — every field wearing its provenance — and waits for you. Nothing is written until you approve it.

  • Any email works — you'll get a one-time code.
  • Five messages a day, per person, per demo.
  • Shared, synthetic data. Resets nightly at 00:00 UTC.
  • After a quiet spell, the first visit takes a few seconds to wake.
Live · meridian.affiant.dev

Meridian

Aircraft maintenance — a fleet of ten, its work orders, a parts inventory. The agent runs on the Microsoft Agent Framework.

Meridian's chat panel showing an Evidence Card for a new AOG work order. Each field carries a provenance badge; Approve and Reject wait for a human.
  • Show me all AOG aircraftA read tool. A straight answer.
  • Create an AOG work order for the left engine on A7-BCAThe Evidence Card moment. Approve it, reject it, or amend a field first.
  • Guide me through creating a work orderRule 6, live: the agent guides your UI through a registry, never the DOM.
Live · hrportal.affiant.dev

HR Portal

A small HR department — an employee directory, leave requests, expense reports. The agent talks to Microsoft.Extensions.AI directly.

HR Portal's chat panel showing an Evidence Card for a new expense report. Each field carries a provenance badge; Approve and Reject wait for a human.
  • Find employee Priya NairA read tool. Its answer is who "her" means for the rest of the conversation.
  • Submit an expense report of 120 dollars for a client lunch for herThe Evidence Card moment. Approve it, reject it, or amend a field first.
  • Request 1 day of sick leave for her tomorrowAffiant.Policies, live: a standing order approves a day of sick leave with no card at all.

The card above is an illustration. These two are real.

Meridian runs on Affiant.Core, Affiant.AgentFramework, Affiant.Docket, Affiant.Policies and Affiant.Transport.SignalR. HR Portal runs on Affiant.Core, Affiant.Extensions.AI, Affiant.Docket, Affiant.EntityFramework, Affiant.Policies and Affiant.Transport.SignalR. Both use Gemini 2.5 Flash. The apps themselves are private first-party hosts; everything they run on is Apache-2.0.

The seven normative rules

Non-negotiable, by design.

  1. 1

    One system prompt per agent, immutable after initialization.

    Framework code never mutates the system prompt at runtime.

  2. 2

    Dual-audience tool returns.

    Every tool return is readable by both the LLM and the UI.

  3. 3

    Write tools never write.

    Write-intent tools produce WriteProposal envelopes; the write happens only after Review Gate confirmation.

  4. 4

    Filters over prompts for determinism.

    Context extraction, task inference, and review gating live in filters — never in prompt text.

  5. 5

    Graceful degradation on provider failure.

    A primary LLM outage falls back to a secondary or a deterministic degraded mode. It never throws.

  6. 6

    data-guide contracts are UI-layer registrations.

    The LLM discovers guidable elements through a route registry, never by inspecting the DOM.

  7. 7

    Every Affidavit field carries provenance, no exceptions.

    If a field’s origin is unknown, tag it Empty. Never omit.

Read the rules in full →

The provenance ladder

Seven grades of trust.

Every value is tagged with exactly one source. They descend from what was sworn to what was never established.

  1. 01UserStatedThe user said it, in so many words.
  2. 02ExternalRead from an authoritative system of record.
  3. 03ComputedDerived deterministically from trusted inputs.
  4. 04ConversationDrawn from earlier in the dialogue.
  5. 05InferredThe model’s best guess. Plausible, not sworn.
  6. 06DefaultA fallback value no one actually supplied.
  7. 07EmptyNo provenance. Must be verified before it counts.

Ten packages, one DAG

Small, layered, and honest about it.

Abstractions sits at the root. Core builds on it. The eight adapters build on Core — and never reference each other.

Affiant.Abstractions

Primitive types and framework interfaces. Zero Affiant dependencies — the root of the DAG.

Affiant.Core

Concrete services: the Context Fabric, the Review Gate, telemetry.

Affiant.SemanticKernel

The Semantic Kernel filter pipeline that intercepts tool calls.

Affiant.AgentFramework

The Microsoft Agent Framework bridge, over the same neutral pipeline.

Affiant.Extensions.AI

The Microsoft.Extensions.AI bridge — no agent framework required.

Affiant.Docket

The review queue’s backend-neutral half: in-memory store and the expiry sweep.

Affiant.EntityFramework

EF Core persistence — SQLite/PostgreSQL sessions and durable Docket stores.

Affiant.Policies

Approval policies deciding what a human must see.

Affiant.Transport.SignalR

Streams affidavits and events to the host UI.

Affiant.Testing.ComplianceHarness

Proves your provenance is substantive, not merely shaped.

See the full package reference →

The honest boundary

Affiant intercepts tool calls invoked locally in your host process — including locally-invoked MCP tools. Hosted, server-side tool execution that runs outside your process is beyond its reach, and Affiant does not claim otherwise.

Where the boundary lies →