Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
a3c978d
Reorganize install & configuration docs for clear 2-step flow
rlundeen2 Mar 24, 2026
2483b5e
Group setup navbar: Configuration + FAQ sections, rename Install title
rlundeen2 Mar 24, 2026
acd9dce
Simplify install & configure pages into decision guides with sub-pages
rlundeen2 Mar 24, 2026
ce4d2d6
Restructure install (4 cards) and config (3 sub-pages) to match landing
rlundeen2 Mar 25, 2026
acef824
Move contributor install pages under Install PyRIT, renumber contribu…
rlundeen2 Mar 25, 2026
8372245
Align navbar with landing page: 4 install + 2 config items
rlundeen2 Mar 25, 2026
9992f4f
Align install titles, order, and URLs across all three locations
rlundeen2 Mar 25, 2026
b699115
Move files to match navbar: setup/ → getting_started/
rlundeen2 Mar 25, 2026
3f6f057
Fix Getting Started nav link to point to /getting_started/install
rlundeen2 Mar 25, 2026
52fa619
Rewrite Getting Started and Configure PyRIT landing pages as overviews
rlundeen2 Mar 25, 2026
d2a4db5
Fix Getting Started links, consolidate install guidance, standardize …
rlundeen2 Mar 25, 2026
197c800
Fix landing page and extract troubleshooting to separate pages
rlundeen2 Mar 25, 2026
1a0a358
User Guide landing, troubleshooting grouping, remove boilerplate, spa…
rlundeen2 Mar 25, 2026
6344c2e
Add User Guide URL to top navbar
rlundeen2 Mar 25, 2026
31e4fa1
Simplify Next Steps across Getting Started pages
rlundeen2 Mar 25, 2026
7af5f84
Move troubleshooting to subdirectory, merge setup into installation
rlundeen2 Mar 25, 2026
ae8ed9b
Rename troubleshooting groups: Installation and Setup, Model Deployment
rlundeen2 Mar 25, 2026
6e5b67d
Sync .ipynb files: remove 'Before you begin' boilerplate
rlundeen2 Mar 25, 2026
ff89ab6
Fix broken links from doc restructure
rlundeen2 Mar 25, 2026
74672ba
Add false-positive URLs to link checker skip list
rlundeen2 Mar 25, 2026
65cdb8e
website uptdate
rlundeen2 Mar 25, 2026
de8a98e
Fix .ipynb sync: preserve cell outputs, restore auxiliary_attacks
rlundeen2 Mar 25, 2026
e637504
updating .ipynb output
rlundeen2 Mar 25, 2026
ce48d80
Fix 2_red_teaming_attack.ipynb: restore outputs, manually remove boil…
rlundeen2 Mar 25, 2026
cc960ba
Add conda option to Contributor Local Installation
rlundeen2 Mar 25, 2026
6f70fef
regenerating docs
rlundeen2 Mar 25, 2026
66609a1
Add conda troubleshooting to local dev troubleshooting page
rlundeen2 Mar 25, 2026
5b0460b
Update doc/code/memory/7_azure_sql_memory_attacks.py
rlundeen2 Mar 26, 2026
965cd15
pr feedback
rlundeen2 Mar 26, 2026
7da1cf5
Merge branch 'users/rlundeen/2026_03_docs' of https://github.com/rlun…
rlundeen2 Mar 26, 2026
84e1e3d
pr feedback
rlundeen2 Mar 26, 2026
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
23 changes: 20 additions & 3 deletions .env_example
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
# This is an example of the .env file. Copy to ~/.pyrit/.env and fill in your endpoint configurations.
# Note that if you are using Entra authentication for certain Azure resources (use_entra_auth = True in PyRIT),
# keys for those resources are not needed.
# ============================================================================
# PyRIT Environment File Example
# ============================================================================
#
# Copy this file to ~/.pyrit/.env and fill in ONLY the sections you need.
#
# MOST USERS ONLY NEED 3 VARIABLES to get started:
#
# OPENAI_CHAT_ENDPOINT="https://api.openai.com/v1" # or any OpenAI-compatible API
# OPENAI_CHAT_KEY="your-key-here"
# OPENAI_CHAT_MODEL="gpt-4o"
#
# These work with OpenAI, Azure OpenAI, Ollama, Groq, OpenRouter, and any
# other OpenAI-compatible endpoint. See doc/setup/populating_secrets.md
# for provider-specific examples.
#
# If you are using Entra authentication for Azure resources
# (use_entra_auth = True in PyRIT), keys for those resources are not needed.
#
# ============================================================================


