About Foolbox
Foolbox is a Python library for running adversarial attacks against machine learning models. It takes a trained model, wraps it in a framework specific adapter, and applies an attack to a batch of inputs across a range of perturbation budgets, returning the adversarial examples and a success flag for each one. The purpose is benchmarking: measuring how far a model's predictions can be pushed by small, deliberate changes to its inputs.
It is written for researchers and engineers evaluating model robustness in PyTorch, TensorFlow and JAX. Version 3 is built on EagerPy and runs natively in each of those frameworks from one shared codebase, with real batch support rather than looping over single samples. The library ships a large collection of gradient based and decision based attacks, and carries extensive type annotations so mistakes surface before a run starts. The documentation covers getting started, worked examples and a guide to contributing new attacks. The project is tested on Python 3.8 and newer.
Foolbox is free and open source under the MIT license, so there is no pricing to publish. It is installed from the Python package index, and the source and issue tracker are on GitHub.
Worth knowing before adopting it: the documentation site carries a 2022 copyright and names tested framework versions from that period, so pairing the library with current releases of PyTorch, TensorFlow or JAX may take some care.