Repository navigation
FEAT: Add DeletionResidue scenario for records still revealed after deletion - #4816
Umesh Chounde (umeshchounde) wants to merge 8 commits into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The global cap can silently omit targets or a control dataset before coverage-aware sampling runs, and the small-cap test mocks away the resolver behavior that causes this.
1 open issue
What changed in this PR
Adds airt.DeletionResidue to PyRIT’s scenario framework to check whether RAG applications still reveal externally deleted records, alongside sensitivity and false-positive controls.
Changes:
- Adds the scenario, deletion confirmation flag, and per-dataset scoring.
- Bundles three synthetic datasets with 16 groups each.
- Adds tests and documentation with an example of inconclusive results.
| File | Description |
|---|---|
| tests/unit/scenario/test_scenario_e2e_contract.py | Checks the three-group end-to-end cap. |
| tests/unit/scenario/airt/test_deletion_residue.py | Tests datasets, validation, scoring, and sampling. |
| tests/end_to_end/test_scenarios.py | Configures confirmation and dataset limits. |
| pyrit/scenario/scenarios/airt/deletion_residue.py | Implements the scenario. |
| pyrit/scenario/scenarios/airt/__init__.py | Exports the scenario and techniques. |
| pyrit/datasets/seed_datasets/local/airt/deletion_residue_targets.prompt | Adds deleted-record probes. |
| pyrit/datasets/seed_datasets/local/airt/deletion_residue_keeps.prompt | Adds sensitivity controls. |
| pyrit/datasets/seed_datasets/local/airt/deletion_residue_absents.prompt | Adds false-positive controls. |
| doc/scanner/airt.py | Documents preparation and usage. |
| doc/scanner/airt.ipynb | Adds the paired example and saved output. |
| doc/scanner/0_scanner.md | Lists the new AIRT scenario. |
Review effort: Balanced
The default resolver applied max_total to the union of datasets before the coverage step, so a small cap could drop the targets or a control. Apply source limits first, then sample the total with one group per dataset. The small-cap test now resolves from memory instead of mocking the resolver.
…to feat/deletion-residue-scenario
…to feat/deletion-residue-scenario
|
The one failing check (macos-latest, 3.11, dev_all) is |

Description
Closes #4815. This adds
airt.DeletionResidue, which checks whether a RAG application still reveals records after they were deleted at the source. It reports a match rate per dataset, so the deleted records are shown next to a sensitivity control and a false-positive control.pyrit/scenario/scenarios/airt/deletion_residue.pyfollows the structure ofAggregationLeakage. It has onePromptSendingatomic attack per dataset and usesBaselineAttackPolicy.Forbidden, since prompt sending already sends each question unchanged. The default scorer isOutputMatchesScorer, and a custom scorer must supportOutputMatches.targets_deleted_externally=True, because PyRIT doesn't ingest or delete anything itself.max_totalis applied after per-source limits, with one group reserved for each selected dataset, so a small cap can't drop the targets or a control.max_totalmust be at least the number of selected datasets. The coverage step inScenario.initialize_asyncdoesn't fire with the default resolver, because the resolver has already applied the cap, so I override_resolve_seed_groups_by_dataset_asynchere. I can move this intoScenarioinstead if you'd prefer.pyrit/datasets/seed_datasets/local/airt/. Each objective has anoutput_matchescondition on the ticket's code. Target and keep tickets also carry the ticket text inrecord_textmetadata, which is what the user ingests. No other local dataset setsconditionsin YAML yet.tests/end_to_end/test_scenarios.pypasses the confirmation flag and expects one objective per dataset.doc/scanner/airt.py. The example runs one question per dataset against a plain chat model with nothing ingested, so all three rates are 0, and the section explains why that run is inconclusive. I don't have the documented endpoints, so I generated the saved notebook output against a local OpenAI-compatible server running Qwen2.5-1.5B, and the output shows that endpoint. Please regenerate it with your setup.The numbers in the issue come from a separate probe script in my harness (https://github.com/umeshchounde/rag-deletion-residue), not from this scenario. If you'd prefer one of the smaller shapes from the issue, I'll rework this.
AI disclosure: I used an AI assistant to write most of the code, tests and this description. I've reviewed every line and can maintain it.