Repository navigation
fix(rewrite): repair confident medium leaks on the stricter risk_tolerance presets - #379
binaryaaron wants to merge 1 commit into
Conversation
[Medium impact] The current threshold changes appear safe to merge. SummaryThis PR lowers leakage thresholds rather than adding the broader
No actionable issues were found in the current changes. Tests were not run during this review. Reviews (3) · Last reviewed commit: "fix(rewrite): repair confident medium le..." · Reviewed by Greptile |
|
I feel like this undermines both our "risk_tolerance" parameter, and the way leakage mass utilizes both sensitivity and confidence. But it does seem wrong that no setting will repair a high confident medium sensitivity entity miss. My preference would be to adjust the thresholds for minimal, low, moderate settings. I just don't think we want a blanket always repair when confidence scores are low. |
|
I am also curious how this interacts with #333, which should enable better sensitivity assignments. I guess it doesn't change a poor rewrite. I agree that the whole point of having minimal, low, moderate, high options for risk tolerance is to somewhat control the privacy utility tradeoff. What would you recommend changing thresholds to @asteier2026? |
|
@lipikaramaswamy @asteier2026 - i'm running a few tests internally and will report back on updated thresholds. sorry, i think this one was premature. |
…rance presets Leakage-based repair needs leakage mass strictly above the preset's repair threshold. A single confident medium-sensitivity leak has mass 0.6 (weight 0.6 x confidence 1.0), which is not above the minimal threshold of 0.6 and is below the low, moderate and high thresholds, so no preset ever repaired it. Lower the repair and review thresholds on the stricter presets (repair_threshold / flag_leakage_above): - minimal: 0.4 / 0.5 (was 0.6 / 1.0) - low: 0.5 / 2.0 (was 1.0 / 2.0) - moderate: 1.0 / 2.5 (was 1.5 / 2.5) - high: 2.0 / 3.0 (unchanged) flag_utility_below, repair_on and flag_on are unchanged. Repair thresholds stay strictly ascending across presets. A confident medium leak now repairs on minimal and low, and is never repaired on moderate or high. If it survives repair it is flagged for human review on minimal only; on low it is still not flagged. A faint low-sensitivity leak (mass 0.015) triggers neither repair nor review on any preset. The issue asked for repair regardless of leakage mass; this change does not do that. Addresses #358 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Aaron Gonzales <aagonzales@nvidia.com>
e547206 to
057eca6
Compare
|
@asteier2026 @lipikaramaswamy: changed this to update the thresholds instead.
One confident medium leak now repairs on I tested these locally on
Questionwdyt about #333. - i can help revalidate the thresholds after we land that? wdyt? |
|
I'd be comfortable with those thresholds. But I also like: |
For the record, the evidence gathered on main's code so far:
On #333's tree, the existing Edited: corrected the lowest first-evaluation mass (1.2 in one run, 0.96 in the other) and the repair count under either proposal (24 or 25 of 25, not every record). The conclusion is unchanged. |
|
Related Issue
Addresses #358. This PR originally addressed the gap with a separate
confirmed_leakfinding; it now changes therisk_tolerancethresholds instead, so sensitivity and confidence keep their role in leakage mass.Scope: the issue asked for repair regardless of leakage mass; this change does not do that. A confident medium-sensitivity leak is now repaired on
minimalandlow, never onmoderateorhigh, and one that survives repair is flagged onminimalonly.Plan Document
No plan required: the change edits four threshold values in one table, plus the tests and docs that quote them.
Summary
Lowers the repair and review thresholds of the
minimal,lowandmoderaterisk_tolerancepresets so that a single confident medium-sensitivity leak is repaired on the stricter presets.Why it matters: leakage-based repair needs a leakage mass strictly above the preset's repair threshold. One medium-sensitivity entity leaked at full confidence has mass 0.6 (weight 0.6 x confidence 1.0). That is not above the old
minimalthreshold of 0.6, and it is below the oldlow,moderateandhighthresholds, so no preset repaired it and none flagged it either (the oldminimalreview threshold was 1.0).New values in
_RISK_TOLERANCE_BUNDLES(src/anonymizer/config/rewrite.py), repair threshold / flag leakage above:minimallowmoderatehighflag_utility_below,repair_onandflag_onare unchanged. Repair thresholds remain strictly ascending (minimal < low < moderate < high), and a test now asserts this. Theminimalrepair value is a one-line edit in the preset table if the pending confirmation below goes another way.Resulting behaviour for one confident medium-sensitivity leak (mass 0.6): repaired on
minimalandlow, not repaired onmoderateorhigh; if it survives repair, flagged for human review onminimalonly. Two such leaks (mass 1.2) also repair onmoderate, but not onhigh. A faint low-sensitivity leak (weight 0.3 x confidence 0.05 = 0.015) triggers neither repair nor review on any preset. The sensitivity x confidence weighting of leakage mass and the meaning ofrisk_toleranceare unchanged; only where each preset draws the line moves.User-visible effect: more repair calls on
minimal, on the defaultlowpreset and onmoderate, and more records withneeds_human_review=Trueonminimal.Pending confirmation
The
minimalrepair threshold is set to 0.4, pending maintainer confirmation. Changing it is a one-value edit in the preset table (_RISK_TOLERANCE_BUNDLES). Alternatives:lowrepair threshold, solowwould also have to be raised to keep the order strict.Type of Change
Default behaviour of
risk_tolerancepresets changes (see User-visible effect above); no public signatures change.Contributor Checklist
fix(rewrite): repair confident medium leaks on the stricter risk_tolerance presetsskills/anonymizer/SKILL.mdneeds no update (its template only passesrisk_tolerance="low"and quotes no threshold values)Validation
Unit and static checks:
ruff format --checkandruff check(tools/codestyle/format.sh --check,ruff_check.sh),tools/codestyle/typecheck.sh(all dependency groups), the fullpytestsuite,mkdocs build --strict(exit code 0).test_wandb_staging_allows_repeated_basename_in_foreign_intermediate_directory, which is unrelated to this change.tests/engine/test_findings.pyuse the realpresent_findings,needs_repair,needs_human_reviewandcompute_leakage_mass: a confident medium leak repairs onminimalandlowonly; two confident medium leaks (mass 1.2) repair onmoderatebut nothigh, and are flagged on neither; a low-sensitivity leak at confidence 0.05 triggers neither repair nor review on any preset; thresholds are strictly ordered. Exact-value assertions intests/config/test_rewrite.pyare updated.Live run (one dataset, one judge model,
minimalpreset only; there is no live run forlow, the default, ormoderate): the publicdocs/data/NVIDIA_synthetic_biographies.csv, 23 of 25 rows processed (2 dropped by a GLiNER span-mismatch check), a local gpt-oss-120b judge, three repair iterations. "Leaking" below means a record whose final leakage mass is above 0.minimalat 0.25 / 0.5 (repair threshold / flag leakage above), not the 0.4 / 0.5 proposed here. Both repaired those records and ended with 0 leaking records; 1 of 23 was flagged for review in each, the same as on main.Run-to-run variation is a few records, and this is a single dataset; the figures show direction, not a measured rate.
Documentation and Artifacts
docs/concepts/rewrite.md(risk-tolerance table, plus one sentence on what a single confident medium-sensitivity leak does under each preset),docs/troubleshooting.md(threshold table), and theRiskTolerancedocstring. The repo keeps no changelog file.mkdocs build --strictrun locally (the equivalent ofmake docs-build, with output written outside the repo); the site built, with only an INFO message about a missing#reference-implementationanchor intuning.mdthat this change does not touch.