FEAT: Adding PyRITInitializer parameters#1456
Merged
rlundeen2 merged 14 commits intomicrosoft:mainfrom Mar 16, 2026
Merged
Conversation
Add a dict[str, str] params system for PyRIT initializers that works uniformly across YAML config, CLI, and the programmatic API. Key changes: - Add InitializerParameter dataclass for declaring supported params - Add params: dict[str, str] | None to initialize_async signature - Migrate TargetInitializer/ScorerInitializer from constructor tags to params-based (tags as comma-separated string) - Update ConfigurationLoader to set _params instead of constructor kwargs - Update FrontendCore with _initializer_configs and name:key=val;key2=val2 CLI syntax for passing params - Add param validation (ValueError on unknown/missing required params) - Backward-compatible with old-style initializer scripts (no params arg) - Update InitializerMetadata with supported_parameters for discovery - Add comprehensive tests (294 passing) - Update documentation and .pyrit_conf_example Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…list[str]] Each parameter value is now a list of strings, which maps naturally to: - YAML: native list syntax under args - CLI: comma-separated values (tags=default,scorer -> ['default', 'scorer']) - Programmatic API: direct list passing This eliminates the need for comma-separated string parsing inside initializers and provides a cleaner, more uniform API. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add name:key=val1,val2 syntax hints to --initializers help in shell. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
romanlutz
reviewed
Mar 13, 2026
romanlutz
reviewed
Mar 13, 2026
jsong468
reviewed
Mar 13, 2026
jsong468
reviewed
Mar 13, 2026
jsong468
reviewed
Mar 13, 2026
ValbuenaVC
reviewed
Mar 13, 2026
…github.com/rlundeen2/PyRIT into users/rlundeen/2026_03_10_initializer_tags
jsong468
reviewed
Mar 16, 2026
jsong468
reviewed
Mar 16, 2026
jsong468
reviewed
Mar 16, 2026
jsong468
reviewed
Mar 16, 2026
jsong468
reviewed
Mar 16, 2026
jsong468
reviewed
Mar 16, 2026
jsong468
reviewed
Mar 16, 2026
ValbuenaVC
approved these changes
Mar 16, 2026
Contributor
ValbuenaVC
left a comment
There was a problem hiding this comment.
Looks great! Only comments left are nits
riyosha
pushed a commit
to riyosha/PyRIT
that referenced
this pull request
Mar 24, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously, initializer configuration (like target tags) was passed through constructor arguments, which didn't
translate cleanly to YAML config or CLI usage. This unifies the approach so parameters flow the same way regardless
of entry point.
This change adds a uniform params system for PyRIT initializers that works consistently across YAML config, CLI, and the
programmatic API.
What changed:
InitializerParameterdataclass for initializers to declare their supported parameters (name, description,required, default)
initialize_async()now accepts an optional params: dict[str, list[str]] argumentAPI usage