Skip to content

Remove all pre-1.0.0 PyRIT-internal deprecations (0.16.0/0.17.0)#2111

Open
romanlutz wants to merge 18 commits into
microsoft:mainfrom
romanlutz:romanlutz-remove-0x-deprecations
Open

Remove all pre-1.0.0 PyRIT-internal deprecations (0.16.0/0.17.0)#2111
romanlutz wants to merge 18 commits into
microsoft:mainfrom
romanlutz:romanlutz-remove-0x-deprecations

Conversation

@romanlutz

Copy link
Copy Markdown
Contributor

Remove all pre-1.0.0 PyRIT-internal deprecations (0.16.0 / 0.17.0 / stale 0.18.0)

PyRIT's last release was 0.14.0; the next is 1.0.0. Every PyRIT-owned API that emitted a
DeprecationWarning slated for removal in 0.16.0 or 0.17.0 is now fully removed — both the
deprecated code paths/shims and every internal caller (pyrit/, tests/, doc/) migrated to
the replacement API. The single 0.18.0 deprecation (ScenarioCompositeStrategy) is also removed:
with versioning jumping 0.14 -> 1.0.0 there is no 0.18.0 release, so its target is stale.

What changed (by subsystem)

  • models — dropped to_dict/from_dict/validate/get_all_values/flatten_to_message_pieces/
    duplicate_message/set_*_not_in_database, positional Message(...) / skip_validation, the
    MessagePiece(labels=...) constructor warning, and set_sha256_* helpers → model_dump/
    model_validate / module functions / pyrit.memory.storage.serializers.
  • memory — removed StorageIO/DataTypeSerializer/data-url sync aliases, get_conversation, and
    attack_id= params → get_conversation_messages / conversation_id= via get_attack_results.
  • labels / attack_identifier — removed the deprecated labels= and attack_identifier= plumbing
    across normalizer, targets, mappers, attack service, and multi-turn/promptgen executors (the
    MessagePiece.labels field stays; only the deprecated kwargs are gone).
  • common / identifiers / setup — deleted the pyrit.identifiers shim package and the
    pyrit.common.{parameter,data_url_converter,question_answer_helpers} module shims.
  • datasets — removed fetch_dataset sync + legacy-subclass path and the remote-dataset split=
    kwargs.
  • auth / message-normalizer — dropped the sync aliases (get_claims, get_sas_token,
    apply_system_message_behavior, ...).
  • converters / targets — grandfathered __init__s are now keyword-only; removed
    send_persuasion_prompt_async/send_variation_prompt_async, PromptChatTarget,
    TextTarget.import_scores_from_csv, gandalf check_password, and the realtime deprecations.
  • output printers — removed deprecated print_*/output_conversation_async methods and the
    score/executor.attack/scenario printer module shims.
  • executors / scenarios — removed system_prompt_path, PrependedConversationConfig
    non-chat deprecations, AtomicAttack(attack=...), Scenario(include_default_baseline=...),
    factory adversarial_config, scenario include_baseline ctor kwargs, and
    ScenarioCompositeStrategy (→ FoundryComposite).
  • DatasetConfiguration (post-inventory)main recently added six DatasetConfiguration
    legacy getters (get_seed_groups, get_all_seed_groups, get_seed_attack_groups,
    get_all_seed_attack_groups, get_default_dataset_names, get_all_seeds) marked for 0.17.0.
    Since 0.17.0 will never ship, these are removed too and all callers migrated to the async
    DatasetAttackConfiguration API (get_attack_groups_by_dataset_async / dataset_names).

Verification

  • uv run -m pytest -n 4 --dist=loadfile tests/unit9873 passed, 120 skipped, 0 failures.
  • 0 PyRIT-owned DeprecationWarnings remain. The only warnings left are third-party
    (StarletteDeprecationWarning: HTTP_422) and a test-only asyncio.iscoroutinefunction note,
    both out of scope for this PR.
  • Repo-wide grep confirms no removed_in="0.16.0"/"0.17.0"/"0.18.0" markers remain in pyrit/.
  • ruff format, ruff check, and ty all pass (enforced via pre-commit).

Copilot AI added 18 commits June 30, 2026 16:28
Remove deprecated to_dict/from_dict/validate/get_all_values/flatten/duplicate_message/set_*_not_in_database shims, positional Message construction, MessagePiece labels-constructor warning, and set_sha256_* methods. Delete storage_io.py and data_type_serializer.py shim modules. Migrate all pyrit/tests/doc call sites to model_dump/model_validate and module-level helpers. Decouple message_normalizer from removed Message.to_dict(). Add ruff runtime-evaluated-base-classes for StrategyResult so pydantic field imports stay at module level.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ase 3)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…e 4)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
….16.0 deprecations (phase 7)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Delete PromptChatTarget class, export, and its dedicated test
- Convert HTTPTarget/PromptShieldTarget/OpenAICompletion/OpenAIImage
  __init__ to keyword-only; drop dead *args on OpenAI subclasses
