Skip to content

MAINT Remove all functionality deprecated for v0.13.0#1618

Merged
romanlutz merged 18 commits intomicrosoft:mainfrom
romanlutz:remove-0.13.0-deprecations
Apr 15, 2026
Merged

MAINT Remove all functionality deprecated for v0.13.0#1618
romanlutz merged 18 commits intomicrosoft:mainfrom
romanlutz:remove-0.13.0-deprecations

Conversation

@romanlutz
Copy link
Copy Markdown
Contributor

Summary

Remove all code that was deprecated with removal scheduled for v0.13.0.

Removed Classes/Modules

  • HumanInTheLoopConverter — replaced by CoPyRIT GUI
  • HumanInTheLoopScorerGradio — replaced by CoPyRIT GUI
  • ChatMessageListDictContent — unused legacy model
  • PsychosocialScenario alias — use \Psychosocial\ directly
  • LeakageScenario alias — use \Leakage\ directly
  • pyrit.ui module (Gradio GUI) — replaced by CoPyRIT React frontend
  • rpc_client.py — internal to deprecated UI infrastructure

Removed Properties/Methods

  • MessagePiece.role and Message.role properties — use .api_role\ (read) or ._role\ (write)
  • AttackExecutor.execute_multi_objective_attack_async — use \�xecute_attack_async\
  • AttackExecutor.execute_single_turn_attacks_async — use \�xecute_attack_async\
  • AttackExecutor.execute_multi_turn_attacks_async — use \�xecute_attack_async\

Removed Parameters

  • is_objective from \SeedDataset, \SeedGroup, \MemoryInterface.get_seeds(), \get_seed_groups()\ — use \seed_type\
  • objectives from \Scam, \Cyber, \Psychosocial, \RedTeamAgent\ — use \dataset_config\ in \initialize_async\
  • objectives_by_harm from \ContentHarms\ — use \dataset_config\ in \initialize_async\
  • seed_prompts from \EncodingScenario\ — use \dataset_config\ in \initialize_async\
  • objective_scorer from \ScenarioResult\ — use \objective_scorer_identifier\

Removed Enum Members

  • PsychosocialStrategy: ImminentCrisis, LicensedTherapist aliases
  • LeakageStrategy: SINGLE_TURN, MULTI_TURN, FirstLetter, Image, RolePlay, Crescendo aliases

Signature Changes

  • ColloquialWordswapConverter: \deterministic\ is now keyword-only

Kept

  • FoundryScenario alias — still used by azure-ai-evaluation partner package
  • is_objective DB column in SeedEntry — kept for backward compatibility with existing databases

Doc Updates

  • Deleted converter/scorer doc files for removed classes
  • Updated myst.yml, batch scorer docs, converter catalog, GUI docs
  • Removed entries from pct_to_ipynb exclusion list

Testing

  • All 6236 unit tests pass (1 pre-existing flaky test in test_airt_initializer)

biefan and others added 9 commits March 16, 2026 21:01
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
SeedDataset overrides the base YamlLoadable.from_yaml_file() with its
own implementation that was missing the empty-YAML guard, causing a
TypeError when yaml.safe_load() returns None.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Remove backward-compatibility parameters that were scheduled for removal:
- encoding.py: Remove seed_prompts parameter
- red_team_agent.py: Remove objectives parameter
- scam.py: Remove objectives parameter
- cyber.py: Remove objectives parameter
- content_harms.py: Remove objectives_by_harm parameter
- scenario_result.py: Remove objective_scorer parameter
- message_piece.py: Update scorer_identifier docstring
- colloquial_wordswap_converter.py: Make deterministic keyword-only
- memory_interface.py: Remove is_objective from get_seeds/get_seed_groups
- seed_dataset.py: Remove is_objective parameter
- seed_group.py: Remove is_objective handling in dict processing

Also clean up unused imports (warnings, print_deprecation_message,
SeedObjective, Scorer) and update tests that referenced removed
deprecated attributes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Update 12 test files to remove deprecated code:

- test_prompt_converter.py: Remove HumanInTheLoopConverter import and parametrize entry
- test_chat_message.py: Remove ChatMessageListDictContent import and deprecation test
- test_attack_executor.py: Remove TestDeprecatedMethods class (3 test methods)
- test_seed.py: Remove is_objective backward compat test
- test_seed_dataset.py: Remove is_objective deprecated test
- test_content_harms.py: Remove test_initialization_with_objectives_by_harm
- test_psychosocial_harms.py: Remove deprecated strategy tests, update to use
  mock_dataset_config/ResolvedSeedData instead of sample_objectives
