Skip to content
Anthropic Red Teaming·Indexed by this site · Originally published· AI updates →SelectedAttention36

Finding bugs in the Python ecosystem with Claude and property-based testing

Finding bugs across the Python ecosystem with Claude and property-based testing

AI summary

Researchers at Anthropic and other institutions developed an agent in the form of a custom Claude Code command that finds bugs in the Python ecosystem through property-based testing. The agent reads code, documentation and existing tests, infers properties that should hold, then writes tests with Hypothesis and self-reflects to reduce false positives. The researchers ran the agent on more than 100 popular Python packages and found hundreds of potential bugs, involving projects such as NumPy, SciPy and Pandas. After manually sampling 50 of 984 bug reports, 56% were valid bugs and 32% were both valid and worth reporting; after filtering by score, 86% of high-scoring reports were valid and 81% were valid and worth reporting. Some reports have been submitted to maintainers and several patches have been merged; the authors say the work focuses on general bugs rather than only security vulnerabilities, and believe it could be used in the future to proactively find bugs before deployment.

Why it was selected

The article provides the complete workflow of the agent writing property-based tests and the manual review data, which can serve as a reference for evaluating the reliability of AI code auditing.

Read originalanthropic.com