Skip to content

FEAT: Integrate XPIATestOrchestrator with the AI Recruiter #684

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

Open
wants to merge 30 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
97c20ae
some stuff
KutalVolkan Feb 1, 2025
d622de8
update pdfconverter
KutalVolkan Feb 1, 2025
75f41b7
DEMO: xpia_orchestrator attacking ai recruiter
KutalVolkan Feb 2, 2025
d53285c
clean up + integrate XPIATestOrchestrator with the AI Recruiter + add…
KutalVolkan Feb 7, 2025
09f989b
Integrate XPIATestOrchestrator with AI Recruiter + Add HTTPXApiTarget
KutalVolkan Feb 7, 2025
409dba8
test: core functionallity covered in HTTPApiTarget
KutalVolkan Feb 7, 2025
282d3be
run pre-commit hooks
KutalVolkan Feb 7, 2025
7beb6f3
add new cv
KutalVolkan Feb 7, 2025
65dfb1f
add integration test
KutalVolkan Feb 8, 2025
cf63ac7
adding a scorer to .py, ipynb and integration test
KutalVolkan Feb 8, 2025
7b1ac17
add docstrings to ai_recruiter
KutalVolkan Feb 15, 2025
b27065d
Resolved merge conflicts
KutalVolkan Feb 15, 2025
628d6cd
add docstrigs to fastapiserver
KutalVolkan Feb 15, 2025
8d6f142
switch to aoai endpoints and deployments
KutalVolkan Feb 22, 2025
f6e71c1
Merge remote-tracking branch 'upstream/main' into feat/xpia-ai-recrui…
KutalVolkan Feb 22, 2025
8622677
convert pdf_converter.py to notebook
KutalVolkan Mar 16, 2025
7836f5f
Update doc/code/orchestrators/3_xpia_orchestrator.py
KutalVolkan Mar 16, 2025
8433ff9
Update pyrit/prompt_converter/pdf_converter.py
KutalVolkan Mar 16, 2025
9be0ae9
resolve comments, and push before pulling remote updates
KutalVolkan Mar 16, 2025
037ded1
add minimum versions to requirements.txt, run pre-commit --all, fix c…
KutalVolkan Mar 16, 2025
ade6032
undo unintended changes to orchestrator notebook
KutalVolkan Mar 16, 2025
6e33aaf
sync orchestrator notebook and script with upstream/main
KutalVolkan Mar 16, 2025
5337d88
add stable commit reference
KutalVolkan Mar 18, 2025
534107e
Merge remote-tracking branch 'upstream/main' into feat/xpia-ai-recrui…
KutalVolkan Mar 22, 2025
6c77600
update integration test
KutalVolkan Mar 22, 2025
79d47b5
update integration test
KutalVolkan Mar 22, 2025
0472105
update commit version that works
KutalVolkan Mar 22, 2025
ac1f8f3
enhance title clarity
KutalVolkan Mar 22, 2025
b308cc9
update true/false scorer prompt and clean up
KutalVolkan Mar 22, 2025
0907c4a
use Literal for method and add rate-limit decorator
KutalVolkan Mar 26, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build_scripts/check_links.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@