- test_leakage_scenario.py: Remove deprecated strategy fixtures/tests
  (FirstLetter, Crescendo, Image, RolePlay), update to use mock_memory_seeds
- test_message_piece.py: Replace deprecated piece.role setter with piece._role
- test_targets_and_secrets.py: Replace execute_multi_objective_attack_async
  with execute_attack_async
- test_hitl_gradio.py: Delete entire file (deprecated HITL Gradio scorer)
- test_hitl_gradio_integration.py: Delete entire file

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Remove deprecated classes/modules:
- HumanInTheLoopConverter (and doc files)
- HumanInTheLoopScorerGradio (and doc files)
- ChatMessageListDictContent
- PsychosocialScenario/LeakageScenario aliases
- pyrit.ui module (Gradio GUI, replaced by CoPyRIT)
- rpc_client.py (internal to deprecated UI)

Remove deprecated properties/methods:
- MessagePiece.role and Message.role properties
- AttackExecutor deprecated methods (execute_multi_objective_attack_async, etc.)

Remove deprecated enum members:
- PsychosocialStrategy/LeakageStrategy deprecated aliases

Update internal callers, docs, and tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Remove Human-in-the-Loop converter references from converter overview doc
- Fix LeakageScenario -> Leakage in class docstring and notebook outputs

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@rlundeen2 rlundeen2 requested a review from Copilot April 15, 2026 19:45
Rename 6->5, 7->6, 8->7 to close the numbering gap.
Update all cross-references in myst.yml, 0_scoring.md, and memory docs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@rlundeen2 rlundeen2 self-assigned this Apr 15, 2026
romanlutz and others added 2 commits April 15, 2026 12:47
No code imports gradio, rpyc, or pywebview after removing pyrit.ui module.
Remove the 'gradio' extras group and its entries from the 'all' extras.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Removes 31 transitive packages no longer needed (gradio, rpyc, pywebview and their deps).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@romanlutz romanlutz changed the title Remove all functionality deprecated for v0.13.0 MAINT Remove all functionality deprecated for v0.13.0 Apr 15, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Removes all functionality previously deprecated with removal planned for v0.13.0, including Gradio-based human-in-the-loop UI infrastructure, deprecated scenario parameters/aliases, and legacy model properties.

Changes:

  • Removed deprecated Gradio UI modules, RPC client/server plumbing, and associated human-in-the-loop scorer/converter APIs.
  • Removed deprecated scenario parameters/aliases (objectives, objectives_by_harm, seed_prompts, scenario alias classes) and deprecated AttackExecutor helper methods, updating tests accordingly.
  • Tightened YAML loading behavior (explicit error on empty YAML) and updated docs/notebooks to reflect the removals and new APIs.

Reviewed changes

