Skip to main content

Assaystone

Assaystone

Your agent's tests pass. Did it delete the failing test?

ci pypi release status python license website

Assaystone turns one unit of agent work into a certificate: pass, fail, or a human must look — with the evidence, the check that decided it, the check that could not, and the cost of deciding.

It is not an eval platform, an agent framework, or a judge. It is the acceptance layer: contracts a domain expert can review, checks that declare what they cannot see, and a verdict a third party can re-check without re-running the agent. Every certificate also carries the measured reliability of the checks that decided it — recall, false alarms, and the sample size behind the number. It runs locally, offline, with no API key.

uvx assaystone demo audit                 # find a failure you did not know you had
assaystone check --base origin/main --certificate ./certs   # no trace required

check compares the working tree to a base ref, runs the contract, and writes a certificate. In CI it is one step; locally it is the last thing you run before review.

No contract? assaystone check uses a minimal default and still gives a verdict. It detects the test runner — pytest, unittest, npm/pnpm/yarn, go, cargo, maven, gradle — and only claims the checks it can actually decide on this repository. assaystone init writes the same contract as an editable file.

60 seconds

No setup, no key, no transcript of your own:

$ uvx assaystone demo audit
audit-demo-session  changed: pricing/discounts.py, tests/test_discounts.py
  HIGH     tests.integrity          tests/test_discounts.py (removed 1 test(s))

summary: 0 critical, 1 high, 0 medium, 0 low

certificate: ./assaystone-demo-certificates/audit-demo-session.certificate.json
verify it:  assaystone certificate verify <that file>

The demo ends with the artifact, not with advice. The agent fixed the rounding bug, then deleted the one test it still failed, and reported success. tests.pass saw a green suite. The audit found the deleted test. The same attacks, with minimal reproductions, are in docs/evasions.md.

The certificate

A verdict without evidence cannot be reviewed. Evidence without provenance cannot be trusted. A decision without versions cannot be reproduced. The certificate binds the three into one hash-addressed object.

assaystone certificate show   ./certs/<id>.certificate.json
assaystone certificate verify ./certs/<id>.certificate.json   # a third party, offline
certificate   sha256:f5ad3661...
subject       git-106f71d9-ecd825e63473 (working-tree, source: runtime)
contract      code
decision      FAIL
first failure tests.integrity: tests/test_discounts.py (removed 1 test(s))
checks        2 (1 pass, 1 fail, 0 escalate)
assurance gap 0.00 (0/0 criteria unknown)
cost          $0.000030 (verification $0.000030)

Same decision and same versions produce the same id. Edit one piece of evidence and the id changes. The certificate records what each check declared it could not see, the independence actually earned (computed from provenance, not claimed), the assurance gap, and what the decision cost. A check that reads agent-written testimony is downgraded; an unconfirmed failure becomes an escalation, not a pass.

Check a repository

A contract is a small JSON file. It names the checks, their parameters, and what to do when a check cannot decide:

{
  "name": "code",
  "test_command": ["{python}", "-m", "pytest", "-q"],
  "verifiers": [
    {"name": "diff.syntax", "required": true, "params": {}},
    {"name": "tests.integrity", "required": true,
     "params": {"protected_prefixes": ["tests/"]}},
    {"name": "tests.harness_integrity", "required": true, "params": {}},
    {"name": "tests.pass", "required": true, "params": {}}
  ]
}
assaystone check                                   # zero config, default contract
assaystone check --base origin/main --certificate ./certs

Exit codes are the interface: 0 pass, 1 fail, 2 escalate or unable to check. A CI step can gate on them without parsing output.

on: pull_request
permissions:
  contents: read
  pull-requests: write
steps:
  - uses: actions/checkout@v4
    with:
      fetch-depth: 0
  - uses: yellowsand1/assaystone@v0.42.0

No inputs. The Action resolves the PR base, uses the discovered or default contract, writes a certificate, uploads it as assaystone-certificate, and posts one sticky comment: PASS, FAIL, or NEEDS REVIEW, with the failing check and what was not checked. Details: docs/action.md.

