Metadata-Version: 2.4
Name: opake-auditing
Version: 0.16.0
Summary: Opake empirical privacy auditing: one-run estimator, coin-flip, membership inference
Author: Opake Contributors
License: Apache-2.0
Keywords: differential-privacy,privacy-auditing,pytorch
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Security
Requires-Python: <3.14,>=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: NOTICE
Requires-Dist: torch>=2.9.0
Requires-Dist: scipy>=1.11.0
Requires-Dist: opake-engine==0.16.0
Requires-Dist: opake-accounting==0.16.0
Dynamic: license-file

# opake-auditing

Empirical privacy auditing for Opake: one-run estimator
(Steinke et al. 2023), coin-flip canary partitioning, and
loss-based membership-inference attacks.

## Install

Install the root package as described in the [repository installation guide](https://github.com/JetBrains-Research/opake#installation).
Use its `auditing` extra to include this component.

`opake-auditing` depends on `opake-engine` and `scipy`; both install
automatically with the extra.

## Quick start

```python
import opake.auditing as auditing
from opake.random import key

cf = auditing.coin_flip(dataset, num_canaries=1000, key=key(42))
# ... DP-SGD training loop ...
estimate = auditing.one_run(scores, coin_flip=cf)
```

By default, canaries are sampled from the dataset's natural rows. Pass
`candidate_indices=` to restrict selection to a precommitted pool of constructed
or selected records.

## Layout

- `opake.auditing.one_run` — one-run estimator (Steinke et al. 2023)
- `opake.auditing.coin_flip()` — coin-flip canary partitioning
- `opake.auditing.loss_scores()` — loss-based membership inference via `vmap`
