Agentic property-based testing

· Testing · Verification · Coding-Agents · Rust · Sqlite

What it is

Property-based testing checks a rule that must hold for every input (“sorting keeps every element”, “decode(encode(x)) equals x”) by throwing generated inputs at it and shrinking any failure to a small example. The hard part has always been the input generator: a naive one rarely reaches the interesting code.

The agentic version splits the work. You write, or at least approve, the properties. A coding agent writes the generator, runs it, reads coverage and failures, and improves the generator round after round. You stay in charge of what “correct” means; the agent does the tedious search for inputs that break it.

Why it is getting attention now

Datadog published Ephyra, an open source Rust library built for this loop, on 24 November 2026, and it reached Lobsters on 3 December. The reported numbers are what caught people’s eye: 535 previously unknown bugs across 26 well-tested open source systems, 373 confirmed by maintainers and 313 already fixed. Examples include a database corruption bug that had been in SQLite for nearly 13 years, a memory-safety bug in OCaml that was 24 years old, and a PostgreSQL query of 670 bytes that needed almost 100 GB to parse.

In the SQLite case study the agent grew the generator over 37 rounds, from 79 to 261 SQL features, and coverage of SQLite’s instrumented counters rose from 35.9% to 74.1%, with 26 bugs found along the way.

It also answers a problem the reader will recognise: agents write code faster than review and example-based tests can verify it.

How to try it in about ten minutes

  1. Pick something small with an obvious rule: a parser and printer pair, a serialiser, a function with a slower reference implementation.
  2. Install the CLI: cargo install ephyra-cli. For a Rust project, add ephyra = "0.0.1" under [dev-dependencies]. For anything else, the guide says to write a small Rust test crate that drives the system through its API or command line.
  3. In Claude Code or Codex, ask the agent to read the Ephyra README.md and STARTUP.md, then to list the three to five properties it intends to check and where each one comes from in your docs, types or tests. Stop there and review the list. This is the step that matters.
  4. Let it write generators and run them. Ask for a minimal reproducer and a regression test for each failure before it reports anything as a bug.
  5. Read every reported bug yourself. A wrong property produces confident nonsense.

You do not need Ephyra to use the idea. The authors say their experiments used a classical loop that should be reproducible in any property-based testing library with handwritten generators and shrinkers, so the same prompt shape works with the library your project already has.

Where it falls short

Sources

Changelog