What a passing test suite misses

Defect tests.pass Assaystone
Agent deletes the failing test ✅ passes ❌ tests.integrity
Agent edits CI to skip the suite ✅ passes ❌ diff.forbidden_paths
Agent leaves a debug print ✅ passes ❌ quality.no_debug_prints
Agent weakens an assertion ✅ passes ❌ tests.integrity
Agent shadows the test runner ✅ passes ❌ tests.harness_integrity
Regression in another module ❌ fails ❌ tests.pass

The first four are not hypothetical: they are labelled cases in failure_zoo, and every built-in check is scored against them on every release.

Calibrated, not just evidenced

A verdict is only as good as the check behind it. Each check in a certificate carries its measurement: recall on the defect classes it claims, false alarms on clean cases, adversarial recall, and n — the sample size.

calibration   3/12 checks measured (gap 75%); min recall 100% on n=2; max false alarm 0%

A check with no measurement says unmeasured; it does not get a number. The profile is generated from the public corpora and cited by digest, so a reviewer can see what the instrument is worth, not only what it said.

The certificate also says which view the verifier judged. An execution that was compacted, delegated, or imported through a vendor is a summary, not the execution: transport compacted (risk high). A contract can require a native view, and a pass that rests on a summary escalates. See docs/transport.md.

Calibration can also be a gate. Set "require_measured": true in a contract and a pass that rests only on unmeasured checks becomes an escalation. External checks can bring their own profile with --reliability profile.json; the certificate cites the profile's source and digest.

assaystone prove --write-reliability profile.json

The current table, including the checks that are still unmeasured, is docs/reliability.md. prove --gaps turns the table into a work list: the checks that decide most often and have no measurement.

assaystone prove --gaps --certificates ./certs

Spec coverage

A contract says what acceptable means. A spec says what this task asked for:

assaystone check --base origin/main --spec .assaystone/spec.json

Obligations compile into deterministic evidence rules — a changed path, a file that contains a string, a path that must not change, a file that must exist — and the certificate reports how many were met, violated, or could not be decided. spec 2/3 obligations met; violated: ci. Format and limits: docs/spec.md.

Prove the checks

A verifier you have never challenged is a liability. One command measures both questions that a pass rate hides:

$ assaystone prove
[recall] a known defect is caught
Failure Zoo: 26 cases (20 defective, 6 clean)
case-level: caught=9/9 escaped=0 false_alarms=0 recall=100%

[resistance] an agent that knows the contract still has to work
Goodhart suite: 17 cases (13 defective, 4 control)
resistance=85% caught=11 escalated=0 escaped=2 false_alarms=0

Recall asks whether a check catches a defect you injected. Resistance asks whether an agent that has read the contract can pass without doing the work. A contract can score 100% recall and still be trivially gameable; prove reports both, and the families where the leaks are.

A reproducible run on a real repository — Flask, three changes, 68–98 ms per check — is in docs/field-note-flask.md. It states what the sample does and does not support.

Audit your own sessions

The cold start is an audit, not a framework. Point it at the newest local Claude Code or Codex transcript; nothing leaves the machine:

assaystone audit --latest claude-code
assaystone audit --latest codex --write-contract .assaystone/contract.json

It reconstructs what the agent changed, runs a default rule set, and writes the first contract from what it found. Open the findings, keep the rules that matter, delete the rest.

Install

uvx assaystone --version        # no install, throwaway environment
pip install assaystone==0.42.0  # the published release

Python 3.10+.

macOS note: the system python3 is often 3.9. If pip install cannot find a distribution, use uvx above or install Python 3.12.

Integrations

  • GitHub Action: gate a PR and upload the certificate (above).
  • pytest: pytest --assaystone runs the contract after the suite.
  • Claude Code hooks: a pre-tool policy gate, a post-tool syntax/secret check, a Stop contract gate with a certificate, and a Stop audit; each in warn or block mode.
  • Adapters: Claude Agent SDK, OpenAI Agents SDK, LangGraph messages, and LangSmith / Langfuse / OpenTelemetry exports.
  • Custom checks: a check declares claim, catches, blind_spots, trusts, independence, cost_usd, and returns pass | fail | None.

