On November 24, Datadog open-sourced Ephyra, a testing library built for coding agents, and published a result that's hard to ignore: agents using it found 535 previously unknown bugs across 26 well-tested open source systems, including a memory-safety flaw that had been sitting in OCaml for 24 years. Maintainers have already fixed 313 of them.
The method underneath isn't new. It's property based testing, a technique that has existed for years but rarely leaves specialist teams, because writing good input generators is slow, expert work. Ephyra hands that part to an agent. If your team now ships AI-written code faster than anyone can properly review it, this is the part worth your attention.
TL;DR#
- Datadog's Ephyra lets coding agents write and refine test input generators, while engineers keep control of the rules the code must obey.
- Across 26 mature systems, including SQLite, PostgreSQL and OCaml, it surfaced 535 new bugs; 373 are confirmed and 313 fixed so far.
- For business software the useful move is simple: write down your invariants (totals, refunds, sync rules) and let a machine hunt for inputs that break them.
What Datadog found with Ephyra#
The targets were databases, language implementations, developer tools and formally verified systems. A few finds show the range:
- A 670-byte PostgreSQL query needed close to 100 GB of memory to parse, because nested
BETWEENclauses double the work at each level. The flaw was at least 21 years old. - Three
DELETEstatements made SQLite report its own database as malformed, a bug nearly 13 years old. - In DuckDB, a query with
LIMIT 1returned three rows. - In LiteLLM, turning on streaming made an agent skip a tool call and return no answer at all.
That last one should make anyone building AI features sit up. It's exactly the kind of quiet failure that looks fine in a demo.
The SQLite run shows how the loop works in practice. Over 37 rounds, the agent grew its generator from 79 to 261 SQL features, pushed coverage of SQLite's instrumented code from 35.9% to 74.1%, and found 26 bugs along the way. Each new feature it could generate exposed bugs in that feature and in how it interacts with everything already covered.
How property based testing works#
A normal unit test checks one example: given this input, expect that output. A property is a general rule that must hold for every valid input. Datadog's own example is sorting: the output should be in order and should keep every element, duplicates included.
Three parts do the work. A generator produces random inputs. The framework checks the property against each one. When something fails, a shrinker cuts the failing input down to the smallest case that still breaks the rule, so you get [7, 7] instead of a 400-item list.
Ephyra keeps the property with the engineer and gives the generator to the agent:
engineer writes property --> agent writes generator --> run tests
^ ^ |
| +-- coverage, failures -+
+---- human reviews the shrunk counterexample <-----+
Here's how it compares with the testing most teams already do:
| Example-based unit tests | Property based testing | Fuzzing | |
|---|---|---|---|
| What you write | Specific inputs and expected outputs | General rules plus input generators | A harness that feeds mutated inputs |
| What it catches | Cases someone thought of | Edge cases nobody thought of, against rules you care about | Mostly crashes and hangs |
| What a failure looks like | The case you wrote | A minimal counterexample | A crashing input, often large |
| Main cost | Writing lots of cases | Designing good generators | Compute time and triage |
Why coding agents change the economics#
Datadog says it plainly: agents are getting better at writing software, but code review misses subtle interactions and traditional testing is overwhelmed by the volume of AI-written code. Generators were always the expensive part of property based testing. An agent can write one, run it, read the coverage report and rewrite it, over and over, without getting bored.
The division of labour is the real idea here. VibeLeaderboard's analysis makes the same point: people decide what the system must guarantee, and the agent does the tedious hunting for inputs that disprove it. That's a sane way to use agents on verification.
The trade-offs Datadog is upfront about#
- Unmeasured basics. Reliability, cost and generality haven't been measured yet. Finding new bugs in famous projects is a traditional benchmark, but it doesn't tell you how often a given bug gets found or what it costs in tokens.
- Human triage. Researchers validated every one of the 535 bugs with a minimal reproducer and filed each report themselves. An agent that dumps hundreds of unvetted tickets on a team is a burden.
- Not a product. Ephyra is experimental and not a supported Datadog offering. It's written in Rust but can test code in other languages, including C++ and Python.
- The technique travels. Datadog notes the experiments used a classical loop, so the results should reproduce in any property-based testing library with handwritten generators. You don't need Ephyra specifically.
What it means for business software#
Most business systems won't hit a 24-year-old memory bug. Their bugs are broken business rules: an invoice total that drifts by a cent after a discount, a refund larger than the original charge, an order lost somewhere between Shopify and the ERP, a webhook processed twice. Every one of those is a property you can write down.
Here's what that looks like with Hypothesis, a widely used Python library for this style of testing:
from hypothesis import given, strategies as st
from billing import build_invoice # your code
line = st.tuples(st.integers(1, 50), st.integers(0, 100_000)) # qty, unit price in cents
@given(st.lists(line, min_size=1), st.integers(0, 100))
def test_invoice_total_is_consistent(lines, discount_pct):
inv = build_invoice(lines, discount_pct)
subtotal = sum(q * p for q, p in lines)
assert 0 <= inv.total <= subtotal
assert inv.total == subtotal - inv.discount
Four lines of rules, and the framework tries thousands of invoices you'd never type by hand. This matters more now because AI-generated integration code tends to look tidy and pass the happy path. The happy path was never where your money leaked.
How to start: a practical checklist#
- Sit down with ops and finance for an hour. List 5 to 10 rules that must always hold: totals reconcile, stock never goes negative, every paid order ships exactly once.
- Pick the code where a wrong answer costs money. Billing, payouts, inventory and system-to-system sync come first.
- Write the properties yourself. This is the judgement call. Don't delegate it to an agent.
- Let an agent write and grow the generators. Ask it to report coverage after each round so you can see whether it's reaching new code.
- Run it on a budget. A time-boxed nightly job in CI is plenty to start.
- Triage every failure before it becomes a ticket. A person confirms it's real and worth fixing.
- Keep the shrunk counterexamples. Each one becomes a permanent regression test.
How MagicMakers Lab approaches this#
Most of what we build through Custom Software Development and Agentic Development moves money or orders between systems, so we write the business rules down before an agent writes much code. A pipeline like Framico, which ships 200+ orders a day with zero manual steps, is the kind of system where "every paid order reaches fulfilment exactly once" matters more than any single test case. The same goes for automated artist payouts on Poster & Art. Agents can grind through inputs; deciding what correct means stays with people who know the business.
Key takeaways#
- Datadog's Ephyra found 535 previously unknown bugs in 26 mature systems by letting agents improve test generators.
- Property based testing checks rules across thousands of generated inputs, then shrinks failures to a minimal example.
- Agents make generators cheap, which was the main barrier to using the technique.
- Humans still define the properties and validate every bug before it's filed.
- For business software, start with money rules: totals, refunds, payouts, inventory and sync.
FAQ#
What is property based testing?#
Property based testing checks that a general rule holds for many automatically generated inputs, instead of a few hand-picked examples. You define the rule, such as "an invoice total never exceeds its subtotal", and the framework generates inputs trying to break it. When one does, it shrinks the input to the smallest failing case, which makes the bug much easier to understand and fix.
Is property based testing the same as fuzzing?#
They're related but not the same. Fuzzing usually throws mutated inputs at a program looking for crashes or hangs. Property based testing checks specific rules about correct behaviour, so it can catch wrong answers that never crash, like a query returning three rows under LIMIT 1. Many teams use both, and Datadog's approach borrows the coverage feedback idea from fuzzing.
Can AI write property-based tests for me?#
AI is good at the part that used to be hardest: writing and refining input generators based on coverage feedback, which is what Datadog's experiment showed. It's weaker at deciding what your system should guarantee. Write the properties yourself, or at least review them closely, and have a person confirm every failure before it turns into a ticket for your developers.
Is property based testing worth it for a small team?#
Yes, if you aim it carefully. You don't need it everywhere. Start with the few places where a wrong answer costs real money or trust, such as billing, payouts, inventory or data sync between systems. A handful of well-chosen properties running nightly can catch edge cases that hundreds of example tests miss, and agents now handle much of the setup work.
If your team is shipping more AI-written code than it can confidently check, start with the rules that cost you money when they break. We're happy to look at your stack with you and help pick the first five. Book a free audit.