Skip to content

Installation

Requirements

  • Python ≥ 3.11
  • uv or pip for package management

Install RAMPART

Create a virtual environment and install RAMPART:

Bash
uv init rampart-dev-env
cd rampart-dev-env
uv add rampart

Or, if you already have a project:

Bash
uv venv
uv pip install rampart

Using pip

Bash
python -m venv .venv
source .venv/bin/activate
pip install rampart
PowerShell
python -m venv .venv
.venv\Scripts\Activate.ps1
pip install rampart

Both approaches install RAMPART and all dependencies, including PyRIT v0.13.0.


Install from Source

Using uv

Bash
uv init rampart-dev-env
cd rampart-dev-env
uv add rampart --git https://github.com/microsoft/RAMPART.git

Using pip

Bash
git clone https://github.com/microsoft/RAMPART.git
cd RAMPART
pip install -e .

For development dependencies (linting, type checking, test tooling):

Bash
# uv (recommended — installs the dev group by default)
uv sync

# pip
pip install -e . --group dev

Optional Extras

RAMPART's core install is intentionally small. Features that pull in heavy provider SDKs are exposed as optional extras:

Extra Pulls in When you need it
onedrive msgraph-sdk, azure-identity Using the built-in OneDriveSurface to plant XPIA payloads in OneDrive.

Install one or more extras with the standard bracket syntax:

Bash
pip install "rampart[onedrive]"
# or from source:
pip install -e ".[onedrive]"
# or with uv:
uv add "rampart[onedrive]"

Verify Installation

Confirm the RAMPART pytest plugin is registered by checking its markers:

Bash
pytest --markers | grep -E "harm|trial"
PowerShell
pytest --markers | Select-String "harm|trial"

Expected output:

Text Only
@pytest.mark.harm(*categories): categorize by harm type
@pytest.mark.trial(n=, threshold=): statistical repetition

RAMPART registers as a pytest plugin automatically via the pytest11 entry point. No conftest.py configuration is needed to activate it.


Setting Up Your Test Project

Your pyproject.toml should include:

TOML
[project]
dependencies = [
    "rampart",
]

[project.optional-dependencies]
dev = [
    "pytest>=9.0",
    "pytest-asyncio>=1.3",
]

[tool.pytest.ini_options]
asyncio_mode = "auto"