- Remove text_target import_scores_from_csv and cleanup_target
- Remove gandalf check_password and hugging_face load_model_and_tokenizer
  deprecated aliases; remove 6 realtime sync aliases
- Remove _brick_legacy_init opt-out path from brick_contract; migrate
  PlagiarismScorer to keyword-only (last grandfathered class)
- Update instruction docs to drop the removed opt-out mechanism

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Delete pyrit.executor.attack.printer, pyrit.score.printer, and
  pyrit.scenario.printer shim packages (moved to pyrit.output)
- Remove deprecated print_*/output_conversation_async methods from
  attack_result, scenario_result, and scorer printer classes
- Migrate internal/doc/test callers to write_async
- Delete test_deprecated_printer_paths.py and per-method deprecation tests

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… (Phase 10a/10d)

Removes AttackAdversarialConfig.system_prompt_path (0.17.0) in favor of system_prompt, and the deprecated AttackTechniqueFactory adversarial_config / attack_adversarial_config_override params (0.16.0). Migrates all pyrit, tests, and doc call sites to the replacement APIs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Removes non_chat_target_behavior field, default(), and for_non_chat_target() (0.16.0). Non-chat targets now always normalize the prepended conversation into the first turn; the conversation_manager 'raise' branch and related tests are removed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ync max_concurrency (Phase 10c)

Removes the deprecated AtomicAttack(attack=...) param (use attack_technique), the filter_seed_groups_by_objectives shim (use keep_seed_groups_with_hashes), and run_async(max_concurrency=...) (pass executor=AttackExecutor(max_concurrency=...)). Updates scenarios.instructions.md example and tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ase 10e/10f)

Removes the deprecated Scenario(include_default_baseline=...) constructor kwarg, the _legacy_include_baseline fallback and implicit-baseline rescue branch in initialize_async, and the include_baseline constructor shims on the airt/garak/foundry scenario subclasses. Callers use initialize_async(include_baseline=...).

Also removes ScenarioCompositeStrategy (stale 0.18.0 target) from scenario_strategy.py and the scenario package exports, and drops the legacy isinstance conversion branch in red_team_agent.py in favor of FoundryComposite. Deletes the dedicated baseline/composite deprecation tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…get positional init, backend wire aliases)

Removes the last grep-found, version-tagged 0.16.0/0.17.0 deprecations that did not emit runtime warnings:

- executor/attack backward-compat printer import aliases (AttackResultPrinter/MarkdownAttackResultPrinter/ConsoleAttackResultPrinter); callers migrated to the canonical PrettyAttackResultMemoryPrinter path
- base PromptTarget.__init__ is now keyword-only (* after self), matching the contract already enforced on subclasses
- backend ScoreView.score_id/scored_at and MessagePieceView.piece_id deprecated wire aliases; contract test now asserts they are absent

Also fixes a TAP integration-test straggler that still used the removed AttackAdversarialConfig(system_prompt_path=...) parameter.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…on mentions

Prior deprecation-removal phases edited the paired .py doc sources but not the .ipynb, leaving them out of sync. Brings the notebooks back in line:

- Message([...]) positional -> Message(message_pieces=[...]) in the memory and target notebooks
- removes two stale 'will be removed in 0.16.0' DeprecationWarning stderr outputs baked into the video-target notebook
- migrates doc/index.md to the canonical PrettyAttackResultMemoryPrinter import
- rewords the now-removed PromptChatTarget references (0_prompt_targets.md, 6_1_target_capabilities) from 'deprecated' to 'removed/former'

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Reconcile the pre-1.0.0 deprecation removals with main's parallel refactors. Resolved conflicts in scenario core/airt/foundry, adaptive-scenarios docs, and scenario tests; unwound main's re-introduced ScenarioCompositeStrategy usages (removal confirmed by user) and adopted main's current registry (.instances.get) + PrettyScenarioResultMemoryPrinter APIs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
main introduced six DatasetConfiguration legacy getters (get_seed_groups, get_all_seed_groups, get_seed_attack_groups, get_all_seed_attack_groups, get_default_dataset_names, get_all_seeds) marked for removal in 0.17.0 in favor of DatasetAttackConfiguration's async API. Since versioning jumps 0.14 -> 1.0.0, 0.17.0 will never ship, so these are removed now with all internal call sites migrated to the async getters / dataset_names property.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Make related_conversations JSON serialization deterministic and add coverage for memory-label propagation paths touched by the deprecation cleanup.

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.

2 participants