Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 100 additions & 0 deletions .github/workflows/resilience-gate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: Resilience Gate

on:
pull_request:
paths:
- "rogue/injectors/**"
- "rogue/resilience/**"
- "rogue/server/resilience/**"
- "rogue/server/services/resilience*.py"
- "rogue/tests/test_*resilience*"
- "rogue/tests/test_injector*"
- "rogue/tests/test_concurrent*"
workflow_dispatch:
inputs:
min_score:
description: "Minimum overall resilience score (0-100)"
required: false
default: "60"

jobs:
resilience-gate:
runs-on: ubuntu-latest
env:
RESILIENCE_MIN_SCORE: ${{ github.event.inputs.min_score || '60' }}
steps:
- name: Checkout Repository
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
persist-credentials: false

- name: Install uv
uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5

- name: Setup Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with:
python-version-file: ".python-version"

- name: Install dependencies
run: |
uv venv
source .venv/bin/activate
uv sync --dev --group examples
uv pip install -e .
uv pip uninstall rogue-ai-sdk
uv pip install -e sdks/python --force-reinstall

- name: Run resilience test suite
run: |
source .venv/bin/activate
pytest \
rogue/tests/test_injectors.py \
rogue/tests/test_injector_plugins.py \
rogue/tests/test_resilience_metrics.py \
rogue/tests/test_resilience_orchestrator.py \
rogue/tests/test_multi_agent_orchestrator.py \
rogue/tests/test_concurrent_injection.py \
rogue/tests/test_langgraph_checkpoint_adapter.py \
rogue/tests/test_resilience_reporting.py \
rogue/tests/test_resilience_scenarios.py \
-v --junitxml=resilience-gate-results.xml

- name: Run in-process gate against fixture agent
run: |
source .venv/bin/activate
python - <<'PY'
import asyncio
import os
import sys
from pathlib import Path

from rogue.injectors.base_injector import InjectorId
from rogue.resilience.orchestrator import ResilienceOrchestrator

min_score = float(os.environ.get("RESILIENCE_MIN_SCORE", "60"))
agent = Path("rogue/tests/fixtures/resilience_test_agent.py")

async def main() -> None:
orchestrator = ResilienceOrchestrator(
injectors=[InjectorId.POLICY_VIOLATION],
python_entrypoint_file=str(agent),
use_heuristics=True,
)
results = await orchestrator.run_experiments()
score = results.overall_score
print(f"Resilience gate score: {score:.1f} (threshold {min_score:.1f})")
if score < min_score:
print(f"GATE FAILED: score {score:.1f} < {min_score:.1f}", file=sys.stderr)
sys.exit(1)
print("GATE PASSED")

asyncio.run(main())
PY

- name: Upload gate results
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
if: always()
with:
name: resilience-gate-junit
path: resilience-gate-results.xml
52 changes: 49 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ jobs:

steps:
- name: Checkout Repository
uses: actions/checkout@v4
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4

- name: Install uv
uses: astral-sh/setup-uv@v5
uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5

- name: Setup Python
uses: actions/setup-python@v5
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -45,3 +45,49 @@ jobs:
uses: ./.github/actions/run-tests
with:
python-version: ${{ matrix.python-version }}

resilience:
name: Resilience tests
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4

- name: Install uv
uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5

- name: Setup Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with:
python-version-file: ".python-version"

- name: Create venv and install with examples group
run: |
uv venv
source .venv/bin/activate
uv sync --dev --group examples
uv pip install -e .
uv pip uninstall rogue-ai-sdk
uv pip install -e sdks/python --force-reinstall

- name: Run resilience test suite
run: |
source .venv/bin/activate
pytest \
rogue/tests/test_injectors.py \
rogue/tests/test_injector_plugins.py \
rogue/tests/test_resilience_metrics.py \
rogue/tests/test_resilience_orchestrator.py \
rogue/tests/test_multi_agent_orchestrator.py \
rogue/tests/test_concurrent_injection.py \
rogue/tests/test_langgraph_checkpoint_adapter.py \
rogue/tests/test_resilience_reporting.py \
rogue/tests/test_resilience_scenarios.py \
-v --junitxml=resilience-test-results.xml

- name: Upload resilience test results
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
if: always()
with:
name: resilience-junit-results
path: resilience-test-results.xml
64 changes: 57 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Rogue — AI Agent Evaluator & Red Team Platform
# Rogue — AI Agent Evaluator, Red Team & Resilience Platform

