Skip to main content

stampcheck

Find out whether the human approval step in your system still checks anything, or has quietly become a rubber stamp.

pip install stampcheck
stampcheck demo

Until the first PyPI release is out, install from GitHub instead:

pip install "git+https://github.com/noahberry01123/stampcheck.git"

The report from stampcheck demo

stampcheck demo builds 8 weeks of synthetic refund approvals, checks them, prints a summary, and writes report.html. It takes a few seconds and needs no setup.

Why this exists

  • Many systems send automated decisions (refunds, account locks, takedowns) to a person for approval.
  • Over a few months, reviewers learn that the software is usually right, so they start approving almost everything, in seconds.
  • The log still says "approved by sam", whether sam read the case or not.
  • Existing tools record that a review happened. Nothing checks whether it was real.
  • This tool reads the review data you already have and tells you, in plain language, when a review step has stopped filtering anything.

It is read-only. It never blocks, gates, or changes a decision. Nothing leaves your machine except an optional Slack alert. If it breaks, nothing in production breaks.

What the demo shows

The demo uses one scenario throughout: an AI support agent recommends whether to refund a customer, and human reviewers approve or reject. Refunds are split into three approval steps by size (under €50, €50 to €500, over €500). All names and data are synthetic. This is the real output:

Approval steps
  RED    refund_50_to_500  Drifted into the rubber-stamp zone: time per case went from 1 min 32 s to
                           6 s and disagreement fell from 9.6% to 0% (the last 2 weeks vs the 4
                           weeks before). 25 cases nobody reviewed before the deadline were approved
                           anyway, between 2026-10-14 00:49 and 2026-10-14 02:58 UTC.
  RED    refund_under_50   1 of 2 reviewers matches the rubber-stamp pattern. 1 approval was used
                           for more than one action (case R-10937 ran 3 times); often a retry or
                           idempotency bug.
  GREEN  refund_over_500   No problems found.

Reviewers
  RED    sam     Looks like rubber-stamping: agreed with the system on 218 of 219 decided cases,
                 median 4 s from opening to decision.
  RED    taylor  Drifted into the rubber-stamp zone: time per case went from 1 min 32 s to 6 s and
                 disagreement fell from 9.6% to 0% (the last 2 weeks vs the 4 weeks before).
  AMBER  jordan  One warning sign: fast (median 12 s per case), but still disagrees with the system
                 on 13% of cases.
  GREEN  alex    Engaged: disagrees with the system on 10% of cases, median 2 min 33 s per case.
  GREY   kim     Only 12 decided cases; at least 30 are needed to judge.

Taylor is the interesting one: over the whole 8 weeks taylor's numbers look fine. Only the drift check, which compares the last 2 weeks with the 4 weeks before, catches the slide.

Start logging the one field you are probably missing

Most systems log when a reviewer decided. Very few log when the reviewer opened the case. Without opened_at you cannot tell a reviewer who read the case for two minutes from one who clicked approve two seconds after it appeared, so the rubber-stamp check cannot run. record_review is a one-line way to log it:

import stampcheck

stampcheck.record_review(
    case_id="R-1001",
    recommended="approve",          # what the system proposed: "approve" or "reject"
    decision="approve",             # what the human did: "approve", "reject" or "escalate"
    reviewer="sam",
    opened_at=opened_at,            # when the reviewer opened the case  <- the important one
    decided_at=decided_at,          # when they decided
    notified_at=queued_at,          # optional: when the case entered the queue
    category="refund_under_50",     # optional: the approval step; each gets its own verdict
    executed=1,                     # optional: how many times the approved action ran
)

It writes to ./stampcheck.db (SQLite). Pass path="reviews.jsonl" for JSON lines, or set STAMPCHECK_PATH. Timestamps can be datetimes, ISO strings, or epoch seconds. It never raises: if something goes wrong it logs a warning on the stampcheck logger and your approval flow carries on.

If nobody acted before a deadline and the system applied a default, log decision="timeout_approve" or "timeout_reject".

When the human decides inside one function call (a CLI, a notebook, an agent loop), the context manager records both timestamps for you:

with stampcheck.review(case_id, recommended="approve", reviewer=user_id, category="refund_under_50") as r:
    r.decision = ask_human(case)      # opened_at was recorded on enter
    r.executed = 1 if r.decision == "approve" else 0
# decided_at is recorded on exit

FastAPI approval endpoint