Details: docs/integrations.md, docs/verifiers.md, docs/plugin.md.

How it works

episode  →  contract  →  checks  →  evidence  →  decision  →  certificate
  • Episode: a working tree, a recorded trace, or a runtime action.
  • Contract: obligations a human can review, each bound to defect tags.
  • Checks: deterministic first, ordered by declared cost; a crash fails closed.
  • Decision: pass, fail, or escalate; a low-independence failure cannot decide alone.
  • Certificate: hash-addressed, provenance-bound, re-checkable offline.

Full design and invariants: ARCHITECTURE.md.

Design principles

  1. Evidence over scores. A verdict carries pointers a third party can re-open.
  2. Three values, never two. pass, fail, escalate.
  3. Cascade; judges never decide alone. The default path is offline and key-free.
  4. Independence is provenance. Agent-written testimony does not count as evidence.
  5. Verify the verifier. No check ships without a clean case, a defective case, a declared blind spot, and a measured cost.

The direction, the ten laws, the non-goals, and the kill criteria are in GOALS.md. The current bet is in ROADMAP.md.

Status

v0.42.0 — alpha. The kernel is stable; the surface is deliberately small: audit, check, certificate, prove, hook. Everything else lives under assaystone lab and is frozen — no new features, deletion allowed. Old top-level names still resolve as aliases so existing CI does not break.

Known limitations, stated rather than hidden:

  • The default checks are for code in a git repository. Other domains are lab code.
  • tests.integrity is path- and structure-based; it reports activity, not intent.
  • The failure corpus is a floor, not a population estimate. prove reports sample size.
  • Escalation is a first-class outcome, not a bug. If a check cannot decide, it says so.

Contributing

Read GOALS.md and ARCHITECTURE.md first. A change answers five questions:

  1. Does it increase evidence per decision, or decrease the cost of a decision?
  2. Can a third party re-check the output without re-running the agent?
  3. Does it work offline, with no key, on the default path?
  4. Does it reduce time-to-first-verdict?
  5. Is it a new surface? If so, who asked for it?

Then run:

make test && make pytest && make lint && make demo-audit

See CONTRIBUTING.md and CODE_OF_CONDUCT.md.

Name

An assay is a test that determines what a substance actually contains. The stone is the touchstone: it does not declare the answer, it leaves a mark that someone else can check. That is the whole idea.

License

Apache-2.0. See LICENSE.

Metadata

Release files for assaystone 0.42.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 assaystone 0.42.0
File Size Uploaded Provenance Actions
assaystone-0.42.0.tar.gz 373.5 kB With provenance Details for assaystone-0.42.0.tar.gz

Built distribution (wheel)

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

Total release size: 680.3 kB

Release files / assaystone-0.42.0.tar.gz

Download URL assaystone-0.42.0.tar.gz
Size 373.5 kB
Tags Source
SHA-256 checksum
How to use checksums
4194a127a9415d745f03ac19e76627c65799ad324e590a0949a9fb70ca33dbfb
BLAKE2b-256 checksum
How to use checksums
e8a80f9fe99e6c34e1ef3cac0deed98b12e3c4e9dd1da39e1410b1428d35ce50
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 Dec 1, 2026.

Transparency log

Release files / assaystone-0.42.0-py3-none-any.whl

Download URL assaystone-0.42.0-py3-none-any.whl
Size 306.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
402debe7e75e07de691022bce00c5ef9000132aa6026d76b440cdd4994da3c8b
BLAKE2b-256 checksum
How to use checksums
894a177f1a9dda45836795bf1543579f0361665bd5541d0b78bb6e4c93de2aa4
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 Dec 1, 2026.

Transparency log

Security for assaystone 0.42.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.

Full provenance

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

Select from 2 files

Attestation for assaystone-0.42.0.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 Dec 1, 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.

Release history Release notifications | RSS feed

This release

0.42.0 This release

2 release files Full 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