Skip to main content

assurance-cli

PyPI Tests Python License

Did the job cover everything it was supposed to cover?

One command. One honest ratio. An exit code your pipeline can act on.

pip install assurance-cli
assurance diff --expected corpus.txt --found retrieved.json \
  --scope "documents the question spans" --where "the retrieved set" --fail-on-gap
2 of 5 documents the question spans — not in the retrieved set: doc-2, doc-3, doc-5
also present and not expected: doc-9

That second line matters as much as the ratio: the retriever drew on something the scope never allowed. It's reported, and it earns no credit.

No account · no API key · no network call · no model decides any of it

Three commands

diff is the general one. check is the special case for a folder of dated or numbered tabular files — if your files are .md, or named in a format it can't read, use diff and declare the set yourself.

assurance pin — did an MCP server change what it tells the model?

CVE-2025-54136 (CVSS 8.8): approving a tool definition does not survive subsequent server-side changes. The server you approved in March can serve a different description in August — same client, same name, no re-prompt.

pip install 'assurance-cli[mcp]'

assurance pin --save                 # snapshot every tool your MCP servers expose
assurance pin --check                # exit 1 if any definition changed since the snapshot

Pins live in .assurance/mcp-pins.json — commit it like a lockfile and review changes in PRs. Stdio servers only in this release; HTTP/SSE transports are named and skipped.

CI gate (no account, no service, no model):

- run: pip install 'assurance-cli[mcp]'
- run: assurance pin --check

Exit 1 means a definition moved and needs a human look. Exit 2 means the gate could not run (missing mcp extra, no config, no pin file yet).

assurance drift — is the failure rate shifting?

Control chart over any binary outcome stream. Needs at least 21 runs (20 baseline + 1 monitored). Refuses below that with a message naming how many more are needed. No model, no labels.

assurance drift events.jsonl --field outcome --failure verification_failed
assurance drift results.csv  --column status --failure error --baseline 0.05

Exit 1 when a shift is detected — a CI gate the same way pin --check works.

- run: assurance drift outcomes.jsonl --field outcome --failure error

assurance diff — any two sets of keys

# code review agent actually read the diff?
git diff --name-only origin/main...HEAD > changed.txt
assurance diff --expected changed.txt --found reviewed.txt --fail-on-gap

# eval suite ran every declared case?
assurance diff --expected cases.json --found ran.json --fail-on-gap

# straight from a pipe
retriever --query "$Q" | jq -r '.chunks[].doc_id' | \
  assurance diff --expected corpus.txt --found - --json

Inputs are whatever you already have: one key per line, a JSON array (strings, or objects with key/id/name/path), - for stdin, or an inline comma list.

assurance check — a folder of dated or numbered files

This one is for CI, not for an agent. Anything with a shell will list the directory and spot the gap itself. We tested that and the run without our tool did better. The value here is a gate with no model in it, returning the same exit code every time.

assurance check ~/reports
22 of 24 months from 2024-01 to 2025-12 in reports — not in this folder: March 2025, July 2025
— Range inferred from filenames: earliest 2024-01, latest 2025-12. Override with --from / --to.
assurance check ~/invoices --expect numbered
7 of 8 runs from inv_0001 to inv_0008 in invoices — not in this folder: INV-0006
— Range inferred from filenames: earliest inv_0001, latest inv_0008. Override with --from / --to.

Monthly, quarterly, weekly, daily, numbered. That last line is the derivation: it prints with every ratio so you can disagree with the denominator, not just the result.

When a file is there under a name it can't read, it says so beside the gap, because that's the difference between never produced and produced and named differently:

11 of 12 months from 2025-01 to 2025-12 — not in this folder: March 2025
— 1 name here could not be read as any of them: March FINAL v2.csv

assurance init — did anything change underneath?

assurance init ~/thesis-data
# Baseline written to ~/thesis-data/.assurance.json — 34 tabular files recorded.

# ... weeks pass, several people touch the folder ...
assurance check ~/thesis-data --against-baseline

Exit codes

0 it checked, and either found no gap or wasn't asked to fail on one
1 a finding: a gap with --fail-on-gap, a stale baseline, a changed MCP pin, or nothing it could check
2 could not run: bad path, unreadable list, unparseable JSON, missing mcp extra, no MCP config

"I couldn't check this" exits 1, not 0. A folder whose filenames it can't parse must not look like a folder it checked and found whole.

Diagnostics go to stderr, results to stdout, so --json stays pipeable.

It expects your files, not tidy ones

  • Excel exports work. UTF-8 BOM and CRLF are handled; a BOM used to glue itself to your first key and report it as missing and unexpected in the same sentence
  • Spaces, unicode and month words in filenames — Inventory Report August 2024.csv parses
  • .xlsx, and nested subfolders
  • A piped CSV is refused, not misread. It names the column-picking command instead of quietly admitting your header row as a key
  • When it can't work out a series it says so, rather than reporting an empty check as a pass

Use it for

expected found
RAG documents the question spans chunks retrieved
Code review in CI git diff --name-only files reviewed
ETL / batch records or partitions declared records or partitions loaded
Compliance controls in scope controls with evidence
Research data the series you expect what's actually in the folder

What it won't do

  • Invent your expected set. diff takes your declaration; check derives one and prints how
  • Send anything anywhere. No network, no telemetry, no keys
  • Guess. A JSON object of id → metadata is refused, not interpreted

Family

assurance-core — the pure arithmetic, zero dependencies · assurance-mcp — the same checks as MCP tools

Upstream is I-Ops; this repo is a publication, never a source. Apache-2.0.

Release files for assurance-cli 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for assurance-cli 0.5.0
File Size Uploaded
assurance_cli-0.5.0.tar.gz 39.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for assurance-cli 0.5.0
File Interpreter ABI Platform
assurance_cli-0.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 70.6 kB

Release files / assurance_cli-0.5.0.tar.gz

Download URL assurance_cli-0.5.0.tar.gz
Size 39.6 kB
Tags Source
SHA-256 checksum
How to use checksums
5af4d569bb5839d89b97413deaee242fe06840a4f93137bf6c87f14a9b487551
BLAKE2b-256 checksum
How to use checksums
4ecf5517f4e1275122459357711336914134d2b6b63a370dc318bb730b81a40d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 2, 2026.

Transparency log

Release files / assurance_cli-0.5.0-py3-none-any.whl

Download URL assurance_cli-0.5.0-py3-none-any.whl
Size 31.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
30cc05ca99015afde1be15cb4f773d3976fe276282aea31f5db194e75f2c3526
BLAKE2b-256 checksum
How to use checksums
e0e161b36bf799902889641eb96b02694ca33cacf5bbd47c47bf0c35fe18694e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 2, 2026.

Transparency log

Release history Release notifications | RSS feed

0.6.1

2 release files

0.6.0

2 release files

0.5.12

2 release files

0.5.11

2 release files

0.5.10

2 release files

0.5.9

2 release files

0.5.8

2 release files

0.5.7

2 release files

0.5.6

2 release files

0.5.5

2 release files

0.5.4

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

This release

0.5.0 This release

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page