MAINT Extract attack factory converter configuration composition
Los mantenedores suelen responder en 2 días
@ahcrm-core ya está trabajando en esto.
Desde el 23/9/2026.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 74/100
Línea de trabajo
Start in pyrit/scenario/core/attack_technique_factory.py and read AttackConverterConfig and ConverterConfiguration, then run tests/unit/scenario/core/test_attack_technique_factory.py. Extract the existing composition rules into a private typed helper while preserving public signatures, validation, ordering, response converters, and input immutability. Extend focused factory coverage for the composition matrix and the configuration passed to the attack constructor.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Is your feature request related to a problem? Please describe.
AttackTechniqueFactory.create() handles both complete converter-configuration overrides and additive request-converter composition alongside unrelated scoring and adversarial setup. The distinction matters: selecting extra request converters must not discard a technique's built-in behavior or its response converters.
This is F3 of three small factory extractions. It is ready for implementation and can land without the other factory extractions.
Describe the solution you'd like
Extract the existing converter-composition rules into a small private, typed helper at the technique layer. Have the factory use it while preserving its public parameters and current behavior.
- Keep full configuration replacement distinct from additive request-converter composition.
- Preserve the existing ordering between the selected base request pipeline and extra request converters.
- Preserve the response-converter pipeline from the effective base configuration.
- Retain the explicit
supports_additional_request_converterscapability and existing constructor checks. A constructor accepting a converter parameter alone does not imply semantic support for additive composition. - Do not mutate the registered factory's stored configuration or caller-supplied converter lists during composition.
Acceptance criteria:
- No override and no extras preserve the technique's original behavior.
- A full override retains current replacement semantics, including an explicitly empty configuration.
- Extras with and without an override preserve current request order and response converters.
- Unsupported additive composition and invalid capability declarations retain their existing validation/error behavior.
- Repeated factory creation with different extras does not accumulate converters or alter the original inputs.
- Public signatures, component identity, and existing registered technique behavior remain unchanged.
- Focused factory coverage verifies the composition matrix and the actual configuration passed to the attack constructor.
Describe alternatives you've considered, if relevant
Do not move converter execution into the factory, implement a second converter pipeline in the backend/UI, or create a generic configuration framework. Keep one clear internal composition helper and reuse the existing configuration types.
Additional context
Starting points: pyrit/scenario/core/attack_technique_factory.py, AttackConverterConfig, ConverterConfiguration, and tests/unit/scenario/core/test_attack_technique_factory.py. Follow doc/code/framework.md and the scenario, Python, and test instructions.
Related consumer: #2758 will expose registered techniques and ordered extra converters in the GUI. This extraction preserves the contracts it consumes and does not implement that GUI issue; #2758 is not a prerequisite for this refactor. Coordinate with #2494 where the same factory file is edited, but leave adversarial prompt assembly out of this change.
- Lenguaje dominante
- Python
- Estrellas
- 4.5k
- Forks
- 896
- Merge medio
- 2 d 22 h
- PR fusionados (30 d)
- 220
Preparar el entorno
Aún no hemos revisado los archivos de configuración de este proyecto. Empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de microsoft/PyRIT
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
microsoft/PyRIT#2905 · 3 comentarios ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 2 días
-
Bug: triage GUI help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
microsoft/PyRIT#2868 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 2 días
-
feature-request
Dificultad 5/5 Más de una semana Aptitud para principiantes 30/100
Los mantenedores suelen responder en 2 días
Todos los issues de microsoft/PyRIT
Issues similares
-
customer-reported
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Azure/azure-cli#34150 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
community-request
Dificultad 1/5 Menos de una hora Aptitud para principiantes 95/100
NVIDIA-NeMo/Curator#2464 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
weblate-discover crashes with an unhandled FileNotFoundError when the directory does not existAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
WeblateOrg/translation-finder#1099 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
trezor/trezor-firmware#7997 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día