diff --git a/doc/copyrit-demo.gif b/doc/copyrit-demo.gif new file mode 100644 index 000000000..5f8d4be90 Binary files /dev/null and b/doc/copyrit-demo.gif differ diff --git a/doc/framework-demo.png b/doc/framework-demo.png new file mode 100644 index 000000000..5cf52dcdc Binary files /dev/null and b/doc/framework-demo.png differ diff --git a/doc/index.md b/doc/index.md index 1f7cf4003..ec5d0e066 100644 --- a/doc/index.md +++ b/doc/index.md @@ -65,110 +65,98 @@ Evaluate AI responses with true/false, Likert scale, classification, and custom --- ## Getting Started +1. Install PyRIT and verify installation.\ +For more details and alternative installation methods, see the [Install PyRIT](getting_started/install) page\ +```bash +# note: for local installation, python version 3.13 is recommended: https://www.python.org/downloads/latest/python3.13 +pip install pyrit +python -c "import pyrit; print(f'PyRIT version installed: {pyrit.__version__}')" +``` -Getting PyRIT running takes two steps: **install** the package, then **configure** your AI endpoints. For the path that's right for you, see the [Getting Started](getting_started/README) guide. - -### Step 1: Install - -PyRIT offers flexible installation options to suit different needs. Choose the path that best fits your use case. - -::::{important} -**Version Compatibility:** -- **User installations** (Docker, Local) install the **latest stable release** from PyPI -- **Contributor installations** (Docker, Local) use the **latest development code** from the `main` branch -- Always match your notebooks to your PyRIT version -:::: +2. Create and populate endpoint and startup configuration files in `~/.pyrit/.env` and `~/.pyrit/.pyrit_conf` with minimal content below.\ +For more details, see the [Configure PyRIT](getting_started/configuration) page. :::::{grid} 1 1 2 2 -:gutter: 3 -::::{card} 🐋 User Docker Installation -:link: getting_started/install_docker -**Quick Start** ⭐ - -Get started immediately with a pre-configured environment: -- ✅ All dependencies included -- ✅ No Python setup needed -- ✅ JupyterLab built-in -- ✅ Works on all platforms +::::{card} 🔑 ~/.pyrit/.env +```bash +# example OPENAI_CHAT_ENDPOINT values: +# "https://api.openai.com/v1" +# "https://.cognitiveservices.azure.com/openai/v1/" +# "https://.services.ai.azure.com/openai/v1" +OPENAI_CHAT_ENDPOINT="" +OPENAI_CHAT_KEY="" +OPENAI_CHAT_MODEL="" +``` +:::: + +::::{card} 📄 ~/.pyrit/.pyrit_conf +```yaml +memory_db_type: in_memory + +initializers: + - name: target + args: + tags: + - default + - scorer + - name: scorer + - name: load_default_datasets +``` :::: -::::{card} ☀️ User Local Installation -:link: getting_started/install_local -**Custom Setup** - -Install PyRIT directly on your machine: -- ✅ Pip or uv -- ✅ Full Python environment control -- ✅ Easy integration with existing workflows -:::: - -::::{card} 🐋 Contributor Docker Installation -:link: getting_started/install_devcontainers -**Recommended for Contributors** ⭐ - -Pre-configured Docker container with VS Code: -- ✅ Consistent across all contributors -- ✅ All extensions pre-installed -- ✅ One-click setup -:::: +::::: -::::{card} ☀️ Contributor Local Installation -:link: getting_started/install_local_dev -**Custom Dev Setup** +3. Use PyRIT in any mode that best fits your use case: Scanner, GUI, or Framework. -Install from source in editable mode: -- ✅ Full development control -- ✅ Use any IDE or editor -- ✅ Customize environment -:::: -::::: +::::{tab-set} -### Step 2: Configure +:::{tab-item}🔍 Scanner +Run security assessments from the command line with `pyrit_scan` or the interactive `pyrit_shell`. Execute built-in scenarios against your AI targets. -After installing, configure PyRIT with your AI endpoint credentials and initialize the framework. PyRIT reads from `~/.pyrit/` by default. For more details, see the [Configure PyRIT](getting_started/configuration) page. +```bash +pyrit_scan airt.scam --target openai_chat +``` -:::::{grid} 1 1 2 2 -:gutter: 3 +![scanner-demo](scanner-demo.png) -::::{card} 🔑 Populating Secrets -:link: getting_started/populating_secrets -**Set Up Your .env File** +Use `pyrit_scan --help` to learn more about what else `pyrit_scan` can do. +For more details, see the [Scanner](scanner/0_scanner) page. +::: -Create `~/.pyrit/.env` with your provider credentials. Tabbed examples for OpenAI, Azure, Ollama, Groq, HuggingFace, and more. -:::: +:::{tab-item}🖥️ GUI +Use CoPyRIT's graphical interface for interactive red teaming. Chat with AI systems, track findings, and collaborate with your team. -::::{card} 📄 Config File (Recommended) -:link: getting_started/pyrit_conf -**Full Framework Setup** ⭐ +Start the local web app and give it a try: -Set up `.pyrit_conf` + `.env` for persistent config. Enables initializers that register targets, scorers, and datasets — required for `pyrit_scan` and scenarios. -:::: -::::: +```bash +pyrit_backend # serves webapp on http://localhost:8000/ +``` +![copyrit-demo](copyrit-demo.gif) -### Step 3: Use It! +For more details, see the [GUI](gui/0_gui) page. +::: -:::::{grid} 1 1 3 3 -:gutter: 3 +:::{tab-item}🧩 Framework +Dive into PyRIT's modular components — targets, converters, scorers, memory, and more. Create custom attacks and extend the framework. -::::{card} 🔍 PyRIT Scanner -:link: scanner/0_scanner -**Automated Red Teaming** +```python +from pyrit.setup import IN_MEMORY, initialize_pyrit_async +from pyrit.executor.attack import ConsoleAttackResultPrinter, PromptSendingAttack +from pyrit.prompt_target import OpenAIChatTarget -Run security assessments from the command line with `pyrit_scan` or the interactive `pyrit_shell`. Execute built-in scenarios against your AI targets. -:::: +await initialize_pyrit_async(memory_db_type=IN_MEMORY) -::::{card} 🖥️ PyRIT GUI -:link: gui/0_gui -**Human-Led Red Teaming** +target = OpenAIChatTarget() +attack = PromptSendingAttack(objective_target=target) +result = await attack.execute_async(objective="What model exactly are you?") -Use CoPyRIT's graphical interface for interactive red teaming. Chat with AI systems, track findings, and collaborate with your team. -:::: +printer = ConsoleAttackResultPrinter() +await printer.print_conversation_async(result=result) +``` -::::{card} 🧩 Framework -:link: code/framework -**Build Your Own** +![framework-demo](framework-demo.png) +::: -Dive into PyRIT's modular components — targets, converters, scorers, memory, and more. Create custom attacks and extend the framework. +For more details, see the [Framework](code/framework) page. :::: -::::: diff --git a/doc/scanner-demo.png b/doc/scanner-demo.png new file mode 100644 index 000000000..f5a18603f Binary files /dev/null and b/doc/scanner-demo.png differ