In a web app, opening and deciding are two requests. Record opened_at when the case is served, and pass it at decision time. Full file: examples/fastapi_endpoint.py.

@app.get("/refunds/{case_id}")
def open_case(case_id: str, reviewer: str):
    OPENED.setdefault((case_id, reviewer), datetime.now(timezone.utc))  # store this in your DB
    return CASES[case_id]

@app.post("/refunds/{case_id}/decision")
def decide(case_id: str, body: Decision):
    case = CASES[case_id]
    executed = 0
    if body.decision == "approve":
        issue_refund(case)
        executed = 1
    stampcheck.record_review(case_id, case["recommended"], body.decision, body.reviewer,
                            opened_at=OPENED.get((case_id, body.reviewer)),
                            decided_at=datetime.now(timezone.utc), notified_at=case["created_at"],
                            category=refund_band(case["amount_eur"]), executed=executed)

Human approval step in an LLM-agent workflow

The agent proposes a tool call, a person approves it, and the tool runs only after approval. Full file: examples/agent_approval.py.

proposal = agent_propose(ticket)                     # e.g. {"tool": "issue_refund", "recommendation": "approve", ...}
with stampcheck.review(ticket["id"], proposal["recommendation"], reviewer=current_user) as r:
    show_to_human(proposal)
    r.decision = wait_for_human()                    # "approve" / "reject" / "escalate"
    r.executed = 0
    if r.decision == "approve":
        run_tool(proposal)
        r.executed = 1

Then, once you have a few weeks of reviews:

stampcheck check --source stampcheck.db

Reading your existing data

You don't need record_review to start. Point the check at what you already have.

stampcheck check --source reviews.csv                        # CSV or TSV, delimiter detected
stampcheck check --source reviews.jsonl                      # JSON lines
stampcheck check --source app.db --query "SELECT * FROM approvals"   # SQLite
pip install "stampcheck[postgres]"
stampcheck check --source "postgresql://readonly@db/app" --query "SELECT * FROM refund_reviews"

The check needs one row per reviewed case with these fields:

Field Required Meaning
case_id yes ID of the case or approval request
recommended yes What the system proposed: approve or reject
decision yes What happened: approve, reject, escalate, timeout_approve, timeout_reject
decided_at yes When the decision was made (for timeouts: when the deadline passed)
opened_at for the rubber-stamp check When the reviewer opened the case
reviewer for per-reviewer checks Who decided
category no The approval step, e.g. refund size band. Each one gets its own verdict
notified_at no When the case entered the queue. Shown for context only, never used for verdicts
executed for the duplicate check How many times the approved action ran. Several rows per case are summed

Common column names are recognised automatically (id, ticket_id, reviewed_by, first_viewed_at, closed_at, outcome, and more). The check always prints the mapping it used. If your names differ, write a mapping file:

stampcheck init          # writes a commented stampcheck.yaml with every threshold and mapping option
# stampcheck.yaml (or pass any file with --mapping)
columns:
  case_id: Ref
  recommended: AI Suggestion
  reviewer: Handled By
  opened_at: First Opened
  decided_at: Closed At
  category: Refund Band
values:
  recommended:
    REFUND: approve
    NO_REFUND: reject
  decision:
    AUTO_APPROVED_SLA: timeout_approve
    AUTO_REJECTED_SLA: timeout_reject
timezone: Europe/Berlin   # for timestamps without an offset

A worked example with semicolons, renamed columns, local time offsets, and a few garbage rows:

stampcheck check --source examples/messy.csv --mapping examples/mapping.yaml

Values are never guessed. Common spellings (approved, Rejected, denied, ESCALATED) are accepted and shown in the output. Anything else is listed with a count, and those rows are skipped until you map the value. Rows with no case ID or an unreadable decided_at are skipped and counted too.

The mapping file is YAML or JSON. PyYAML is optional (pip install "stampcheck[yaml]"); without it a built-in reader handles the simple format above.

The checks

Each check gives a verdict (GREEN, AMBER, RED, or GREY for "not enough data") and one sentence explaining why. GREY never means pass.

