Skip to content

Commit 0079b6d

Browse files
Merge pull request trustyai-explainability#141 from trustyai-explainability/rhoaieng-55152
Rename 'stubs' to 'prompts' in report UI labels
2 parents 34cb465 + b2af6ee commit 0079b6d

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

src/llama_stack_provider_trustyai_garak/resources/art_report.jinja2

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,10 @@
157157
<th role="columnheader" scope="col">Intent</th>
158158
<th role="columnheader" scope="col">Total Attempts</th>
159159
{% if probe.is_baseline %}
160-
<th role="columnheader" scope="col">Unsafe Stubs</th>
160+
<th role="columnheader" scope="col">Unsafe Prompts</th>
161161
<th role="columnheader" scope="col">Unsafe Rate</th>
162162
{% else %}
163-
<th role="columnheader" scope="col">Unsafe Stubs</th>
163+
<th role="columnheader" scope="col">Unsafe Prompts</th>
164164
<th role="columnheader" scope="col">Attack Success Rate</th>
165165
{% endif %}
166166
</tr>
@@ -171,13 +171,13 @@
171171
<td role="cell" data-label="Intent">{{ row.intent_name }}</td>
172172
<td role="cell" data-label="Total Attempts">{{ row.total_attacks }}</td>
173173
{% if probe.is_baseline %}
174-
<td role="cell" data-label="Unsafe Stubs">{{ row.complied_attacks }}
174+
<td role="cell" data-label="Unsafe Prompts">{{ row.complied_attacks }}
175175
/ {{ row.total_attacks }}</td>
176176
<td role="cell"
177177
data-label="Unsafe Rate">{{ row.asr }}%
178178
</td>
179179
{% else %}
180-
<td role="cell" data-label="Unsafe Stubs">{{ row.jailbroken_stubs }}
180+
<td role="cell" data-label="Unsafe Prompts">{{ row.jailbroken_stubs }}
181181
/ {{ row.baseline_stubs }}</td>
182182
<td role="cell"
183183
data-label="Attack Success Rate">{{ row.asr }}%

src/llama_stack_provider_trustyai_garak/resources/vega_chart_behaviour_by_intent.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
"aggregate": "max",
9292
"type": "quantitative",
9393
"legend": {
94-
"title": "Baseline Stubs",
94+
"title": "Baseline Prompts",
9595
"format": "d"
9696
}
9797
},
@@ -119,7 +119,7 @@
119119
},
120120
{
121121
"field": "stub",
122-
"title": "Stub"
122+
"title": "Prompt"
123123
},
124124
{
125125
"field": "probe_name",
@@ -132,7 +132,7 @@
132132
{
133133
"field": "baseline_stubs",
134134
"type": "quantitative",
135-
"title": "Baseline Stubs"
135+
"title": "Baseline Prompts"
136136
}
137137
]
138138
},

src/llama_stack_provider_trustyai_garak/resources/vega_chart_behaviour_by_probe.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,15 +184,15 @@
184184
{
185185
"field": "baseline_stubs",
186186
"type": "quantitative",
187-
"title": "Baseline Stubs"
187+
"title": "Baseline Prompts"
188188
},
189189
{
190190
"field": "intent_name",
191191
"title": "Intent"
192192
},
193193
{
194194
"field": "stub",
195-
"title": "Stub"
195+
"title": "Prompt"
196196
},
197197
{
198198
"field": "outcome",

src/llama_stack_provider_trustyai_garak/result_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,8 +1069,8 @@ def high_level_stats(attacks_by_intent_data):
10691069

10701070
return [
10711071
{"label": "Total attempts", "value": total_attempts},
1072-
{"label": "Unsafe stubs", "value": unsafe_count},
1073-
{"label": "Safe stubs", "value": safe_count},
1072+
{"label": "Unsafe prompts", "value": unsafe_count},
1073+
{"label": "Safe prompts", "value": safe_count},
10741074
{"label": "Attack success rate", "value": format(success_rate, ".0f") + "%"},
10751075
]
10761076

tests/test_utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -741,8 +741,8 @@ def test_high_level_stats(self):
741741

742742
stats = {s["label"]: s["value"] for s in result}
743743
assert stats["Total attempts"] == 5 # 1+1+1+2
744-
assert stats["Unsafe stubs"] == 2 # stub_a + stub_d jailbroken across all probes
745-
assert stats["Safe stubs"] == 2 # stub_b and stub_c never jailbroken
744+
assert stats["Unsafe prompts"] == 2 # stub_a + stub_d jailbroken across all probes
745+
assert stats["Safe prompts"] == 2 # stub_b and stub_c never jailbroken
746746
assert stats["Attack success rate"] == "50%" # 2/4 unique stubs jailbroken
747747

748748
def test_vega_data_includes_intent_name(self):
@@ -894,8 +894,8 @@ def test_intents_aggregates_match_high_level_stats(self):
894894
intents_metrics = calculate_intents_aggregates(all_raw)
895895

896896
assert intents_metrics["total_attempts"] == art_dict["Total attempts"]
897-
assert intents_metrics["unsafe_stubs"] == art_dict["Unsafe stubs"]
898-
assert intents_metrics["safe_stubs"] == art_dict["Safe stubs"]
897+
assert intents_metrics["unsafe_stubs"] == art_dict["Unsafe prompts"]
898+
assert intents_metrics["safe_stubs"] == art_dict["Safe prompts"]
899899
expected_rate = art_dict["Attack success rate"].replace("%", "")
900900
assert format(intents_metrics["attack_success_rate"], ".0f") == expected_rate
901901

0 commit comments

Comments
 (0)