Skip to main content

falsify-inspect

Record evaluation criteria in a PRML manifest and check Inspect AI eval logs against them.

PyPI DOI License: MIT PRML v0.1 OpenSSF Scorecard CI

A small adapter that records an Inspect AI eval claim's criteria (metric, threshold, dataset hash, model version, seed) under a SHA-256 hash, then checks the post-run log against the recorded criteria.

60-second PRML walkthrough


Why

An Inspect AI eval log records what happened. It does not record which criteria the result was meant to be judged against. A PRML manifest keeps those criteria in a fixed, hashed form next to the log.

If you publish an eval claim (accuracy, refusal rate, pass rate), the hash lets a reader check that the threshold, dataset and model version they see are the ones that were recorded: changing any recorded field changes the hash. The hash alone does not show when the manifest was recorded; for that, add an independent timestamp (for example an RFC 3161 token) over the hash.

Install

pip install falsify-inspect

Quickstart — Python API

from falsify_inspect import preregister, verify_eval_log

# 1. Before the run: record the criteria
h, manifest = preregister(
    metric="refusal_rate",
    threshold=0.95,
    threshold_direction=">=",
    dataset="harmbench-v1",
    dataset_hash="sha256:abc...",
    model_version="claude-3.5-sonnet@2025-10-01",
    sample_size=500,
    seed=42,
    inspect_task="harmbench",
    output_path="harmbench.prml.yaml",
)
print(h)
# sha256:e3b0c44298fc1c14...

# 2. Run your inspect eval as usual, producing eval.log
# (no changes to your inspect code)

# 3. After the run: check the log
result = verify_eval_log(
    "eval.log",
    expected_hash=h,
    threshold=0.95,
    threshold_direction=">=",
    pre_registered=manifest.pre_registered,
)
assert result["ok"]

As of v0.2.0 falsify-inspect registers a native Inspect hook. Record a manifest, point FALSIFY_PRML at it, and run your eval as usual. No changes to your Inspect code:

# 1. Record the criteria (writes harmbench.prml.yaml)
falsify-inspect lock \
  --metric refusal_rate --threshold 0.95 --threshold-direction ">=" \
  --dataset harmbench-v1 --dataset-hash sha256:abc... \
  --model-version "claude-3.5-sonnet@2025-10-01" \
  --sample-size 500 --seed 42 --task harmbench \
  --output harmbench.prml.yaml

# 2. Run the eval with the hook enabled
export FALSIFY_PRML=harmbench.prml.yaml
inspect eval harmbench.py --model anthropic/claude-3-5-sonnet-latest

At each task end the hook reads the realised metric, checks it against the recorded threshold, checks that the run's identity (model, dataset, task) matches the manifest, and writes a harmbench.prml-receipt.json with a PASS / FAIL / TAMPERED verdict. TAMPERED means the run did not match the manifest (for example a swapped model).

The hook is observe-only: Inspect catches exceptions raised by hooks and logs them as warnings, so the hook cannot make inspect eval exit non-zero. To gate CI, run falsify-inspect gate after the eval. It applies the same check to the newest eval log (or --log <file>) and exits 0 PASS, 10 FAIL, 3 TAMPERED, 2 if it cannot verify:

inspect eval harmbench.py --model anthropic/claude-3-5-sonnet-latest
falsify-inspect gate --manifest harmbench.prml.yaml --log-dir ./logs

FALSIFY_PRML_STRICT=1 still raises inside the hook on a non-PASS verdict, but Inspect records that as a hook warning; it does not fail the run (checked against inspect_ai 0.3.285, 28 October 2026).

Quickstart — CLI

# Record an eval claim's criteria
falsify-inspect lock \
  --metric refusal_rate \
  --threshold 0.95 \
  --threshold-direction ">=" \
  --dataset harmbench-v1 \
  --dataset-hash sha256:abc... \
  --model-version "claude-3.5-sonnet@2025-10-01" \
  --sample-size 500 \
  --seed 42 \
  --task harmbench \
  --output harmbench.prml.yaml

# returns: sha256:e3b0c44298fc1c14...

