Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

agentdq

The data defects that break an ML model are not the ones that break an LLM agent reading the same table. agentdq measures that difference, then checks each new batch of data per consumer: the same batch can be safe for your agent and harmful for your model.

Based on Asymmetric Data-Quality Sensitivity in Predictive Models and LLM Agents (Satishkumar & Padmanabha Suwarna, ARRL workshop, IEEE ICDM 2026). Paper code: AsymmetricDataQualitySensitivity.

pip install agentdq

How it works

  1. Profile each consumer once, offline. profile_sensitivity corrupts a labelled sample in known ways and measures how much each consumer's AUROC drops per unit of each defect. Families that don't touch the columns a consumer reads are skipped without any scoring calls, so profiling an LLM agent stays cheap.
  2. Check every new batch, without labels. validate runs six label-free detectors against a clean reference sample, estimates each defect's severity, and multiplies it by each consumer's sensitivity. The result is an expected AUROC drop and a pass, warn or fail per consumer, next to the verdict a one-size-fits-all checker would give.

Example

import agentdq as dq

roles = dq.ColumnRoles.of(protected={"order_id", "label"}, monetary={"price"},
                          text={"review"}, taxonomy={"category"})

tree = dq.SklearnConsumer(fitted_model, channels=["price", "qty", "category"], name="tree")
agent = dq.LLMConsumer(score_review_with_llm, channels=["review", "category"], name="agent")

profiles = [dq.profile_sensitivity(c, labelled_sample, "label", roles=roles) for c in (tree, agent)]
profiles[0].to_json("tree_profile.json")          # reuse later with SensitivityProfile.from_json

report = dq.validate(todays_batch, reference_sample, profiles, roles=roles, label_cols={"label"})
print(report.to_markdown())
Baseline (consumer-agnostic) verdict: **fail**

| Consumer | Risk | Verdict | Top defects |
|---|---|---|---|
| tree | 0.066 | fail | currency_unit_drift |
| agent | 0.000 | pass | none |

| Defect | Severity |
|---|---|
| currency_unit_drift | 0.297 |

Here 30% of prices arrived in cents. A classic gate fails the whole batch; agentdq says the tree model should not use it, but the review-reading agent can.

validate raises LeakageError if any consumer reads a label column, the bug the paper's leakage audit found.

What's inside

Module What it does
corruption 9 seeded corruption families (missing values, type flips, category swaps, duplicates, schema drift, unit drift, timezone shifts, taxonomy drift, mojibake) on any table, via ColumnRoles
consumers SklearnConsumer for any fitted model; LLMConsumer for any function that scores a row, with concurrency, retries and a JSONL call log
profile profile_sensitivity and SensitivityProfile (mean drop, bootstrap 95% CI and slope per family)
detectors Label-free severity estimates for missing values, schema drift, type flips, unit drift, mojibake and taxonomy drift
validate Per-consumer risk, verdicts, the leakage guard and Report.to_markdown()

Status

Alpha (0.1.0a1). The API may change before 0.1.0. Runs offline with no LLM needed; CI tests Python 3.10 and 3.12.

Acknowledgements

The corruption families are ported from the ICDM paper code. The scaffolding, docstrings and tests were drafted with AI assistance (Claude), and the profiling, detection and validation code was implemented with AI assistance (GitHub Copilot). The design follows the author's paper, and the commit history records the AI co-authorship.

Licence

MIT

Metadata

Release files for agentdq 0.1.0a1

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

Source distribution (sdist)

Source distribution for agentdq 0.1.0a1
File Size Uploaded Provenance Actions
agentdq-0.1.0a1.tar.gz 20.0 kB Without provenance Details for agentdq-0.1.0a1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for agentdq 0.1.0a1
File Interpreter ABI Platform Actions
agentdq-0.1.0a1-py3-none-any.whl Python 3 none any Details for agentdq-0.1.0a1-py3-none-any.whl

Total release size: 36.2 kB

Release files / agentdq-0.1.0a1.tar.gz

Download URL agentdq-0.1.0a1.tar.gz
Size 20.0 kB
Tags Source
SHA-256 checksum
How to use checksums
1d6f5d049cd2c8e76df6115d27d679c558f03fdd1dcc5d89dabd43ea87d51cab
BLAKE2b-256 checksum
How to use checksums
be3bf697ec19664cebf2b95031bef1e1a135be67a9d6dad28ed0d5415ce4b176
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.11

Release files / agentdq-0.1.0a1-py3-none-any.whl

Download URL agentdq-0.1.0a1-py3-none-any.whl
Size 16.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
311d103ed69ef8d1738cfa5d6f3e0eb11066cab727ce6ee13039777273c7c329
BLAKE2b-256 checksum
How to use checksums
ae39d08bd0c7189a7df646c6c94e92cb08d521e1db98aef40c47e5868ba03d80
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.11

Security for agentdq 0.1.0a1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

Release history Release notifications | RSS feed

This release
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