Lattice
Skip to content

PyRIT

librarySelf-hostedgithub.com

PyRIT is a self-hosted library in the Guardrails & Safety layer of the AI stack. Microsoft's red-team tool for generating and scoring attack prompts.

By Facts verifiedmethod

Licence
MIT
Language
Python
Cost
free
Owned by
Production & Governance

Use PyRIT when

Generating and scoring attack prompts systematically.

Skip PyRIT when

You are not authorised to test the target.

Stops the bad input before it, and the bad output after. See every guardrails tool.

Badge this entry
Lattice badge: PyRIT verified 2026-09
[![PyRIT on Lattice: verified 2026-09](https://lattice.kunjshah.in/guardrails-safety/pyrit/badge.svg)](https://lattice.kunjshah.in/guardrails-safety/pyrit)

Rules of thumb

  • A guardrail without an eval is a guess about which failures matter. Write the eval that found the failure, then the guardrail that blocks it.
  • PII is a data-flow problem. Detect and redact before the model ever sees it, not after it answers.
  • Every guardrail in the request path adds latency to every call. Run checks offline first and move them inline only when production forces it.

Quick answers

Is PyRIT open source?
Yes. PyRIT is open source under the MIT licence. It is free to use.
What are the alternatives to PyRIT?
The closest alternatives to PyRIT are garak.

Ask an AI about this page

Opens the assistant with this page’s link and a question already filled in.

Reading on guardrails

Alternatives to PyRIT

Listed as an alternative to

  • garak

Also in guardrails

  • NeMo Guardrails
  • Guardrails AI
  • Llama Guard
  • Microsoft Presidio
  • Lakera Guard
  • garak
  • Invariant Guardrails