Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

MAINT Extract attack factory constructor compatibility rules

オープン
#2,764 コメント 2 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@Kaap10 がすでに取り組んでいます。

2026年9月23日 から。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
58/100
issue の種類
リファクタリング
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python
領域
ai, security, tooling

調査の方向性

Start with pyrit/scenario/core/attack_technique_factory.py and tests/unit/scenario/core/test_attack_technique_factory.py, following doc/code/framework.md and the scenario, Python, and test instructions. Trace the listed constructor-inspection and scoring-compatibility methods through real factory creation. Done means the helper preserves existing type-hint, optional, policy, converter-check, signature, identifier, and factory behavior, with focused coverage.

索引モデルが issue の本文から書いたものです。

説明

help wanted
Is your feature request related to a problem? Please describe.

AttackTechniqueFactory mixes constructor inspection and scoring-configuration compatibility with assembling attack instances. _get_accepted_params, _get_scoring_config_type, _unwrap_optional, _should_apply_scoring_config, and _apply_scorer_policy form a small compatibility subsystem that is harder to understand while mixed into the rest of the factory.

This is F1 of three small factory extractions. It is ready for implementation and does not depend on the adversarial-configuration or converter-composition extractions.

Describe the solution you'd like

Extract the existing constructor-contract inspection and compatibility decisions into a small private, typed helper in the scenario core package. Keep AttackTechniqueFactory as the public entry point and wire the helper into its existing validation and creation paths.

  • Represent accepted constructor parameters and the existing scoring-config type contract explicitly rather than repeatedly mixing reflection with configuration assembly.
  • Preserve existing type-hint resolution and optional-type handling. Do not broaden supported annotation shapes or introduce a new compatibility policy in this refactor.
  • Preserve ScorerOverridePolicy raise/warn/skip behavior, including when a supplied scoring configuration is omitted from constructor arguments.
  • Keep configuration compatibility at the technique/factory layer. Do not move it into scorers, targets, or attack algorithms.

Acceptance criteria:

  • Factories accept and reject the same constructor/configuration combinations as before.
  • Constructor parameter discovery, supported optional annotations, annotation-resolution fallback, and narrowed scoring-config types preserve their existing behavior.
  • Missing or incompatible scoring parameters exercise each existing policy with unchanged exceptions/warnings and effective constructor arguments.
  • Existing converter-capability checks that depend on constructor parameters still behave identically.
  • Public signatures, registered technique behavior, and component identifiers remain unchanged.
  • Focused factory coverage exercises the helper through real factory creation as well as its compatibility decisions.
Describe alternatives you've considered, if relevant

Do not introduce a generic dependency-injection/reflection framework or a new public factory API. Avoid splitting each reflection call into a pass-through wrapper. One cohesive contract helper is enough; additional caching is not required.

Additional context

Starting points: pyrit/scenario/core/attack_technique_factory.py and tests/unit/scenario/core/test_attack_technique_factory.py. Follow doc/code/framework.md and the scenario, Python, and test instructions.

This only concerns factory configuration compatibility. It does not refactor scorer execution, observation acquisition/replay, or the generic scorer lifecycle in #2413. The observation-aware LLM scoring proposal is explicitly deferred until reassessment September 29 through October 6, 2026.

#2494 is changing adversarial prompt assembly in the same factory. Keep this extraction confined to constructor compatibility and preserve that work when integrating; do not bundle its prompt changes.

主要言語
Python
スター
4.5k
フォーク
896
平均マージ
3日 5時間
マージ済み PR(30日)
200

環境構築

このプロジェクトの環境構築ファイルはまだ確認していません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

microsoft/PyRIT のほかの issue

microsoft/PyRIT の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。