Skip to main content

MLflow plugin: automatic PRML manifest hash tagging for runs. Pre-registered ML evaluation claims.

Project description

mlflow-falsify — automatic PRML manifest hash tagging for MLflow runs

PyPI version Python versions License: MIT DOI Spec: PRML v0.1

Drop a PRML manifest in your repo. Every MLflow run gets cryptographically bound to it. No workflow changes.

Install

pip install mlflow-falsify

The plugin is discovered automatically through MLflow's mlflow.run_context_provider entry point.

Usage

import mlflow

# .prml.yaml exists in CWD or any parent directory — that's all you need.
with mlflow.start_run():
    mlflow.log_metric("accuracy", 0.873)
    # The run now carries prml.manifest_hash and friends as tags.

Verify the locked predicate at run end (0.3.0+)

Tagging proves which bar the run was bound to; locked_run also checks it:

import mlflow, mlflow_falsify

with mlflow_falsify.locked_run():
    mlflow.log_metric("accuracy", 0.91)
# run is now tagged:
#   prml.verdict  = PASS | FAIL | UNVERIFIED | TAMPERED
#   prml.observed = 0.91

TAMPERED means the manifest changed between run start and verification — the goalpost moved mid-run. Post-hoc: mlflow_falsify.verify_run(run_id). Set MLFLOW_FALSIFY_STRICT=1 to raise on FAIL/TAMPERED in CI.

What gets tagged

When a .prml.yaml or prml.yaml is found in the current directory or any ancestor, every run is tagged with:

  • prml.manifest_hash — SHA-256 of the canonical manifest bytes (PRML v0.1 §3)
  • prml.manifest_path — relative path to the discovered manifest
  • prml.version — manifest schema version (e.g. prml/0.1)
  • prml.metric — the pre-registered metric (e.g. accuracy)
  • prml.comparator — one of >=, >, ==, <=, <
  • prml.threshold — the numeric threshold, as a string
  • prml.dataset_id — the pre-registered dataset identifier

Missing or malformed fields are silently skipped. The provider never raises into your run.

HPO sweeps and tag scope

In an HPO sweep the same PRML claim repeats across thousands of runs, so emitting the 5 descriptive tags per-run becomes pure tag noise. As of v0.2.0 the plugin supports lifting them to experiment level:

export MLFLOW_FALSIFY_TAG_SCOPE=experiment
import mlflow_falsify

mlflow.set_experiment("credit-scorer-hpo")
mlflow_falsify.tag_experiment()  # idempotent; sets metric/comparator/threshold/dataset_id/version once

for params in hpo_grid:
    with mlflow.start_run():
        ...  # only prml.manifest_hash and prml.manifest_path attach per-run

Default behaviour (MLFLOW_FALSIFY_TAG_SCOPE=run or unset) is unchanged: all 7 tags attach per-run, backward-compatible with v0.1.x.

Why this matters

  • EU AI Act Article 12 evidence layer. Every logged run carries a tamper-evident pointer to the claim it was meant to test.
  • Eval reproducibility by default. The hash freezes metric, threshold, dataset, and seed before the experiment runs.
  • Audit trails for free. Reviewers can recompute the manifest hash from the YAML and compare it against your tracked runs.
  • No workflow change. Existing MLflow code is untouched — the plugin attaches via entry points.

Links

Audit & compliance crosswalks

Where the manifest hash this plugin attaches fits in major AI governance frameworks (FULL / PARTIAL / NONE tagged):

License

MIT. Copyright 2026 Cüneyt Öztürk.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mlflow_falsify-0.3.0.tar.gz (15.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mlflow_falsify-0.3.0-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

Details for the file mlflow_falsify-0.3.0.tar.gz.

File metadata

  • Download URL: mlflow_falsify-0.3.0.tar.gz
  • Upload date:
  • Size: 15.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mlflow_falsify-0.3.0.tar.gz
Algorithm Hash digest
SHA256 8ce5de3715c48b450904bb5cdb18dc395cf04be4d09bfc0394739ac0a1b4933b
MD5 bb611fa6e9eb3183adc78e97c6197834
BLAKE2b-256 e6928170561cce766a59263b411ded30948aea9368a3046e19b20115ac6f1595

See more details on using hashes here.

Provenance

The following attestation bundles were made for mlflow_falsify-0.3.0.tar.gz:

Publisher: publish.yml on studio-11-co/mlflow-falsify

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mlflow_falsify-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: mlflow_falsify-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 12.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mlflow_falsify-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c69b738367782b0fb5ceedb842401ab7c84de7a01c1c1fd1d56e51b3f1e2cce0
MD5 2a810146c24e4646c0449b6c235bcc46
BLAKE2b-256 154cc9fe627f68fa45d873dd354bc4d2b217f22fa3c75a24427f7140b5c5ab1d

See more details on using hashes here.

Provenance

The following attestation bundles were made for mlflow_falsify-0.3.0-py3-none-any.whl:

Publisher: publish.yml on studio-11-co/mlflow-falsify

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page