def extract_urls(file_path):
with open(file_path, "r") as file:
with open(file_path, "r", encoding="utf-8") as file:
content = file.read()
matches = URL_PATTERN.findall(content)
# Flatten the list of tuples and filter out empty strings
Expand Down
78 changes: 25 additions & 53 deletions doc/code/converters/pdf_converter.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,7 @@
"execution_count": null,
"id": "1",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"{'__type__': 'TextTarget', '__module__': 'pyrit.prompt_target.text_target'}: user: D:\\git\\PyRIT-internal\\PyRIT\\dbdata\\prompt-memory-entries\\urls\\1738382955429053.pdf\n",
"\u001b[1m\u001b[34muser: D:\\git\\PyRIT-internal\\PyRIT\\dbdata\\prompt-memory-entries\\urls\\1738382955429053.pdf\n"
]
}
],
"outputs": [],
"source": [
"import pathlib\n",
"\n",
Expand Down Expand Up @@ -77,7 +68,7 @@
"# Initialize the PDFConverter\n",
"pdf_converter = PDFConverter(\n",
" prompt_template=prompt_template,\n",
" font_type=\"Arial\",\n",
" font_type=\"Helvetica\",\n",
" font_size=12,\n",
" page_width=210,\n",
" page_height=297,\n",
Expand Down Expand Up @@ -110,22 +101,7 @@
"execution_count": null,
"id": "3",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"{'__type__': 'TextTarget', '__module__': 'pyrit.prompt_target.text_target'}: user: D:\\git\\PyRIT-internal\\PyRIT\\dbdata\\prompt-memory-entries\\urls\\1738380368779812.pdf\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[1m\u001b[34muser: D:\\git\\PyRIT-internal\\PyRIT\\dbdata\\prompt-memory-entries\\urls\\1738380368779812.pdf\n"
]
}
],
"outputs": [],
"source": [
"# Define a simple string prompt (no templates)\n",
"prompt = \"This is a simple test string for PDF generation. No templates here!\"\n",
Expand All @@ -136,7 +112,7 @@
"# Initialize the PDFConverter without a template\n",
"pdf_converter = PDFConverter(\n",
" prompt_template=None, # No template provided\n",
" font_type=\"Arial\",\n",
" font_type=\"Helvetica\",\n",
" font_size=12,\n",
" page_width=210,\n",
" page_height=297,\n",
Expand Down Expand Up @@ -171,19 +147,7 @@
"execution_count": null,
"id": "5",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[09:10:28][26][ai-red-team][INFO][Processing page 0 with 2 injection items.]\n",
"[09:10:28][31][ai-red-team][INFO][Processing page 1 with 2 injection items.]\n",
"[09:10:28][33][ai-red-team][INFO][Processing page 2 with 2 injection items.]\n",
"{'__type__': 'TextTarget', '__module__': 'pyrit.prompt_target.text_target'}: user: D:\\git\\PyRIT-internal\\PyRIT\\dbdata\\prompt-memory-entries\\urls\\1738429828035527.pdf\n",
"\u001b[1m\u001b[34muser: D:\\git\\PyRIT-internal\\PyRIT\\dbdata\\prompt-memory-entries\\urls\\1738429828035527.pdf\n"
]
}
],
"outputs": [],
"source": [
"import tempfile\n",
"from pathlib import Path\n",
Expand All @@ -208,8 +172,24 @@
"\n",
"# Define injection items\n",
"injection_items = [\n",
" {\"page\": 0, \"x\": 50, \"y\": 700, \"text\": \"Injected Text\", \"font_size\": 12, \"font\": \"Helvetica\", \"font_color\": (255, 0, 0)}, # Red text\n",
" {\"page\": 1, \"x\": 100, \"y\": 600, \"text\": \"Confidential\", \"font_size\": 10, \"font\": \"Helvetica\", \"font_color\": (0, 0, 255)} # Blue text\n",
" {\n",
" \"page\": 0,\n",
" \"x\": 50,\n",
" \"y\": 700,\n",
" \"text\": \"Injected Text\",\n",
" \"font_size\": 12,\n",
" \"font\": \"Helvetica\",\n",
" \"font_color\": (255, 0, 0),\n",
" }, # Red text\n",
" {\n",
" \"page\": 1,\n",
" \"x\": 100,\n",
" \"y\": 600,\n",
" \"text\": \"Confidential\",\n",
" \"font_size\": 10,\n",
" \"font\": \"Helvetica\",\n",
" \"font_color\": (0, 0, 255),\n",
" }, # Blue text\n",
"]\n",
"\n",
"# Define a simple string prompt (no templates)\n",
Expand All @@ -221,7 +201,7 @@
"# Initialize the PDFConverter with the existing PDF and injection items\n",
"pdf_converter = PDFConverter(\n",
" prompt_template=None, # No template provided\n",
" font_type=\"Arial\",\n",
" font_type=\"Helvetica\",\n",
" font_size=12,\n",
" page_width=210,\n",
" page_height=297,\n",
Expand Down Expand Up @@ -263,16 +243,8 @@
"cell_metadata_filter": "-all"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.8"
"version": "3.11.9"
}
},
"nbformat": 4,
Expand Down
3 changes: 1 addition & 2 deletions doc/code/converters/pdf_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,10 @@
await orchestrator.send_prompts_async(prompt_list=prompts) # type: ignore
await orchestrator.print_conversations_async() # type: ignore

import tempfile

# %% [markdown]
# # Modify Existing PDF with Injection Items
# %%
import tempfile
from pathlib import Path

import requests
Expand Down
Loading