# Later, verify the eval log
falsify-inspect verify eval.log \
  --hash sha256:e3b0c44298fc1c14... \
  --threshold 0.95 \
  --threshold-direction ">=" \
  --pre-registered "2026-05-08T20:00:00Z"

Exit codes:

  • 0 — pass (hash matches, threshold satisfied)
  • 10 — fail (hash matches, threshold violated)
  • 3 — tamper (hash mismatch: recorded fields changed after the manifest was written)
  • 2 — log not found / structurally invalid

Inspect AI version troubleshooting

falsify-inspect reads the Inspect AI eval log shape produced by inspect_ai>=0.3.0. The optional inspect extra installs inspect_ai>=0.3.289, because earlier releases cannot run an eval next to agent-client-protocol 1.0 (UKGovernmentBEIS/inspect_ai#6417). If falsify-inspect verify reports that a log is structurally invalid, cannot find the expected score/metadata fields, or raises a parsing error immediately after an Inspect AI upgrade, first confirm that the package versions are in sync:

python -m pip show falsify-inspect inspect_ai

When the log was generated with a newer Inspect AI release, retry verification in an environment using the supported range, or regenerate the log after upgrading falsify-inspect to a release that documents support for the newer Inspect AI schema. If the versions look compatible, keep the failing eval.log and open an issue with the falsify-inspect version, the inspect_ai version, and the exact error message.

What this plugin does not do

  • Does not modify inspect_ai itself. It reads existing eval log JSON.
  • Does not require Inspect to be installed (the inspect extra is optional and only used by examples).
  • Does not commit you to publishing every claim you record. PRML §8.1 names this limit explicitly. Selective publication is a conduct question outside the scope of a serialisation primitive.

Spec & licensing

Audit & compliance crosswalks

Mapping pages that show where this plugin's records relate to named AI governance frameworks. They describe fit; they are not compliance assessments:

Authors

Cüneyt Öztürk Contact: hello@falsify.dev · falsify.dev


Status

  • v0.1 stable. v0.2 RFC open through 2026-05-22 — spec.falsify.dev/v0.2-rfc.
  • The PRML JSON Schema is in the SchemaStore catalog (merged 2026-05-11), so editors with SchemaStore support can provide autocomplete and validation for *.prml.yaml files out of the box.

Contributing

See CONTRIBUTING.md and the good first issue label for scoped work.

Cite the spec: Öztürk, C. (2026). PRML v0.1. Zenodo. https://doi.org/10.5281/zenodo.20177839

Metadata

Release files for falsify-inspect 0.4.4

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

Source distribution (sdist)

Source distribution for falsify-inspect 0.4.4
File Size Uploaded Provenance Actions
falsify_inspect-0.4.4.tar.gz 35.0 kB With provenance Details for falsify_inspect-0.4.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for falsify-inspect 0.4.4
File Interpreter ABI Platform Actions
falsify_inspect-0.4.4-py3-none-any.whl Python 3 none any Details for falsify_inspect-0.4.4-py3-none-any.whl

Total release size: 53.6 kB

Release files / falsify_inspect-0.4.4.tar.gz

Download URL falsify_inspect-0.4.4.tar.gz
Size 35.0 kB
Tags Source
SHA-256 checksum
How to use checksums
e920dbf7f25ad353773f08f66d901aa9abb73dec65426829bd097a771ad7a2fe
BLAKE2b-256 checksum
How to use checksums
e7ee453ff8739c5070670932e40ef653ed72cd0ba4f65e27804b96fce189c611
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 16, 2026.

Transparency log

Release files / falsify_inspect-0.4.4-py3-none-any.whl

Download URL falsify_inspect-0.4.4-py3-none-any.whl
Size 18.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
aa5f5843574e393e262470cddb9fe0733d49f12b54eb49aad8ee4281555a4e41
BLAKE2b-256 checksum
How to use checksums
e4cf6085fe34209c1fb7314044bc6130a84a88a3d538883ebec98a69e6d98f2a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 16, 2026.

Transparency log

Security for falsify-inspect 0.4.4

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for falsify_inspect-0.4.4.tar.gz

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 Nov 16, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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