Check RED / AMBER when What it usually means
Rubber-stamping RED: at least 30 decided cases, the 95% upper bound on the disagreement rate is under 5%, and the median time from opened to decided is under 30 s. AMBER: only one of the two Reviewers click through. The step filters nothing
Drift RED: the last 2 weeks are in the rubber-stamp zone and the 4 weeks before were not. AMBER: time per case fell by half or more, or disagreement fell clearly A careful reviewer or team is sliding toward rubber-stamping
Silent timeout approvals RED: any case nobody reviewed before the deadline that still ended in approval A timeout default that fails open
Duplicate execution RED: one approval used for more than one action A retry or idempotency bug
Suspicious logging AMBER: recommended or decision has one value on 99% or more of rows, or the second value appears fewer than 5 times The column may be hard-coded. Findings built on it are not trusted
Queue overload AMBER: more than 200 decided cases per reviewer per working day Shown as the likely cause next to a rubber-stamp finding

Disagreement means the human did something other than what the system recommended (escalating counts). The upper bound is the Wilson 95% interval: with few cases, a 0% rate is weak evidence, so the check asks how high the true rate could plausibly be. Time per case always comes from opened_at, never notified_at, because time since notification includes time waiting in the queue.

Every threshold lives in the config file (stampcheck init writes them all with comments), and every report prints the values it used.

Output, exit codes, CI

stampcheck check prints a summary and writes two files to --out (default: the current folder):

  • report.html: self-contained (no network). Verdict per approval step, a scatter of time per case against disagreement with the danger zone shaded, weekly trends, how verdicts are decided, and a data-quality section (rows read, rows skipped and why, missing columns, checks that could not run).
  • result.json: the same results for scripts.

Exit codes: 0 nothing is RED, 1 something is RED, 2 input error. That makes it usable from cron or CI.

To get a Slack message only when something is RED or newly drifting:

stampcheck check --source "$DB_URL" --query "SELECT * FROM refund_reviews" --alert "slack:$SLACK_WEBHOOK_URL"

"Newly" is judged against the previous result.json in the output folder. A ready-to-copy weekly GitHub Actions workflow is in examples/github-actions/stampcheck.yml.

Reviewers are people

Alerts are team-level and step-level by default: they say "1 of 2 reviewers matches the rubber-stamp pattern", not who. Add --per-reviewer to name reviewers in alerts, and --pseudonymize to replace reviewer IDs with salted hashes everywhere (set pseudonymize_salt in the config so hashes stay stable between runs). The terminal output and the local report show reviewer IDs, because you already have that data.

A rubber-stamp pattern usually points to a system problem: queues that are too long, a model that is right so often that checking feels pointless, or a timeout default that fails open. Patterns in review data are evidence to look into, not proof that anyone did anything wrong.

In some countries, monitoring individual employees needs agreement first. In Germany, for example, it usually needs the works council's (Betriebsrat) agreement. Start at team level.

Development

pip install -e ".[dev,yaml]"
pytest
python tests/make_messy.py    # regenerate examples/messy.csv after changing the demo

Python 3.10 or newer. No runtime dependencies. MIT licence.

Compliance

These checks relate to GDPR Art. 22, which covers decisions based solely on automated processing (official guidance says human involvement only counts if it is meaningful, not a token rubber stamp), and to EU AI Act Art. 14, which requires effective human oversight of high-risk AI systems from December 2027. The tool gives you evidence about your review step. It isn't legal advice.

Using this at work and need something for your DPO, auditor or a customer audit? Tell us what you need in GitHub Discussions.

Metadata

Release files for stampcheck 0.1.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 stampcheck 0.1.0
File Size Uploaded Provenance Actions
stampcheck-0.1.0.tar.gz 41.4 kB Without provenance Details for stampcheck-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 76.9 kB

Release files / stampcheck-0.1.0.tar.gz

Download URL stampcheck-0.1.0.tar.gz
Size 41.4 kB
Tags Source
SHA-256 checksum
How to use checksums
26de538e906cfb057066d8ce66a1282049191fea725f12927dd0970adbb0c5a4
BLAKE2b-256 checksum
How to use checksums
c93f48595395f0f9899194d5bb762e3aa3cfa3c54d4f36496991f6480a0adc8b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release files / stampcheck-0.1.0-py3-none-any.whl

Download URL stampcheck-0.1.0-py3-none-any.whl
Size 35.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f125d15c28757f0467e405b8c868820898b66e03ef2df5e0f3f1d256ef15e911
BLAKE2b-256 checksum
How to use checksums
5449a24fcdae35f0d039020e192b4bc5bf9f324c6f9dd473aae6f2ff392c90be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Security for stampcheck 0.1.0

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

0.1.0 This release

2 release files No provenance

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