v0.1.0 - first release
First release of `fairlearn-fhe` — drop-in encrypted Fairlearn metrics
over CKKS via TenSEAL (default) or OpenFHE (opt-in).
Highlights
- 12 canonical Fairlearn metrics ported to CKKS:
`selection_rate`, `true_positive_rate`, `true_negative_rate`,
`false_positive_rate`, `false_negative_rate`, `mean_prediction`,
`demographic_parity_difference`, `demographic_parity_ratio`,
`equalized_odds_difference`, `equalized_odds_ratio`,
`equal_opportunity_difference`, `equal_opportunity_ratio`. - `MetricFrame`, `EncryptedMetricFrame`, and
`make_derived_metric` mirroring the Fairlearn API surface. - TenSEAL and OpenFHE backends behind a single `build_context`
dispatch. - Two trust models: encrypted `y_pred` with plaintext sensitive
features (Mode A, depth 1), or fully-encrypted `y_pred` and
sensitive features (Mode B, depth 2). - `MetricEnvelope` captures parameter-set hash, observed depth,
and op counts. `validate_envelope()` provides dependency-light
audit-envelope verification. - `fairlearn-fhe-verify` CLI for regulator-side envelope checks
without importing an FHE backend. - Optional Ed25519 envelope signing (`pip install
'fairlearn-fhe[signing]'`) plus signature verification. - Replay metadata records metric kwargs, trust model, and input
hashes so audits are reproducible. - `audit_metric()` one-call wrapper produces an audit envelope.
Numerical fidelity
Default settings yield `< 1e-4` absolute error vs the plaintext
Fairlearn baseline. The included benchmark
(`benchmarks/bench_metrics.py`, n=1024, 3 sensitive groups, depth-6
circuit) gives:
| backend | dp_diff | dp abs err | eo_diff | eo abs err |
|---|---|---|---|---|
| tenseal | 284 ms | 1e-7 | 562 ms | 2e-7 |
| openfhe | 505 ms | 2e-10 | 1015 ms | 4e-11 |
OpenFHE wins on numeric error; TenSEAL wins on speed and ships via
`pip` on every supported platform.
Install
```bash
pip install fairlearn-fhe # tenseal backend (default)
pip install 'fairlearn-fhe[openfhe]' # add openfhe backend (requires C++ build)
pip install 'fairlearn-fhe[signing]' # add Ed25519 envelope signing helpers
```
Quality
- 102 tests, 87% line coverage, ruff clean.
- Tests cover edge cases, envelope validation, backend dispatch,
encrypted arithmetic, CLI verification, and optional signature
verification.
Full changelog: see docs/changelog.md.