# Microsoft Open-Sources RAMPART and Clarity — A Pytest-Native Red-Teaming Framework for AI Agents and a Pre-Code Design Sounding Board

> Two open-source tools that bake agent red-teaming and design review into the development workflow.

- Org: Microsoft
- Date: 2026-05-20
- Category: security, tool, repo
- Source: https://www.microsoft.com/en-us/security/blog/2026/05/20/introducing-rampart-and-clarity-open-source-tools-to-bring-safety-into-agent-development-workflow/
- Canonical page: https://ai-tldr.dev/releases/microsoft-rampart-clarity/

## In short

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.

## What it is

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 it works

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 it matters

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 it's for

AI agent developers and security teams

## Try it

github.com/microsoft/RAMPART

## Links

- [Announcement](https://www.microsoft.com/en-us/security/blog/2026/05/20/introducing-rampart-and-clarity-open-source-tools-to-bring-safety-into-agent-development-workflow/)
- [RAMPART Repo](https://github.com/microsoft/RAMPART)
- [Clarity Repo](https://github.com/microsoft/clarity-agent)
- [RAMPART Docs](https://microsoft.github.io/RAMPART/)
