Microsoft · 2026-05-20 · major
Microsoft Open-Sources RAMPART and Clarity — A Pytest-Native Red-Teaming Framework for AI Agents and a Pre-Code Design Sounding Board
Microsoft open-sourced two MIT-licensed agentic-AI safety tools: RAMPART, a pytest framework built on PyRIT that runs red-team tests like prompt injection in CI/CD, and Clarity, a planning agent that surfaces failure modes before code is written.

Two open-source tools that bake agent red-teaming and design review into the development workflow.
Key specs
| License | MIT |
|---|---|
| Rampart stars | 146 |
| Clarity stars | 79 |
What is it?
RAMPART and Clarity are open-source projects from Microsoft's AI Red Team aimed at making agentic AI safer before it ships. RAMPART is a pytest-native framework for writing repeatable safety and security tests against AI agents. Clarity is a planning assistant that interrogates a design before any code is written.
How does it work?
RAMPART is built on PyRIT, Microsoft's red-teaming automation framework. Developers write standard pytest cases describing threat scenarios; a thin adapter connects to the agent, orchestrates the interaction, and returns pass/fail signals that can gate CI/CD. It supports statistical trials, such as requiring an action be safe in at least 80% of runs, and focuses on cross-prompt injection. Clarity runs as a desktop app, web UI, or coding-agent integration, using multiple independent AI 'thinkers' that probe a system from security, human-factors, and operational angles, then writes markdown decision records into a .clarity-protocol/ directory.
Why does it matter?
Agent safety testing has largely been ad hoc and manual. Putting red-team checks into pytest and CI lets teams catch prompt-injection and tool-misuse regressions automatically on every change, while Clarity pushes failure analysis upstream to the design phase where fixes are cheaper.
Who is it for?
AI agent developers and security teams
Try it
github.com/microsoft/RAMPART