-
Notifications
You must be signed in to change notification settings - Fork 438
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DRAFT] FEAT support adversarial_chat and scoring in scanner to enable automated multi-turn-orchestrators #706
base: main
Are you sure you want to change the base?
Changes from all commits
0619569
9d4c0c6
e4f4a32
b4607b6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
datasets: | ||
- ./pyrit/datasets/seed_prompts/illegal.prompt | ||
scenarios: | ||
- type: "RedTeamingOrchestrator" | ||
# - type: "CrescendoOrchestrator" | ||
# - type: "TreeOfAttacksWithPruningOrchestrator" | ||
# depth: 2 | ||
objective_target: | ||
type: "OpenAIChatTarget" # "AzureMLChatTarget" | "HuggingFaceEndpointTarget" | ... | ||
# endpoint_env_variable: # in case one wants to use multiple you need to specify the env vars - not yet supported | ||
# api_key_env_variable: | ||
# any arg for targets can be listed here: | ||
# deployment_name_env_variable: | ||
# headers: | ||
is_azure_target: true | ||
# converters: | ||
# - type: "Base64Converter" | ||
# - type: "LeetspeakConverter" | ||
adversarial_chat: | ||
type: "OpenAIChatTarget" | ||
is_azure_target: true | ||
scoring: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry if this is too broad or has been answered already, but if in the future, we want to run RTO and Crescendo each with a different scorer, how could we do that? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In different files... |
||
# scoring_target is optional. If a target is required but not provided, the adversarial_chat will be used for scoring | ||
# scoring_target: | ||
# type: "OpenAIChatTarget" | ||
objective_scorer: | ||
type: "SelfAskRefusalScorer" | ||
memory_labels: | ||
operator: roakey | ||
operation: op_trash_panda | ||
execution_settings: | ||
type: local # or "azureml" | ||
# parallel_nodes: 4 # how many scenarios to execute in parallel |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,6 @@ datasets: | |
- ./pyrit/datasets/seed_prompts/illegal.prompt | ||
scenarios: | ||
- type: "PromptSendingOrchestrator" | ||
# - type: "CrescendoOrchestrator" | ||
# - type: "TreeOfAttackWithPruningOrchestrator" | ||
objective_target: | ||
type: "OpenAIChatTarget" # "AzureMLChatTarget" | "HuggingFaceEndpointTarget" | ... | ||
# endpoint_env_variable: # in case one wants to use multiple you need to specify the env vars - not yet supported | ||
|
@@ -15,14 +13,11 @@ objective_target: | |
# converters: | ||
# - type: "Base64Converter" | ||
# - type: "LeetspeakConverter" | ||
# adversarial_chat: | ||
# type: "AzureMLChatTarget" | ||
# ... | ||
# scoring: | ||
# scorer: ... | ||
# objective_scorer: ... | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For PSO we can technically accept "scorers" (plural). Options I considered so far:
Thoughts? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I like the first option a bit better. Seems like most of the time (maybe I'm wrong!) people are just using one scorer so could be good to optimize for that experience. And then having the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree, mostly because it's the happy path and it makes it clear what the important one is. |
||
memory_labels: | ||
operator: romanlutz | ||
operation: scanner_setup_jan25 | ||
operator: roakey | ||
operation: op_trash_panda | ||
execution_settings: | ||
type: local # or "azureml" | ||
# parallel_nodes: 4 # how many scenarios to execute in parallel |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
datasets: | ||
- ./pyrit/datasets/seed_prompts/illegal.prompt | ||
scenarios: | ||
- type: "PromptSendingOrchestrator" | ||
- type: "RedTeamingOrchestrator" | ||
- type: "CrescendoOrchestrator" | ||
max_turns: 5 | ||
max_backtracks: 3 | ||
- type: "CrescendoOrchestrator" | ||
max_turns: 10 | ||
max_backtracks: 10 | ||
- type: "TreeOfAttacksWithPruningOrchestrator" | ||
depth: 10 | ||
width: 7 | ||
branching_factor: 8 | ||
- type: "TreeOfAttacksWithPruningOrchestrator" | ||
depth: 5 | ||
width: 3 | ||
branching_factor: 6 | ||
objective_target: | ||
type: "OpenAIChatTarget" | ||
adversarial_chat: | ||
type: "OpenAIChatTarget" | ||
scoring: | ||
scoring_target: | ||
type: "OpenAIChatTarget" | ||
objective_scorer: | ||
type: "SelfAskRefusalScorer" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
datasets: | ||
- ./pyrit/datasets/seed_prompts/illegal.prompt | ||
scenarios: | ||
- type: "CrescendoOrchestrator" | ||
max_turns: 8 | ||
max_backtracks: 4 | ||
objective_target: | ||
type: "OpenAIChatTarget" | ||
adversarial_chat: | ||
type: "OpenAIChatTarget" | ||
scoring: | ||
scoring_target: | ||
type: "OpenAIChatTarget" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
datasets: | ||
- ./pyrit/datasets/seed_prompts/illegal.prompt | ||
scenarios: | ||
- type: "CrescendoOrchestrator" | ||
objective_target: | ||
type: "OpenAIChatTarget" | ||
adversarial_chat: | ||
type: "OpenAIChatTarget" | ||
scoring: | ||
scoring_target: | ||
type: "OpenAIChatTarget" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
datasets: | ||
- ./pyrit/datasets/seed_prompts/illegal.prompt | ||
scenarios: | ||
- type: "CrescendoOrchestrator" | ||
max_turns: 8 | ||
wrong_arg: "wrong" | ||
objective_target: | ||
type: "OpenAIChatTarget" | ||
adversarial_chat: | ||
type: "OpenAIChatTarget" | ||
scoring: | ||
scoring_target: | ||
type: "OpenAIChatTarget" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
datasets: | ||
- ./pyrit/datasets/seed_prompts/illegal.prompt | ||
scenarios: | ||
- type: "RedTeamingOrchestrator" | ||
- type: "CrescendoOrchestrator" | ||
max_turns: 5 | ||
max_backtracks: 3 | ||
- type: "CrescendoOrchestrator" | ||
max_turns: 10 | ||
max_backtracks: 10 | ||
- type: "TreeOfAttacksWithPruningOrchestrator" | ||
depth: 10 | ||
width: 7 | ||
branching_factor: 8 | ||
- type: "TreeOfAttacksWithPruningOrchestrator" | ||
depth: 5 | ||
width: 3 | ||
branching_factor: 6 | ||
objective_target: | ||
type: "OpenAIChatTarget" | ||
adversarial_chat: | ||
type: "OpenAIChatTarget" | ||
scoring: | ||
scoring_target: | ||
type: "OpenAIChatTarget" | ||
objective_scorer: | ||
type: "SelfAskRefusalScorer" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
datasets: | ||
- ./pyrit/datasets/seed_prompts/illegal.prompt | ||
scenarios: | ||
- type: "RedTeamingOrchestrator" | ||
objective_target: | ||
type: "OpenAIChatTarget" | ||
adversarial_chat: | ||
type: "OpenAIChatTarget" | ||
scoring: | ||
objective_scorer: | ||
type: "SelfAskRefusalScorer" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
datasets: | ||
- ./pyrit/datasets/seed_prompts/illegal.prompt | ||
scenarios: | ||
- type: "RedTeamingOrchestrator" | ||
objective_target: | ||
type: "OpenAIChatTarget" | ||
adversarial_chat: | ||
type: "OpenAIChatTarget" | ||
scoring: | ||
objective_scorer: | ||
type: "SelfAskRefusalScorer" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
datasets: | ||
- ./pyrit/datasets/seed_prompts/illegal.prompt | ||
scenarios: | ||
- type: "RedTeamingOrchestrator" | ||
wrong_arg: "wrong" | ||
objective_target: | ||
type: "OpenAIChatTarget" | ||
adversarial_chat: | ||
type: "OpenAIChatTarget" | ||
scoring: | ||
objective_scorer: | ||
type: "SelfAskRefusalScorer" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
datasets: | ||
- ./pyrit/datasets/seed_prompts/illegal.prompt | ||
scenarios: | ||
- type: "TreeOfAttacksWithPruningOrchestrator" | ||
depth: 10 | ||
width: 7 | ||
branching_factor: 8 | ||
objective_target: | ||
type: "OpenAIChatTarget" | ||
adversarial_chat: | ||
type: "OpenAIChatTarget" | ||
scoring: | ||
scoring_target: | ||
type: "OpenAIChatTarget" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
datasets: | ||
- ./pyrit/datasets/seed_prompts/illegal.prompt | ||
scenarios: | ||
- type: "TreeOfAttacksWithPruningOrchestrator" | ||
objective_target: | ||
type: "OpenAIChatTarget" | ||
adversarial_chat: | ||
type: "OpenAIChatTarget" | ||
scoring: | ||
scoring_target: | ||
type: "OpenAIChatTarget" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
datasets: | ||
- ./pyrit/datasets/seed_prompts/illegal.prompt | ||
scenarios: | ||
- type: "TreeOfAttacksWithPruningOrchestrator" | ||
depth: 10 | ||
width: 7 | ||
wrong_arg: "wrong" | ||
objective_target: | ||
type: "OpenAIChatTarget" | ||
adversarial_chat: | ||
type: "OpenAIChatTarget" | ||
scoring: | ||
scoring_target: | ||
type: "OpenAIChatTarget" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
datasets: | ||
- ./pyrit/datasets/seed_prompts/illegal.prompt | ||
scenarios: | ||
- type: "RedTeamingOrchestrator" | ||
# - type: "CrescendoOrchestrator" | ||
# - type: "TreeOfAttacksWithPruningOrchestrator" | ||
# depth: 2 | ||
objective_target: | ||
type: "OpenAIChatTarget" # "AzureMLChatTarget" | "HuggingFaceEndpointTarget" | ... | ||
# endpoint_env_variable: # in case one wants to use multiple you need to specify the env vars - not yet supported | ||
# api_key_env_variable: | ||
# any arg for targets can be listed here: | ||
# deployment_name_env_variable: | ||
# headers: | ||
# converters: | ||
# - type: "Base64Converter" | ||
# - type: "LeetspeakConverter" | ||
adversarial_chat: | ||
type: "OpenAIChatTarget" | ||
is_azure_target: true | ||
scoring: | ||
# scoring_target is optional. If a target is required but not provided, the adversarial_chat will be used for scoring | ||
# scoring_target: | ||
# type: "OpenAIChatTarget" | ||
objective_scorer: | ||
type: "SelfAskRefusalScorer" | ||
memory_labels: | ||
operator: roakey | ||
operation: op_trash_panda | ||
execution_settings: | ||
type: local # or "azureml" | ||
# parallel_nodes: 4 # how many scenarios to execute in parallel |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
datasets: | ||
- ./pyrit/datasets/seed_prompts/illegal.prompt | ||
scenarios: | ||
- type: send_prompts | ||
- type: "PromptSendingOrchestrator" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
datasets: | ||
- ./pyrit/datasets/seed_prompts/illegal.prompt | ||
scenarios: | ||
- type: send_prompts | ||
- type: "PromptSendingOrchestrator" | ||
objective_target: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT: this pop is clean as opposed to the del in
validate_target
above, can we changevalidate_target
to match this?