Copilot reviewed 71 out of 76 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/unit/setup/test_configuration_loader.py Adds coverage for empty YAML config error behavior.
tests/unit/score/test_hitl_gradio.py Removes unit tests for deleted Gradio HiTL scorer.
tests/unit/scenario/test_scam.py Removes tests tied to deprecated objectives parameter.
tests/unit/scenario/test_psychosocial_harms.py Updates tests away from deprecated APIs; patches dataset/seed resolution.
tests/unit/scenario/test_leakage_scenario.py Updates tests away from deprecated objectives/strategy aliases and default objective sourcing.
tests/unit/scenario/test_foundry.py Removes tests for deprecated objectives; adjusts initialization assertions.
tests/unit/scenario/test_encoding.py Removes tests for deprecated seed_prompts; adjusts initialization assertions.
tests/unit/scenario/test_cyber.py Removes tests tied to deprecated objectives parameter.
tests/unit/scenario/test_content_harms.py Removes tests tied to deprecated objectives_by_harm parameter.
tests/unit/prompt_converter/test_prompt_converter.py Removes HumanInTheLoopConverter from converter test matrix.
tests/unit/prompt_converter/test_colloquial_wordswap_converter.py Removes tests for positional deprecation warning (now keyword-only).
tests/unit/models/test_seed_dataset.py Removes test coverage for deprecated is_objective parameter.
tests/unit/models/test_seed.py Adds empty YAML error test; removes deprecated is_objective dict backward-compat test.
tests/unit/models/test_message_piece.py Updates tests to use _role since role property removed.
tests/unit/models/test_chat_message.py Removes tests for deleted legacy ChatMessageListDictContent.
tests/unit/executor/attack/core/test_attack_executor.py Removes tests for deleted deprecated AttackExecutor methods.
tests/integration/targets/test_targets_and_secrets.py Migrates integration tests to execute_attack_async.
tests/integration/score/test_hitl_gradio_integration.py Removes integration tests for deleted Gradio HiTL scorer/RPC infra.
pyrit/ui/scorer.py Removes deprecated Gradio UI app implementation.
pyrit/ui/rpc_client.py Removes deprecated UI RPC client implementation.
pyrit/ui/rpc.py Removes deprecated UI RPC server/service implementation.
pyrit/ui/connection_status.py Removes deprecated Gradio connection-status helper.
pyrit/ui/app.py Removes deprecated Gradio launcher and Windows mutex helper.
pyrit/ui/init.py Removes deprecated pyrit.ui module entrypoint.
pyrit/score/human/human_in_the_loop_gradio.py Removes deprecated Gradio-based human-in-the-loop scorer.
pyrit/score/init.py Removes export of deleted HumanInTheLoopScorerGradio.
pyrit/scenario/scenarios/garak/encoding.py Removes deprecated seed_prompts plumbing and conflict logic.
pyrit/scenario/scenarios/foundry/red_team_agent.py Removes deprecated objectives parameter and resolution path.
pyrit/scenario/scenarios/airt/scam.py Removes deprecated objectives parameter and legacy resolution path.
pyrit/scenario/scenarios/airt/psychosocial.py Removes deprecated enum alias mapping and deprecated scenario alias class.
pyrit/scenario/scenarios/airt/leakage.py Removes deprecated enum alias mapping and deprecated scenario alias class; updates docs text.
pyrit/scenario/scenarios/airt/cyber.py Removes deprecated objectives parameter and legacy resolution path.
pyrit/scenario/scenarios/airt/content_harms.py Removes deprecated objectives_by_harm parameter and legacy resolution path.
pyrit/scenario/scenarios/airt/init.py Stops exporting removed deprecated scenario alias classes.
pyrit/scenario/core/scenario_strategy.py Updates doc example for deprecated enum mapping version string.
pyrit/prompt_target/rpc_client.py Removes deprecated RPC client (tied to removed UI infrastructure).
pyrit/prompt_target/openai/openai_chat_target.py Updates comment reference after removing legacy ChatMessageListDictContent.
pyrit/prompt_converter/human_in_the_loop_converter.py Removes deprecated interactive converter implementation.
pyrit/prompt_converter/colloquial_wordswap_converter.py Makes deterministic keyword-only; removes positional deprecation warning path.
pyrit/prompt_converter/init.py Removes export of deleted HumanInTheLoopConverter.
pyrit/models/seeds/seed_group.py Removes deprecated is_objective dict backward-compat parsing.
pyrit/models/seeds/seed_dataset.py Removes deprecated is_objective parameter/path; errors on empty YAML.
pyrit/models/scenario_result.py Removes deprecated objective_scorer parameter path.
pyrit/models/message_piece.py Removes deprecated role property; tightens scorer_identifier docs.
pyrit/models/message.py Removes deprecated role property.
pyrit/models/chat_message.py Removes deprecated ChatMessageListDictContent wrapper.
pyrit/models/init.py Removes export of deleted ChatMessageListDictContent.
pyrit/message_normalizer/message_normalizer.py Switches system-message filtering to api_role (since role removed).
pyrit/memory/memory_models.py Clarifies legacy is_objective DB column comment.
pyrit/memory/memory_interface.py Removes deprecated is_objective API surface while preserving legacy DB filtering behavior.
pyrit/executor/attack/multi_turn/simulated_conversation.py Updates role mutation to use _role since role setter removed.
pyrit/executor/attack/core/attack_executor.py Removes deprecated execute_* helper methods and related imports.
pyrit/common/yaml_loadable.py Errors explicitly on empty YAML (yaml_data is None).
pyrit/backend/services/converter_service.py Removes HumanInTheLoopConverter from catalog filtering list.
pyrit/backend/services/attack_service.py Updates role remapping logic to use api_role and _role.
pyproject.toml Removes Gradio/RPyC/PyWebview extras and from all extra.
doc/scanner/airt.ipynb Updates displayed class name text from LeakageScenario -> Leakage.
doc/scanner/1_pyrit_scan.ipynb Updates displayed class name text from LeakageScenario -> Leakage.
doc/myst.yml Removes/de-renumbers docs entries for deleted HiTL converter/scheduler notebooks.
doc/gui/0_gui.md Removes note referencing soon-to-be-removed Gradio components (now removed).
doc/generate_docs/pct_to_ipynb.py Removes exclusion entry for deleted HiTL scorer notebook.
doc/code/scoring/7_batch_scorer.py Removes references to deleted HumanInTheLoopScorerGradio.
doc/code/scoring/7_batch_scorer.ipynb Removes references to deleted HumanInTheLoopScorerGradio.
doc/code/scoring/5_human_in_the_loop_scorer.py Deletes deprecated HiTL scorer notebook source.
doc/code/scoring/5_human_in_the_loop_scorer.ipynb Deletes deprecated HiTL scorer notebook.
doc/code/scoring/0_scoring.md Updates link target for batch scorer notebook numbering.
doc/code/scenarios/0_scenarios.ipynb Updates displayed class name text from LeakageScenario -> Leakage.
doc/code/memory/5_advanced_memory.py Updates link target for batch scorer numbering.
doc/code/memory/5_advanced_memory.ipynb Updates link target for batch scorer numbering.
doc/code/converters/7_human_converter.py Deletes deprecated HiTL converter notebook source.
doc/code/converters/7_human_converter.ipynb Deletes deprecated HiTL converter notebook.
doc/code/converters/0_converters.py Removes mention of deleted HiTL converter notebook from index.
doc/code/converters/0_converters.ipynb Removes mention/table entry for deleted HiTL converter notebook.
Comments suppressed due to low confidence (5)

