MAINT Extract attack factory adversarial configuration assembly
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
Direzione di ricerca
Wait for prerequisite #2494 to settle, then read pyrit/scenario/core/attack_technique_factory.py, especially create() and _build_adversarial_config(), alongside tests/unit/scenario/core/test_attack_technique_factory.py. Follow doc/code/framework.md and the scenario, Python, and test instructions. Done means the helper is used by the factory while preserving the documented configuration, prompt, conflict, and repeated-creation behavior.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Is your feature request related to a problem? Please describe.
AttackTechniqueFactory.create() and _build_adversarial_config() combine adversarial target selection, prompt resolution, conflicting-override checks, and attack construction. These are configuration rules that can be isolated without changing the attack algorithm or the factory's public interface.
This is F2 of three small factory extractions. Not ready yet: #2494 is actively changing this exact path to add benchmark-owned prompt guidance. Wait until that PR lands or its design is otherwise resolved, then reassess the extraction against the resulting mainline code before adding help wanted. Do not implement a competing version of its prompt behavior.
Describe the solution you'd like
After the prerequisite is resolved, extract adversarial configuration assembly into a small private helper at the technique layer and wire it into the factory. Preserve the resulting mainline behavior rather than restoring the pre-#2494 implementation.
- Keep target precedence and the distinction between baked-in configuration, create-time inputs, and defaults explicit.
- Preserve conflicts and conditional construction: do not silently override a baked-in custom target or prompt, or create adversarial configuration for an incompatible attack.
- Keep system-prompt and seed-prompt assembly together with their validation. Reuse existing prompt/model helpers rather than duplicating them.
- If #2494 lands, preserve its final guidance-prefix, simulated-conversation, prompt-metadata, and identity behavior as part of the extraction.
Acceptance criteria:
- Default, baked-in, and create-time configurations produce the same target and prompts, with unchanged errors for conflicting inputs.
- Supported string and
SeedPromptinputs retain their existing handling. - The public factory API and registered techniques keep their behavior; no global factory or canonical prompt is mutated by creating a specialized attack instance.
- Any merged #2494 guidance composition retains native prompt parameters/schema/format and the intended component identity.
- Factory and affected prompt/configuration coverage protects the full override matrix and repeated creation with different inputs.
- The helper is used by the existing factory path, not left as unused scaffolding.
Describe alternatives you've considered, if relevant
Do not move packaging rules into executors or move attack turn management, pruning, backtracking, or scoring decisions into the factory. Do not combine this with a broad cleanup of defaults in older executors. Constructor compatibility and converter composition are separate, independently scoped extractions.
Additional context
Starting points: pyrit/scenario/core/attack_technique_factory.py, particularly create() and _build_adversarial_config(), and tests/unit/scenario/core/test_attack_technique_factory.py. Follow doc/code/framework.md and the scenario, Python, and test instructions.
Readiness prerequisite: #2494. Its current changes also touch per-instance seed-technique prefix composition, so confirm the final boundary after it settles. This issue is a behavior-preserving reorganization, not authorization for new prompt semantics or a public API redesign.
- Lingua principale
- Python
- Stelle
- 4.5k
- Fork
- 896
- Merge medio
- 3g 8h
- PR unite (30g)
- 191
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di microsoft/PyRIT
-
BUG HarmBench loader drops ContextString, so contextual behaviors are sent without their context Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
Tutte le issue di microsoft/PyRIT
Issue simili
-
agent-ready documentation needs-triage
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
-
documentation
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 91/100
-
workflow-status page template still says reusable workflows are "triggered only by workflow_call:" Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
-
instance instance add
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
searxng/searx-instances#939 · 1 commento ·
-
area-deployment area-integrations triage:bot-seen
Difficoltà 2/5 Mezza giornata Idoneità per principianti 86/100