![](https://pixel.qualifire.ai/api/record/rogue)

Expand All @@ -8,21 +8,25 @@

![Tests](https://github.com/qualifire-dev/rogue/actions/workflows/test.yml/badge.svg?branch=main)

[![Resilience](https://img.shields.io/badge/Rogue%20Resilience-chaos%20testing-8B5CF6?style=flat-square)](./docs/resilience/README.md)
[![Multi-agent](https://img.shields.io/badge/multi--agent-hierarchical%20%7C%20P2P-3B82F6?style=flat-square)](./docs/resilience/README.md#architecture-profiles)
[![Dashboard](https://img.shields.io/badge/web%20UI-%2Fresilience-10B981?style=flat-square)](./docs/resilience/README.md#dashboard--reporting-phase-3)

<img src="./freddy-rogue.png" width="200"/>

**Stress-test your AI agents before attackers do.**
**Stress-test your AI agents before attackers do — and before internal faults cascade.**

[Discord Community](https://discord.gg/EUfAt7ZDeK) · [Quick Start](#-quick-start) · [Documentation](./docs/)
[Discord Community](https://discord.gg/EUfAt7ZDeK) · [Quick Start](#-quick-start) · [Rogue Resilience](#-rogue-resilience) · [Documentation](./docs/)

</div>

---

## Two Ways to Harden Your Agent
## Three Ways to Harden Your Agent

<table>
<tr>
<td width="50%" valign="top">
<td width="33%" valign="top">

### 🎯 Automatic Evaluation

Expand All @@ -36,7 +40,7 @@ Test your agent against **business policies** and expected behaviors.
**Best for:** Regression testing, behavior validation, policy compliance

</td>
<td width="50%" valign="top">
<td width="33%" valign="top">

### 🔴 Red Teaming

Expand All @@ -49,12 +53,56 @@ Simulate **adversarial attacks** to find security vulnerabilities.

**Best for:** Security audits, penetration testing, compliance reporting

</td>
<td width="33%" valign="top">

### ⚡ Rogue Resilience

Benchmark **internal fault tolerance** when an agent goes rogue.

- 5 fault injectors (tool misuse, policy violation, goal conflict, …)
- Multi-agent architectures (hierarchical, peer-to-peer)
- Detection · containment · recovery · cascade · degradation metrics
- Live trace dashboard + markdown/CSV reports

**Best for:** Multi-agent chaos testing, supervisor/worker resilience, LangGraph recovery

[→ Full Resilience docs](./docs/resilience/README.md)

</td>
</tr>
</table>

---

## ⚡ Rogue Resilience

> **Red Team** tests external attackers. **Resilience** tests internal faults — when a worker agent suddenly misbehaves, can your system detect, contain, and recover?

| Quick link | Description |
|------------|-------------|
| [Resilience README](./docs/resilience/README.md) | Install, examples, metrics, dashboard |
| [Architecture & roadmap](./docs/resilience/PLAN.md) | Full design and phased delivery |
| Web UI | `http://localhost:8000/resilience/configure` (after `uv run rogue-ai web`) |
| CLI | `uv run rogue-ai cli --evaluation-mode resilience --protocol python …` |

```bash
# Start server + dashboard
uv sync --all-groups && uv run rogue-ai web

# Run a chaos experiment from CLI (writes resilience_report.md)
uv run rogue-ai cli \
--evaluation-mode resilience \
--protocol python \
--python-entrypoint-file rogue/tests/fixtures/resilience_test_agent.py \
--injectors policy_violation \
--judge-llm openai/gpt-4o-mini
```

**What's included:** fault injectors · multi-agent profiles · LangGraph checkpoint adapters · REST API · WebSocket live traces · scorecard report with radar chart, timeline, agent graph, and CSV export.

---

## Architecture

Rogue operates on a **client-server architecture** with multiple interfaces:
Expand Down Expand Up @@ -259,7 +307,8 @@ GOOGLE_API_KEY="..."
| 🔄 Dynamic Scenarios | Auto-generate tests from business context |
| 👀 Live Monitoring | Watch agent conversations in real-time |
| 📊 Comprehensive Reports | Markdown, CSV, JSON exports |
| 🔍 Multi-Faceted Testing | Policy compliance + security vulnerabilities |
| 🔍 Multi-Faceted Testing | Policy compliance + security + resilience |
| ⚡ Rogue Resilience | Fault injection, cascade & recovery metrics |
| 🤖 Model Support | OpenAI, Anthropic, Google (via LiteLLM) |
| 🛡️ CVSS Scoring | Industry-standard risk assessment |
| 🔁 Reproducible | Deterministic scans with random seeds |
Expand All @@ -270,6 +319,7 @@ GOOGLE_API_KEY="..."

- **[Quick Reference](./docs/QUICK_REFERENCE.md)** — One-page cheat sheet
- **[Red Team Workflow](./docs/RED_TEAM_WORKFLOW.md)** — Technical deep-dive
- **[Rogue Resilience](./docs/resilience/README.md)** — Chaos testing, dashboard, CLI
- **[Implementation Status](./docs/IMPLEMENTATION_STATUS.md)** — Feature breakdown
- **[Attack Mapping](./docs/ATTACK_VULNERABILITY_MAPPING.md)** — Vulnerability coverage

Expand Down
Loading