tests/unit/scenario/test_foundry.py:1

  • Line 244 duplicates the assertion from line 241, so the test no longer checks the intended post-condition around lazy seed/objective resolution. Remove the duplicate assertion and restore an assertion that validates lazy resolution state (e.g., whichever internal field indicates seed groups/objectives have not been resolved yet) to keep this test meaningful.
    pyrit/prompt_target/openai/openai_chat_target.py:1
  • The parenthetical is currently ambiguous: it reads as though “multi-part content format” is the universally accepted format. Consider rewording to make it clear that the single text content format is the more widely supported one (e.g., '...don't support multi-part content; plain string content is more universally accepted').
    pyrit/scenario/scenarios/airt/content_harms.py:1
  • The __init__ docstring shows remnants of parameter documentation that no longer matches the signature (e.g., the removed objectives_by_harm parameter and stray lines about other parameters). Please update the docstring so it only documents current parameters and behavior.
    pyrit/prompt_converter/colloquial_wordswap_converter.py:1
  • The public API change making deterministic keyword-only is a meaningful behavioral change. Consider adding/adjusting a unit test to assert that positional usage now raises TypeError (and that keyword usage still works), since the prior warning-based tests were removed.
    pyrit/scenario/core/scenario_strategy.py:1
  • This is an example in the docstring, but using a specific version like 0.15.0 can become misleading (especially in a PR focused on 0.13.0 removals). Consider making this a clearly placeholder version string (e.g., X.Y.Z) or matching the project’s current deprecation/removal conventions.

Comment thread doc/myst.yml
Comment thread doc/code/scoring/0_scoring.md
Comment thread pyrit/backend/services/attack_service.py
Comment thread pyproject.toml
…ests

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Comment thread pyrit/memory/memory_models.py Outdated
romanlutz and others added 4 commits April 15, 2026 15:00
…filtering

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The is_objective field was redundant with seed_type and all API
parameters were already removed. Remove the DB column mapping,
backward-compat logic in get_seed(), the OR fallback in queries,
and update doc/test references.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@romanlutz romanlutz merged commit b9bb870 into microsoft:main Apr 15, 2026
39 checks passed
@romanlutz romanlutz deleted the remove-0.13.0-deprecations branch April 15, 2026 22:57
romanlutz added a commit to romanlutz/PyRIT that referenced this pull request Apr 15, 2026
The .role property was removed from MessagePiece in microsoft#1618.
Update 5_advanced_memory and 11_message_normalizer docs to use
.api_role instead, and remove stale deprecation warning outputs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants