Skip to content

Commit b06c6bc

Browse files
KutalVolkanromanlutzhannahwestra25jbolor21rlundeen2
authored
FEAT: Integrate XPIATestOrchestrator with the AI Recruiter (microsoft#684)
Co-authored-by: Roman Lutz <romanlutz13@gmail.com> Co-authored-by: hannahwestra25 <hannahwestra@microsoft.com> Co-authored-by: jbolor21 <86250273+jbolor21@users.noreply.github.com> Co-authored-by: rlundeen2 <137218279+rlundeen2@users.noreply.github.com>
1 parent 9ea989f commit b06c6bc

13 files changed

Lines changed: 961 additions & 614 deletions

File tree

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ repos:
5454
hooks:
5555
- id: flake8
5656
additional_dependencies: ['flake8-copyright']
57-
exclude: (doc/|.github/|pyrit/prompt_converter/morse_converter.py|tests/unit/converter/test_prompt_converter.py|pyrit/prompt_converter/emoji_converter.py)
57+
exclude: (doc/|.github/|pyrit/prompt_converter/morse_converter.py|tests/unit/converter/test_prompt_converter.py|pyrit/prompt_converter/emoji_converter.py|tests/unit/models/test_seed_prompt.py)
5858

5959
- repo: local
6060
hooks:

build_scripts/check_links.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828

2929
def extract_urls(file_path):
30-
with open(file_path, "r") as file:
30+
with open(file_path, "r", encoding="utf-8") as file:
3131
content = file.read()
3232
matches = URL_PATTERN.findall(content)
3333
# Flatten the list of tuples and filter out empty strings

doc/code/converters/pdf_converter.ipynb

Lines changed: 39 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
"name": "stdout",
3636
"output_type": "stream",
3737
"text": [
38-
"{'__type__': 'TextTarget', '__module__': 'pyrit.prompt_target.text_target'}: user: C:\\git\\PyRIT\\dbdata\\prompt-memory-entries\\urls\\1746483090633952.pdf\n",
39-
"{'__type__': 'TextTarget', '__module__': 'pyrit.prompt_target.text_target'}: user: C:\\git\\PyRIT\\dbdata\\prompt-memory-entries\\urls\\1746483090633952.pdf\n"
38+
"{'__type__': 'TextTarget', '__module__': 'pyrit.prompt_target.text_target'}: user: C:\\Users\\Roman\\git\\PyRIT\\dbdata\\prompt-memory-entries\\urls\\1748840666306426..pdf\n",
39+
"{'__type__': 'TextTarget', '__module__': 'pyrit.prompt_target.text_target'}: user: C:\\Users\\Roman\\git\\PyRIT\\dbdata\\prompt-memory-entries\\urls\\1748840666306426..pdf\n"
4040
]
4141
}
4242
],
@@ -76,7 +76,7 @@
7676
"\n",
7777
"# Initialize the PDFConverter\n",
7878
"pdf_converter = PromptConverterConfiguration.from_converters(\n",
79-
" converters = [\n",
79+
" converters=[\n",
8080
" PDFConverter(\n",
8181
" prompt_template=prompt_template,\n",
8282
" font_type=\"Arial\",\n",
@@ -122,8 +122,8 @@
122122
"name": "stdout",
123123
"output_type": "stream",
124124
"text": [
125-
"{'__type__': 'TextTarget', '__module__': 'pyrit.prompt_target.text_target'}: user: C:\\git\\PyRIT\\dbdata\\prompt-memory-entries\\urls\\1746483186494502.pdf\n",
126-
"{'__type__': 'TextTarget', '__module__': 'pyrit.prompt_target.text_target'}: user: C:\\git\\PyRIT\\dbdata\\prompt-memory-entries\\urls\\1746483186494502.pdf\n"
125+
"{'__type__': 'TextTarget', '__module__': 'pyrit.prompt_target.text_target'}: user: C:\\Users\\Roman\\git\\PyRIT\\dbdata\\prompt-memory-entries\\urls\\1748840771650401..pdf\n",
126+
"{'__type__': 'TextTarget', '__module__': 'pyrit.prompt_target.text_target'}: user: C:\\Users\\Roman\\git\\PyRIT\\dbdata\\prompt-memory-entries\\urls\\1748840771650401..pdf\n"
127127
]
128128
}
129129
],
@@ -136,7 +136,7 @@
136136
"\n",
137137
"# Initialize the PDFConverter without a template\n",
138138
"pdf_converter = PromptConverterConfiguration.from_converters(\n",
139-
" converters = [\n",
139+
" converters=[\n",
140140
" PDFConverter(\n",
141141
" prompt_template=None, # No template provided\n",
142142
" font_type=\"Arial\",\n",
@@ -182,11 +182,11 @@
182182
"name": "stdout",
183183
"output_type": "stream",
184184
"text": [
185-
"[15:15:33][316][ai-red-team][INFO][Processing page 0 with 2 injection items.]\n",
186-
"[15:15:33][326][ai-red-team][INFO][Processing page 1 with 2 injection items.]\n",
187-
"[15:15:33][329][ai-red-team][INFO][Processing page 2 with 2 injection items.]\n",
188-
"{'__type__': 'TextTarget', '__module__': 'pyrit.prompt_target.text_target'}: user: C:\\git\\PyRIT\\dbdata\\prompt-memory-entries\\urls\\1746483333332260.pdf\n",
189-
"{'__type__': 'TextTarget', '__module__': 'pyrit.prompt_target.text_target'}: user: C:\\git\\PyRIT\\dbdata\\prompt-memory-entries\\urls\\1746483333332260.pdf\n"
185+
"[22:06:31][781][ai-red-team][INFO][Processing page 0 with 2 injection items.]\n",
186+
"[22:06:31][812][ai-red-team][INFO][Processing page 1 with 2 injection items.]\n",
187+
"[22:06:31][832][ai-red-team][INFO][Processing page 2 with 2 injection items.]\n",
188+
"{'__type__': 'TextTarget', '__module__': 'pyrit.prompt_target.text_target'}: user: C:\\Users\\Roman\\git\\PyRIT\\dbdata\\prompt-memory-entries\\urls\\1748840791844377.tmpr8102p44.pdf\n",
189+
"{'__type__': 'TextTarget', '__module__': 'pyrit.prompt_target.text_target'}: user: C:\\Users\\Roman\\git\\PyRIT\\dbdata\\prompt-memory-entries\\urls\\1748840791844377.tmpr8102p44.pdf\n"
190190
]
191191
}
192192
],
@@ -214,8 +214,24 @@
214214
"\n",
215215
"# Define injection items\n",
216216
"injection_items = [\n",
217-
" {\"page\": 0, \"x\": 50, \"y\": 700, \"text\": \"Injected Text\", \"font_size\": 12, \"font\": \"Helvetica\", \"font_color\": (255, 0, 0)}, # Red text\n",
218-
" {\"page\": 1, \"x\": 100, \"y\": 600, \"text\": \"Confidential\", \"font_size\": 10, \"font\": \"Helvetica\", \"font_color\": (0, 0, 255)} # Blue text\n",
217+
" {\n",
218+
" \"page\": 0,\n",
219+
" \"x\": 50,\n",
220+
" \"y\": 700,\n",
221+
" \"text\": \"Injected Text\",\n",
222+
" \"font_size\": 12,\n",
223+
" \"font\": \"Helvetica\",\n",
224+
" \"font_color\": (255, 0, 0),\n",
225+
" }, # Red text\n",
226+
" {\n",
227+
" \"page\": 1,\n",
228+
" \"x\": 100,\n",
229+
" \"y\": 600,\n",
230+
" \"text\": \"Confidential\",\n",
231+
" \"font_size\": 10,\n",
232+
" \"font\": \"Helvetica\",\n",
233+
" \"font_color\": (0, 0, 255),\n",
234+
" }, # Blue text\n",
219235
"]\n",
220236
"\n",
221237
"# Define a simple string prompt (no templates)\n",
@@ -226,7 +242,7 @@
226242
"\n",
227243
"# Initialize the PDFConverter with the existing PDF and injection items\n",
228244
"pdf_converter = PromptConverterConfiguration.from_converters(\n",
229-
" converters = [\n",
245+
" converters=[\n",
230246
" PDFConverter(\n",
231247
" prompt_template=None, # No template provided\n",
232248
" font_type=\"Arial\",\n",
@@ -252,6 +268,14 @@
252268
"for entry in memory:\n",
253269
" print(entry)"
254270
]
271+
},
272+
{
273+
"cell_type": "code",
274+
"execution_count": null,
275+
"id": "6",
276+
"metadata": {},
277+
"outputs": [],
278+
"source": []
255279
}
256280
],
257281
"metadata": {
@@ -268,7 +292,7 @@
268292
"name": "python",
269293
"nbconvert_exporter": "python",
270294
"pygments_lexer": "ipython3",
271-
"version": "3.12.9"
295+
"version": "3.13.2"
272296
}
273297
},
274298
"nbformat": 4,

0 commit comments

Comments
 (0)