Canari
Agent component verification ledger - signed, offline-verifiable, history-preserving attestations for MCP servers, agent skills, and DSH plugins.
Named after the canary in the coal mine: the first to detect that something went wrong.
What it does
- Weekly scan of agent component ecosystems (npm, PyPI, MCP Registry, dsh.so)
- Each component gets a signed attestation: DSSE/Ed25519 envelope whose payload is an in-toto Statement v1 (
subject[] with digest.sha256, predicateType, predicate) binding: artifact hash + host version + scan scenario. Readable by GUAC / cosign / slsa-verifier without Canari-specific code.
- When the registry publishes one, the attestation also records the
publishing repository (
subject.repository, normalised to
host/owner/name). That is what makes "same component on another ecosystem"
a comparison of repositories instead of names; a record with no repository is
unknown, never different.
- Attestations are offline-verifiable by anyone with the public key
- History is never deleted - version changes create supersession chains
- Public machine-readable feed for any AI agent or host to consume
- Trust heuristics: release cadence (L2.4), metadata anomaly (L2.5), typosquatting (L2.6).
Which of these appear in an attestation depends on the entry point - see
Which checks come from which entry point.
- Consumer install gate with policies:
canari-verify bundle.json --key pub.json --gate --gate-policy paranoid
Install
pip install canari-mcp
Also on PyPI and as a
GitHub release
(wheel + sdist + SHA256SUMS + Ed25519 signature). Both channels ship byte-identical
artifacts; see docs/release-process.md to verify the signed release.
canari-gate --store out --list
What this is, end to end
Canari is a verdict ledger for AI agent components. It scans four ecosystems weekly,
signs a verdict per component, keeps the whole supersession history, and exposes an
install-time gate that other programs can call. It is not a scanner (no home-grown
detection engine), not a platform (no accounts, no community) and not an LLM product.
New here? Start with docs/PROJECT-SUMMARY-EN.md — one page,
every number re-derived from an artefact on 2026-11-19 (21 automated checks, 0 failures).
For the full account — day-by-day history, the four times our own figures drifted, the
sampling artefact that turned 84% into 94.78%, and the 66.6% false-pass disclosure — read
docs/PROJECT-STORY-20261119.md.
Open dataset
dataset/ is the published snapshot of the ledger under CC-BY-4.0: 5170 signed
attestations over 1417 components, the canonical feed, drift reports, the schema, both
public keys and a MANIFEST.json with a sha256 per file. Verify a bundle offline with
canari-verify; verify the whole snapshot with the manifest (see dataset/README.md).
Refresh it after a scan with python scripts/sync_dataset.py.
Append-only public log (verifiable without trusting us)
Every published verdict bundle and every upstream dataset snapshot is committed
into a signed, append-only Merkle log at
docs/log/. This closes a gap
that a signature alone cannot: a signed attestation proves who said something,
never that an older statement was not quietly deleted or re-issued with a
different verdict.
- Latest head:
docs/log/head-latest.json (size, root, Ed25519 signature)
- Latest offline bundle:
docs/log/bundle-latest.json
- c2sp.org checkpoint:
docs/log/checkpoint.txt -- the same head as a
signed note in c2sp.org/tlog-checkpoint + signed-note +
tlog-cosignature form, so an existing transparency-log witness can co-sign
it without adopting anything of ours. Pinned against another project's
published test vectors (tests/test_checkpoint.py).
- Format:
docs/spec/append-only-log.md
(RFC 9162 hashing, inclusion + consistency proofs, explicit list of what the
proof does not claim)
- Cross-implementation vectors:
docs/spec/merkle-vectors.json (168 cases),
checked by two independent verifiers
# no network, no canari install needed for the Node path
node docs/spec/verify_offline.js docs/log/bundle-latest.json --log-id canari-snapshot-log
# "the head I recorded yesterday is still a prefix of today's"
python -m canari.verify_offline docs/log/bundle-latest.json \
--pinned-prefix <root-you-saved-last-week>
A new head is appended daily by .github/workflows/append-only-log.yml. The
publish path refuses to sign (LogTruncated / LogRewritten) if the on-disk
log contradicts a head it already published, because a log that re-signs a
rewrite under its own key manufactures false assurance.
Quality gates (enforced in CI)
Measured on 2026-11-18 (local run, python scripts/quality_gate.py):
| Gate |
Threshold |
Current |
| tests |
green on 3.10/3.12/3.13 |
889 collected, 878 passing, 11 env-skip (10 network, 1 platform) |
| line coverage |
>= 85% |
85.3% combined (CI gates on the combined figure) |
| mutation kill rate |
>= 90% (equivalent mutants excluded) |
100% (47 killed + 2 survivors classed equivalent, 3 skipped) |
| live-data audit |
sampled attestations re-derive from npm/PyPI |
18/18 |
Run them yourself before every push:
python scripts/quality_gate.py
That single command runs lint + tests + coverage + mutation, which is the same
set CI enforces. Running only pytest tests is not a substitute: it skips the
coverage gate and the lint gate, and this repository once stayed red for nine
consecutive commits that way.
Quick start
# install
pip install canari-mcp
# run a scan
canari-baseline --limit 50
# verify an attestation offline
canari-verify out/attestations/npm_some-package.bundle.json --key out/public_key.json
# verify + policy gate (exit 0 ALLOW / 5 BLOCK / 6 REVIEW)
canari-verify out/attestations/npm_some-package.bundle.json --key out/public_key.json \\
--gate --gate-policy strict
# custom policy file
canari-verify bundle.json --key out/public_key.json --gate --gate-policy-file my-policy.json
Policy file example
{"name": "my-policy", "block_on_findings": true, "require_native_provenance": false}
Consumer side (the part a host actually uses)
1. Look up a component and gate it
# resolve the newest signed attestation for a component and run the gate
canari-gate --store out --registry npm --name express
canari-gate --store out --registry dsh-registry --name aegis --policy paranoid --json
# exit codes: 0 ALLOW, 5 BLOCK, 6 REVIEW, 3 not found
canari-gate --store out --list
What this gate actually covers. It is a verdict lookup, not a universal
installer check: a component we have never scanned is not found, and the
default policy turns that into BLOCK (fail-closed). The reference store holds
1,437 components -- 66 of the MCP Registry's 22,384 servers (0.29%), plus
239 npm and 611 PyPI packages out of ecosystems orders of magnitude larger.
In practice it behaves as a 1,437-entry allowlist: anything outside it is
refused rather than cleared. Treat BLOCK on an uncovered package as "unknown",
not as "unsafe", and scan it yourself before concluding anything.
2. Record another scanner's result as a signed, timestamped attestation
Live example: 20 PyPI MCP servers, scanned by bandit, recorded and signed - every record on that page
can be verified with canari-verify using the public key shipped beside it.
Canari does not scan anything itself. What it adds is durability: a scanner
tells you what it thinks today, Canari records what it said on each date,
signed and offline-verifiable, and keeps the history when the verdict flips.
canari-ingest-sarif reads a SARIF 2.1.0 report from any external scanner
(NVIDIA SkillSpector, Snyk agent-scan, Tencent AI-Infra-Guard, ...) and writes a
normal Canari bundle:
canari-ingest-sarif \
--sarif skillspector.sarif \
--name @modelcontextprotocol/server-filesystem --version 2025.1.0 \
--registry npm \
--artifact-sha256 <sha256 of the scanned artifact> \
--key out/private_key.pem --out out/attestations
Rules it enforces, so the ledger cannot become a rubber stamp:
- The upstream tool is named, not hidden. Every check records
tool = <scanner>/<version> and checker.id says it was ingested by Canari.
- The artifact digest is required. A scan result without the scanned
artifact's sha256 cannot be bound to anything, so the command refuses.
- An unusable report is an error, not a pass. No run block, or
executionSuccessful: false, yields verdict error.
- Findings move the verdict. Critical/high →
fail; lower severity →
pass-with-findings; no findings → pass.
2. Drift report (what changed since last week)
canari-drift --store out --write out/drift
# verdict flips / same-version silent changes / findings added / findings removed
run_weekly.py writes this report automatically after every scan.
3. Endpoint decay, judged from a streak rather than a single probe
A probe answers "what did this endpoint do at that moment", not "is this entry
dead". Treating one failed probe as a death certificate is a mistake that has
already been made and corrected in public: of 52 hosts that failed at least once
in a ten-day window, 27 (51.9%) answered again later
(registry#1692) —
which is why that issue asks for n consecutive failures separated in time,
not one.
canari-monitor --max-probe 50 # probe, append, re-derive
canari-monitor --report-only # re-derive from history only
A verdict needs repeated, time-separated confirmations (default: 2, at least
6 h apart), so a burst of probes counts once. A success ends the run, and a
record with both a success and a failure is reported as FLAPPING rather than
rounded to broken. Two failure classes are never merged:
| verdict |
means |
INCONSISTENT_CONFIRMED |
the endpoint answered, and the answer was not MCP — the declaration is wrong |
UNAVAILABLE_CONFIRMED |
the endpoint did not answer — availability, not a wrong declaration |
FLAPPING |
both succeeded and failed in the record, too few spaced confirmations to call it |
INSUFFICIENT_EVIDENCE |
first failure, or a burst of probes inside one window |
NEUTRAL_ONLY |
401/403, 5xx, unsupported protocol — we could not look, so there is no finding |
401, 5xx, an unsupported protocol version and a partial handshake are
recorded but never accumulate: "we could not look" is not "it is broken".
4. Use it from any MCP host (dsh, Codex, Claude, ...)
canari-mcp speaks MCP over stdio (zero dependencies) and exposes three tools:
gate_check, verify_bundle, store_summary.
{
"mcpServers": {
"canari": {
"command": "canari-mcp"
}
}
}
No arguments needed: the wheel ships a snapshot of the newest signed attestation
per component (1417 components, rebuilt by scripts/build_snapshot.py from
dataset/), so gate_check answers out of the box. Point --store (or
$CANARI_STORE) at a full ledger checkout when you want the complete
supersession history instead of the snapshot.
A host (or agent) can then ask: "is npm:express allowed to install?" and get
ALLOW / BLOCK / REVIEW with reasons, backed by a signed, offline-verifiable
attestation.
4. Gate the actual install command
canari-guard wraps an install command, checks every component against the
ledger, and refuses to execute when the verdict blocks:
canari-guard -- dsh plugin --profile wbpj add dsh-purge
canari-guard -- npm install some-mcp-server
canari-guard -- pip install mcp-server-fetch==0.2.1
# exit 0 allowed+executed | 5 blocked by ledger | 6 review not confirmed
# --dry-run prints what would run; --allow-review accepts pass-with-findings
The host is never patched - the guard sits in front of the install command.
5. Gate a server before it starts: canari-mcp-gate
canari-mcp-gate is a stdio wrapper. Put it where the MCP client's command
used to be; it looks the component up in the signed ledger, then execs the real
server and proxies the stream byte-for-byte.
Its default is fail-open, and that is a choice you should know you are making.
A component with no attestation, an unidentifiable command, or a missing store
does not block: the wrapper prints a warning to stderr and runs the server anyway.
A gate that refuses every server it has never seen gets uninstalled after one use.
If you want the opposite posture, ask for it explicitly:
# strict: refuse anything not in the ledger
canari-mcp-gate --store out --key out/public_key.json --on-unknown=block -- \
npx -y @modelcontextprotocol/server-filesystem /tmp
# review: stop and make a human confirm (exit 6 unless --allow-review)
canari-mcp-gate --store out --on-unknown=review -- npx -y some-server
# default (allow): unknown components run with a warning
canari-mcp-gate --store out -- npx -y some-server
| situation |
default behaviour |
with --on-unknown=block |
| ledger has a BLOCK verdict |
blocked (exit 5) |
blocked (exit 5) |
| ledger has a REVIEW verdict |
exit 6 unless --allow-review |
same |
| component not in the ledger |
runs, warning on stderr |
blocked (exit 5) |
| command has no derivable registry identity |
runs |
blocked (exit 5) |
--store directory does not exist |
runs, warning on stderr |
blocked (exit 5) |
Two things it cannot do: it is configuration-level (whoever edits the MCP config
can remove the wrapper), and it gates starting a server, not what that server
does afterwards. Client-specific setup, including a dsh profile that was tested
end-to-end, is in docs/integrations/cline.md.
For DeepSeek Harness (dsh), add this to the profile's cordis.patch.yml
(verified end-to-end on dsh: the model called mcp__canari__store_summary and
received the live component count):
- id: mcp-canari
name: '@deepseek-ai/dsh-mcp-client'
config:
serverName: canari
transport: stdio
command: 'canari-mcp' # or: python -m canari.mcp_server
args: ['--store', '<path-to-store>',
'--key', '<path-to-store>/public_key.json']
failOnStartupError: true
6. Ask whether two names are the same component