###################################
Expand Down
4 changes: 3 additions & 1 deletion build_scripts/check_links.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,16 @@
"https://platform.openai.com/docs/api-reference/responses", # blocks python requests
"https://platform.openai.com/docs/guides/function-calling", # blocks python requests
"https://platform.openai.com/docs/guides/structured-outputs", # blocks python requests
"https://platform.openai.com/api-keys", # blocks python requests (requires auth)
"https://www.anthropic.com/research/many-shot-jailbreaking", # blocks python requests
"https://doi.org/10.1145/3749447", # ACM blocks automated requests
"https://azure.microsoft.com/free/", # Azure blocks automated requests
"https://code.visualstudio.com/docs/devcontainers/containers",
"https://stackoverflow.com/questions/77134272/pip-install-dev-with-pyproject-toml-not-working",
"https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers",
]

custom_myst_references = ["notebook_tests"]
custom_myst_references = ["notebook_tests", "mistralai_mixtral_8x7b_instruct_v0_1"]

# Updated regex pattern to capture URLs from Markdown and HTML
URL_PATTERN = re.compile(r'\[.*?\]\((.*?)\)|href="([^"]+)"|src="([^"]+)"')
Expand Down
5 changes: 2 additions & 3 deletions doc/code/converters/0_converters.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,6 @@
"\n",
"prompt = \"tell me how to cut down a tree\"\n",
"\n",
"\n",
"print(await ROT13Converter().convert_tokens_async(prompt=prompt)) # type: ignore\n",
"print(await RandomCapitalLettersConverter(percentage=25.0).convert_tokens_async(prompt=prompt)) # type: ignore\n",
"print(await AsciiArtConverter().convert_tokens_async(prompt=prompt)) # type: ignore\n",
Expand All @@ -705,7 +704,6 @@
"\n",
"Although converters can be used on their own, they should be thought of as a piece in the pipeline. Typically any attack will have arguments so that prompts can be converted before being sent to the target. They can be stacked, use LLMs, and are a powerful tool.\n",
"\n",
"Before you begin, ensure you are setup with the correct version of PyRIT installed and have secrets configured as described [here](../../setup/populating_secrets.md).\n",
"\n",
"### Stacking Converters with PromptSendingAttack\n",
"\n",
Expand Down Expand Up @@ -891,7 +889,8 @@
],
"metadata": {
"jupytext": {
"cell_metadata_filter": "-all"
"cell_metadata_filter": "-all",
"main_language": "python"
},
"language_info": {
"codemirror_mode": {
Expand Down
2 changes: 0 additions & 2 deletions doc/code/converters/0_converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@

prompt = "tell me how to cut down a tree"


print(await ROT13Converter().convert_tokens_async(prompt=prompt)) # type: ignore
print(await RandomCapitalLettersConverter(percentage=25.0).convert_tokens_async(prompt=prompt)) # type: ignore
print(await AsciiArtConverter().convert_tokens_async(prompt=prompt)) # type: ignore
Expand All @@ -95,7 +94,6 @@
#
# Although converters can be used on their own, they should be thought of as a piece in the pipeline. Typically any attack will have arguments so that prompts can be converted before being sent to the target. They can be stacked, use LLMs, and are a powerful tool.
#
# Before you begin, ensure you are setup with the correct version of PyRIT installed and have secrets configured as described [here](../../setup/populating_secrets.md).
#
# ### Stacking Converters with PromptSendingAttack
#
Expand Down
7 changes: 3 additions & 4 deletions doc/code/converters/1_text_to_text_converters.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@
"cell_type": "code",
"execution_count": null,
"id": "3",
"metadata": {
"lines_to_next_cell": 2
},
"metadata": {},
"outputs": [
{
"name": "stdout",
Expand Down Expand Up @@ -653,7 +651,8 @@
],
"metadata": {
"jupytext": {
"cell_metadata_filter": "-all"
"cell_metadata_filter": "-all",
"main_language": "python"
},
"language_info": {
"codemirror_mode": {
Expand Down
1 change: 0 additions & 1 deletion doc/code/converters/1_text_to_text_converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@
# Negation Trap adds negation phrases to try to confuse the model
print("Negation Trap:", await NegationTrapConverter().convert_async(prompt="your metaprompt")) # type: ignore


# %% [markdown]
# ### 1.2 Obfuscation Converters
#
Expand Down
5 changes: 4 additions & 1 deletion doc/code/converters/3_image_converters.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"from PIL import Image\n",
"\n",
"from pyrit.prompt_converter import QRCodeConverter\n",
"from pyrit.prompt_target.common.target_capabilities import TargetCapabilities\n",
"from pyrit.setup import IN_MEMORY, initialize_pyrit_async\n",
"\n",
"await initialize_pyrit_async(memory_db_type=IN_MEMORY) # type: ignore\n",
Expand Down Expand Up @@ -406,7 +407,6 @@
"from pyrit.executor.attack.single_turn import PromptSendingAttack\n",
"from pyrit.models import SeedGroup, SeedPrompt\n",
"from pyrit.prompt_target import OpenAIChatTarget\n",
"from pyrit.prompt_target.common.target_capabilities import TargetCapabilities\n",
"\n",
"llm_target = OpenAIChatTarget(\n",
" # The target needs to accept a multi-piece message containing an image; override the default text-only capabilities.\n",
Expand Down Expand Up @@ -462,6 +462,9 @@
}
],
"metadata": {
"jupytext": {
"main_language": "python"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
Expand Down
1 change: 0 additions & 1 deletion doc/code/converters/3_image_converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@
)
)


try:
print("Sending the blended image with transparency to the LLM...")

Expand Down
5 changes: 1 addition & 4 deletions doc/code/converters/6_selectively_converting.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@
"cell_type": "code",
"execution_count": null,
"id": "1",
"metadata": {
"lines_to_next_cell": 2
},
"metadata": {},
"outputs": [
{
"name": "stdout",
Expand Down Expand Up @@ -116,7 +114,6 @@
"\n",
"converter_config = AttackConverterConfig(request_converters=converters)\n",
"\n",
"\n",
"attack = PromptSendingAttack(\n",
" objective_target=target,\n",
" attack_converter_config=converter_config,\n",
Expand Down
2 changes: 0 additions & 2 deletions doc/code/converters/6_selectively_converting.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
target = TextTarget(text_stream=open(os.devnull, "w", encoding="utf-8")) # noqa: SIM115
printer = ConsoleAttackResultPrinter()


# %% [markdown]
# ## Example 1: Using Tokens (Simplest)
#
Expand All @@ -69,7 +68,6 @@

converter_config = AttackConverterConfig(request_converters=converters)


attack = PromptSendingAttack(
objective_target=target,
attack_converter_config=converter_config,
Expand Down
17 changes: 1 addition & 16 deletions doc/code/converters/7_human_converter.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
"Note: Since the target's responses are sent to the scorer LLM for evaluation, you will see them pop up with the ability to modify them. You likely do not need to modify\n",
"them; however, you can if you wish to alter the feedback for generating the next prompt.\n",
"\n",
"\n",
"Before you begin, ensure you are setup with the correct version of [PyRIT installed](../../index.md#installation-guide) and have [secrets configured](../../setup/populating_secrets.md).\n"
"\n"
]
},
{
Expand Down Expand Up @@ -692,20 +691,6 @@
"result = await red_teaming_attack.execute_async(objective=conversation_objective) # type: ignore\n",
"await ConsoleAttackResultPrinter().print_conversation_async(result=result) # type: ignore"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "2",
"metadata": {},
"outputs": [],
"source": [
"# Close connection\n",
"from pyrit.memory import CentralMemory\n",
"\n",
"memory = CentralMemory.get_memory_instance()\n",
"memory.dispose_engine()"
]
}
],
"metadata": {
Expand Down
1 change: 0 additions & 1 deletion doc/code/converters/7_human_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
# them; however, you can if you wish to alter the feedback for generating the next prompt.
#
#
# Before you begin, ensure you are setup with the correct version of [PyRIT installed](../../index.md#installation-guide) and have [secrets configured](../../setup/populating_secrets.md).
#

# %%
Expand Down
7 changes: 4 additions & 3 deletions doc/code/datasets/2_seed_programming.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
"\n",
"await initialize_pyrit_async(memory_db_type=IN_MEMORY) # type: ignore\n",
"\n",
"\n",
"image_path = pathlib.Path(\".\") / \"..\" / \"..\" / \"..\" / \"assets\" / \"pyrit_architecture.png\"\n",
"\n",
"# A SeedGroup is a collection of Seeds that are grouped together as part of a conversation\n",
Expand Down Expand Up @@ -91,7 +90,6 @@
"attack = PromptSendingAttack(objective_target=target, attack_scoring_config=scoring_config)\n",
"printer = ConsoleAttackResultPrinter()\n",
"\n",
"\n",
"# every attack has this to extract parameters from the seed group\n",
"params = await attack.params_type.from_seed_group_async(seed_group=seed_group) # type: ignore\n",
"print(\"Attack Parameters:\", params)"
Expand Down Expand Up @@ -233,7 +231,7 @@
"id": "4",
"metadata": {},
"source": [
"You can also generate all or part of `prepended_conversation` and `next_message` using an attack model using a `seed_simulated_conversation`. The below example shows how to create these parameters such that the objective target has \n",
"You can also generate all or part of `prepended_conversation` and `next_message` using an attack model using a `seed_simulated_conversation`. The below example shows how to create these parameters such that the objective target has the following:\n",
"\n",
"1. A static system prompt\n",
"2. Generate the first three turns to a conversation to be prepended, along with a next_message."
Expand Down Expand Up @@ -701,6 +699,9 @@
}
],
"metadata": {
"jupytext": {
"main_language": "python"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
Expand Down
2 changes: 0 additions & 2 deletions doc/code/datasets/2_seed_programming.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@

await initialize_pyrit_async(memory_db_type=IN_MEMORY) # type: ignore


image_path = pathlib.Path(".") / ".." / ".." / ".." / "assets" / "pyrit_architecture.png"

# A SeedGroup is a collection of Seeds that are grouped together as part of a conversation
Expand Down Expand Up @@ -71,7 +70,6 @@
attack = PromptSendingAttack(objective_target=target, attack_scoring_config=scoring_config)
printer = ConsoleAttackResultPrinter()


# every attack has this to extract parameters from the seed group
params = await attack.params_type.from_seed_group_async(seed_group=seed_group) # type: ignore
print("Attack Parameters:", params)
Expand Down
13 changes: 4 additions & 9 deletions doc/code/executor/attack/1_prompt_sending_attack.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
"\n",
"This demo showcases how to use the attack to send prompts, how to modify the prompts with converters, and how to view responses from the target.\n",
"\n",
"Before you begin, import the necessary libraries and ensure you are setup with the correct version of PyRIT installed and have secrets\n",
"configured as described [here](../../../setup/populating_secrets.md).\n",
"\n",
"The first example is as simple as it gets.\n",
"\n",
Expand Down Expand Up @@ -237,9 +235,7 @@
"cell_type": "code",
"execution_count": null,
"id": "5",
"metadata": {
"lines_to_next_cell": 2
},
"metadata": {},
"outputs": [
{
"name": "stdout",
Expand Down Expand Up @@ -890,9 +886,7 @@
"cell_type": "code",
"execution_count": null,
"id": "11",
"metadata": {
"lines_to_next_cell": 2
},
"metadata": {},
"outputs": [
{
"name": "stderr",
Expand Down Expand Up @@ -1215,7 +1209,8 @@
],
"metadata": {
"jupytext": {
"cell_metadata_filter": "-all"
"cell_metadata_filter": "-all",
"main_language": "python"
},
"language_info": {
"codemirror_mode": {
Expand Down
4 changes: 0 additions & 4 deletions doc/code/executor/attack/1_prompt_sending_attack.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
#
# This demo showcases how to use the attack to send prompts, how to modify the prompts with converters, and how to view responses from the target.
#
# Before you begin, import the necessary libraries and ensure you are setup with the correct version of PyRIT installed and have secrets
# configured as described [here](../../../setup/populating_secrets.md).
#
# The first example is as simple as it gets.
#
Expand Down Expand Up @@ -127,7 +125,6 @@
)
"""


# %% [markdown]
# ## Multi-Modal
#
Expand Down Expand Up @@ -238,7 +235,6 @@
for result in results:
await printer.print_conversation_async(result=result) # type: ignore


# %% [markdown]
# ## Sending Prompts Directly
#
Expand Down
4 changes: 1 addition & 3 deletions doc/code/executor/attack/2_red_teaming_attack.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@
" linkStyle 6 stroke:#D50000\n",
"```\n",
"\n",
"Note that for this to succeed, the `AttackAdversarialConfig` requires an LLM endpoint without serious content moderation or other kinds of safety filtering mechanisms. Success depends on the model and may not be achieved every time.\n",
"\n",
"Before you begin, ensure you are setup with the correct version of PyRIT installed and have secrets configured as described [here](../../../setup/populating_secrets.md)."
"Note that for this to succeed, the `AttackAdversarialConfig` requires an LLM endpoint without serious content moderation or other kinds of safety filtering mechanisms. Success depends on the model and may not be achieved every time.\n"
]
},
{
Expand Down
3 changes: 0 additions & 3 deletions doc/code/executor/attack/2_red_teaming_attack.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@
#
# Note that for this to succeed, the `AttackAdversarialConfig` requires an LLM endpoint without serious content moderation or other kinds of safety filtering mechanisms. Success depends on the model and may not be achieved every time.
#
# Before you begin, ensure you are setup with the correct version of PyRIT installed and have secrets configured as described [here](../../../setup/populating_secrets.md).
# %%
import logging

from pyrit.executor.attack import (
Expand Down Expand Up @@ -137,7 +135,6 @@
),
]


# Testing against an AzureOpenAI deployed GPT 4 instance
oai_endpoint = os.getenv("AZURE_OPENAI_GPT4_CHAT_ENDPOINT")
oai_objective_target = OpenAIChatTarget(
Expand Down
4 changes: 2 additions & 2 deletions doc/code/executor/attack/3_crescendo_attack.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"\n",
"Note that this attack is more likely to succeed if the adversarial LLM provided does not have content moderation or other safety mechanisms. Even then, success may depend on the model and may not be guaranteed every time.\n",
"\n",
"Before you begin, ensure you are set up with the correct version of PyRIT installed and have secrets configured as described [here](../../../setup/populating_secrets.md).\n",
"\n",
"The results and intermediate interactions will be saved to memory according to the environment settings. For details, see the [Memory Configuration Guide](../../memory/0_memory.md)."
]
Expand Down Expand Up @@ -506,7 +505,8 @@
],
"metadata": {
"jupytext": {
"cell_metadata_filter": "-all"
"cell_metadata_filter": "-all",
"main_language": "python"
},
"language_info": {
"codemirror_mode": {
Expand Down
1 change: 0 additions & 1 deletion doc/code/executor/attack/3_crescendo_attack.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#
# Note that this attack is more likely to succeed if the adversarial LLM provided does not have content moderation or other safety mechanisms. Even then, success may depend on the model and may not be guaranteed every time.
#
# Before you begin, ensure you are set up with the correct version of PyRIT installed and have secrets configured as described [here](../../../setup/populating_secrets.md).
#
# The results and intermediate interactions will be saved to memory according to the environment settings. For details, see the [Memory Configuration Guide](../../memory/0_memory.md).

Expand Down
Loading
Loading