One-off adversarial robustness scripts produce numbers nobody can reproduce, compare across model versions or defend to an auditor. Dioptra is NIST's open-source test platform for running AI model security experiments (evasion, poisoning and privacy attacks, and the defences against them) as tracked, repeatable jobs. This guide explains what Dioptra is, how its services and components fit together, how an experiment is built from plugins and entrypoints, which attack classes teams test with it, how to read the results, and how to deploy it without creating a new weak point in your ML estate. It is written for ML security engineers, AI red teams and model risk teams. Dioptra changes between releases: this page reflects release 1.2.4 and the project documentation as checked in November 2026, so confirm features against the current docs before relying on a detail.
This is an independent guide from NHI Mgmt Group, based on NIST's public Dioptra documentation as of November 2026. It is not sponsored or reviewed by NIST. Product features change, so confirm settings against the current Dioptra documentation.
Key takeaways
- Dioptra is a test harness, not an attack library. It orchestrates experiments, tracks inputs and outputs and snapshots resources; the attack and defence code runs inside worker containers, and the worker image includes the Adversarial Robustness Toolbox (ART).
- Reproducibility is the main reason to adopt it. The project lists reproducible, traceable, extensible, interoperable and modular as key properties, so the same entrypoint can be re-run against a new model version and compared.
- It maps to the three classic attack classes. The documentation frames testing around evasion, poisoning and privacy (oracle) attacks, the categories NIST AI 100-2 E2025 uses for predictive AI.
- Treat the deployment as sensitive infrastructure. It holds models, datasets and credentials, runs user-supplied Python on workers, and the project describes access controls as still arriving; keep it on a restricted network with TLS and owner-only secrets.
- Results only mean something against a stated threat model. Report attack strength, attacker knowledge and clean accuracy alongside robust accuracy, or the numbers will be misread.
What Dioptra is
Dioptra is a software test platform developed by NIST and published on GitHub under usnistgov/dioptra. Its documentation says the National Cybersecurity Center of Excellence (NCCoE) built it as an experimentation test platform, and the README states that it supports the Measure function of the NIST AI Risk Management Framework by providing functionality to assess, analyse and track potential benefits and negative consequences. As of November 2026 the project uses "super intelligence (SI)" terminology in its README and documentation, citing NIST terminology guidance; the platform itself is the same AI and ML model testbed.
The motivation is the combinatorial explosion of testing: many attacks, defences, models and datasets, each with parameters. Dioptra aims to make it easier to explore those combinations with experiments that are reproducible, trackable and reusable. The README lists four use cases:
- Model testing: first party during development, second party during acquisition or in an evaluation lab, third party during auditing or compliance.
- Research: tracking experiments for trustworthy AI research.
- Evaluations and challenges: a common platform for participants.
- Red teaming: exposing models and resources to a red team in a controlled environment.
Software is published as a public service by NIST; to the extent NIST holds copyright, it is made available under the Creative Commons Attribution 4.0 International licence (CC BY 4.0). Check the licences of any third-party attack libraries, models and datasets you add.
| Tool type | What it gives you | When to choose it |
|---|---|---|
| Dioptra (test platform) | Orchestration, job queues, tracking, snapshots, web UI and REST API, multi-user deployment | Repeated, comparable testing across teams, model versions or suppliers |
| Attack library such as ART | Implementations of attacks, defences and metrics in Python | A single engineer exploring one model, or as the engine inside Dioptra workers |
| LLM probing tools such as garak | Prompt-based probes against language models | Generative AI and chatbot testing, which is a different problem from classifier robustness |
For the attack library itself, see the Adversarial Robustness Toolbox Guide; for LLM probing, the garak Guide.
Architecture and components
Dioptra runs as a set of Docker containers handling experiment tracking, task execution and data storage, reached through a REST API that can be driven from the web interface, a Python client or any REST client. The release 1.2.4 install instructions pull images for NGINX, the REST API and MLflow tracking, plus worker images for PyTorch and TensorFlow 2 in CPU and optional GPU variants.
| Service or component | Role | Security note |
|---|---|---|
| NGINX | Front end proxy for the web interface and API | TLS termination point; certificates are generated at setup or supplied |
| REST API | Flask application that manages resources, users and jobs | The control plane: anyone who can call it can submit code to run |
| Queues and workers | Jobs are placed on a queue (Redis with RQ in the project dependencies) and run by a worker connected to that queue; tensorflow-cpu and pytorch-cpu workers are set up by default | Workers execute user-registered Python and need access to data and artifacts |
| MLflow tracking | Records runs, parameters and metrics | Holds experiment history used as evidence |
| Database and object storage | PostgreSQL for platform state; object storage for artifacts (the deployment generates RustFS account credentials) | PostgreSQL TLS is opt-in; credentials live in the deployment's secrets directory |
On top of the services sit the components you work with:
- Plugins: containers that store tasks. You register your Python functions in a plugin.
- Tasks: parameterisable functions stored in plugins, including artifact tasks that save or load objects.
- Task graph: defines how tasks are chained together into steps.
- Entrypoints: reusable, parameterisable execution graphs that chain multiple tasks, with parameters (job inputs), attached plugins and attached queues.
- Experiments and jobs: an experiment is the container in which jobs run; a job is a parameterised execution of an entrypoint within an experiment.
- Artifacts: objects saved to disk by jobs, which later jobs can take as inputs (for example a trained model or a set of adversarial examples).
- Users, groups and plugin parameter types: users and groups govern access to resources, and the type system checks that plugin inputs and outputs fit together.
Setting up experiments
The documented workflow is short: define functions in Python, register them in a plugin, define an entrypoint that uses those tasks, create an experiment and attach the entrypoint, then run a job with parameters, artifact inputs and artifact outputs. Dioptra handles data persistence, queue management, dependencies and type checking. A practical sequence for a security team:
- Write the threat model first. Record the attacker's knowledge (white box with gradients, or black box with query access only), goal (targeted or untargeted misclassification, degraded accuracy, training data leakage) and budget (perturbation size, number of queries, fraction of poisoned data).
- Deploy in a lab. Follow the install guide (Docker images, a deployment created from the cookiecutter template, the initialiser script, then Docker Compose). Mount datasets as data volumes and add GPU workers only if needed.
- Register a baseline entrypoint. Train or load the model and measure clean accuracy as an artifact, so every later attack job has the same reference point.
- Add attack entrypoints. Wrap attacks from ART or your own code as plugin tasks, expose strength parameters (for example perturbation budget) as entrypoint parameters, and save adversarial examples as artifacts.
- Sweep, do not spot check. Run jobs across a range of attack strengths and record the curve, not a single point.
- Add defences as separate tasks. Preprocessing, adversarial training or detection, so defended and undefended runs differ by one component.
- Freeze and re-run. Use the platform's snapshots and job history to re-run the same entrypoint when the model changes, and keep the earlier runs for comparison. If a new defence makes results worse, roll back to the previous entrypoint version and model artifact rather than editing in place.
The project's tutorials (Hello World and Essential Workflows) and the example notebooks in the repository's examples directory are the best starting point; the notebooks use a download script based on TensorFlow Datasets to fetch public datasets into the worker data directory.
Attack classes it supports
Dioptra does not limit you to a fixed attack list: anything you can express as a Python task can run on a worker. The documentation organises testing around the three classes below, and the worker image ships with ART, which implements many attacks in each class.
| Class | What the attacker does | Typical test in Dioptra | MITRE ATLAS |
|---|---|---|---|
| Evasion | Manipulates input data at inference time so the model misbehaves | Generate perturbed inputs at several budgets and measure accuracy drop; physical-style adversarial patches for image models | AML.T0015 Evade AI Model; AML.T0043 Craft Adversarial Data |
| Poisoning | Alters training data to teach the model incorrect associations | Train with a controlled fraction of poisoned samples and measure clean accuracy and trigger success | AML.T0020 Training Data Poisoning |
| Privacy or oracle | Queries the model to learn about its training set or parameters | Membership inference or extraction tests against a query interface | AML.T0024 Exfiltration via AI Inference API |
These match the categories NIST AI 100-2 E2025, Adversarial Machine Learning: A Taxonomy and Terminology of Attacks and Mitigations, uses for predictive AI. For background on each class, see the Adversarial ML Taxonomy Guide, the Adversarial Examples and Evasion Attacks Guide, the AI Data Poisoning and Backdoors Guide and Membership Inference Attacks. Prompt injection and jailbreak testing of LLMs is a different discipline; Dioptra's worker images are oriented to PyTorch and TensorFlow models.
Deployment security
A Dioptra instance concentrates sensitive assets: proprietary models, training and test data, adversarial examples, and service credentials. It also executes Python that users register. Customer-side controls:
- Network: keep the deployment on an isolated lab network or behind an authenticating proxy; do not expose the REST API to the internet. The README notes user authentication is in place with access controls described as coming soon, so network controls carry more weight.
- TLS: the deployment generates certificates automatically; supply your own through
config/ssl.tomlfor the REST API and NGINX, use separate private keys for each, enable PostgreSQL TLS with--enable-postgres-ssl(opt-in) and track certificate expiry. - Secrets: deployment settings sit in
.envand credential files insecrets/. Keep them at owner-only permissions (0600), never print them to logs, keep a protected backup of the matching credential set, and do not rotate by deleting files. - Workers: treat plugin code as untrusted until reviewed; build custom worker images from pinned dependencies and limit worker access to the datasets an experiment needs.
- Identities: the database, object storage and tracking service accounts are non-human identities; inventory them, scope them to the deployment and rotate them on staff changes. See the Secrets Management Guide.
Interpreting results
Robustness numbers are easy to overstate. A credible Dioptra report states the threat model, the attack and its parameters, and the following measures for each model version.
- Clean accuracy: performance on unmodified test data, the baseline every other figure is read against.
- Robust accuracy by budget: accuracy under attack at each perturbation size, shown as a curve.
- Attack success rate: share of inputs where the attack achieved its goal, separated by targeted and untargeted attacks.
- Poisoning impact: clean accuracy and trigger success at each poisoning fraction.
- Privacy leakage: membership inference advantage over random guessing.
- Defence cost: change in clean accuracy and latency when a defence is added.
Read results relative to the threat model. Strong white-box results bound the worst case; black-box results show what an outside attacker with query access might do. A defence that only holds against the attack it was tuned for is not a robustness gain; re-test with a different or adaptive attack before claiming improvement. Feed results into the Measure and Manage activities of the NIST AI RMF Guide, and into acceptance criteria when buying models.
Framework mapping
| Framework | Reference | Relevance |
|---|---|---|
| NIST AI RMF 1.0 | Measure function | Dioptra's stated purpose: assess, analyse and track AI risks |
| NIST AI 100-2 E2025 | Evasion, poisoning, privacy attack classes | Taxonomy for test design and reporting |
| MITRE ATLAS | AML.T0015, AML.T0043, AML.T0020, AML.T0024 | Adversary techniques the experiments emulate |
| NIST SP 800-53 Rev 5 | CA-8, SA-11 | Penetration testing and developer testing and evaluation |
Common failure patterns
- Single-point results: one perturbation budget reported as "the robustness", hiding how quickly accuracy collapses.
- No clean baseline in the same run: robust accuracy compared against a figure from a different dataset split or model build.
- Testing only the attack the defence was built for: gives false confidence; adaptive attacks are needed.
- Exposed lab instance: a REST API reachable from the corporate network or internet lets anyone with an account run code next to proprietary models.
- Credentials handled casually: secrets copied into notebooks or logs, or deleted to "rotate" them, causing lockouts.
- Wrong tool for the model: using classifier robustness tests to sign off an LLM application, where prompt injection and data leakage need different testing.
Practitioner checklist
- Confirm the current Dioptra release and read its install and configuration guides before deploying.
- Write a threat model (knowledge, goal, budget) for each model before building entrypoints.
- Deploy on an isolated network with supplied TLS certificates and PostgreSQL TLS enabled.
- Keep
.envandsecrets/at owner-only permissions with a protected backup. - Review plugin code and pin worker image dependencies.
- Record a clean accuracy baseline artifact for every model version.
- Sweep attack strength and report curves, with evasion, poisoning and privacy tests as relevant.
- Re-test defences with adaptive or alternative attacks before claiming improvement.
- Store job history as evidence and re-run entrypoints on each model release.
Standards and references
- NIST: Dioptra documentation
- NIST: Dioptra source repository (usnistgov/dioptra)
- NIST: Dioptra workflow architecture
- NIST: Dioptra, Configure SSL/TLS Certificates
- NIST: AI 100-2 E2025, Adversarial Machine Learning: A Taxonomy and Terminology of Attacks and Mitigations
- NIST: AI Risk Management Framework
- MITRE: ATLAS
Related NHI Mgmt Group resources: Adversarial Robustness Toolbox Guide, AI Red Teaming Guide, Adversarial ML Taxonomy Guide, AI Red Teaming and Testing Tools Buyer's Guide.