Skip to content
thesid42Public

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Repository files navigation

RedForge

RedForge is an autonomous LLM red-team platform for A10-style AI firewall workflows. It generates adversarial prompts, runs controlled attacks, scores outcomes (blocked, partial, succeeded), analyzes patterns, and produces actionable defense recommendations.

ScreenShots

image image

Features

  • Task-aware scan orchestration with adaptive routing and retry logic
  • Multi-step attack execution against direct or proxied model endpoints
  • Judge-based success classification with canary leakage detection
  • Real-time frontend via Server-Sent Events (SSE)
  • Rule generation and human-approval workflow
  • Structured JSON + Markdown reporting
  • Optional agentic pipeline trigger via deploy hook

Architecture

  • Backend: FastAPI (backend/)
  • Frontend: React + Vite (frontend/)
  • Target LLM: Ollama (target_llm/)
  • Optional WAF/Gateway: APISIX (apisix/)
  • Research/train artifacts: slm/

Prerequisites

  • Python 3.10+
  • Node.js 18+
  • Ollama installed and running
  • Optional: Docker + Docker Compose (for APISIX stack)

Quick Start

1) Backend

cd backend
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env
uvicorn main:app --reload --port 8000

Health check:

curl http://localhost:8000/api/health

2) Frontend

cd frontend
npm install
npm run dev

Frontend API base defaults to http://localhost:8000.

3) Create a local victim model (optional but recommended)

From repo root:

action=setup MODEL_TARGET=acmecorp bash target_llm/setup.sh

Supported values:

  • MODEL_TARGET=acmecorp
  • MODEL_TARGET=novatech
  • MODEL_TARGET=all

Test Ollama endpoint:

curl -s http://localhost:11434/api/generate \
  -H "Content-Type: application/json" \
  -d '{"model":"acmecorp-assistant","prompt":"hello","stream":false}'

Running a Scan

  1. Open the frontend UI.
  2. Set Target URL:
    • Direct Ollama: http://localhost:11434/api/generate
    • APISIX proxy: http://localhost:9080/api/generate
  3. Set Target Model.
  4. Set Attack Count.
  5. Click Start Red Team Scan.

Important behavior: if frontend sends target_model, that value is used for the scan; backend .env TARGET_MODEL is fallback only.

Optional: APISIX WAF Stack

Start APISIX services:

cd apisix
docker compose up -d

Register upstream/routes/plugins:

bash setup_routes.sh

If using root-level compose where Ollama runs in Docker too:

OLLAMA_HOST=ollama bash apisix/setup_routes.sh

Useful endpoints:

  • Gateway: http://localhost:9080
  • Admin API: http://localhost:9180
  • Dashboard: http://localhost:9000

Key API Endpoints

  • GET /api/health
  • POST /api/scan
  • GET /api/attacks/stream
  • POST /api/rules/approve
  • POST /api/rules/nginx-export
  • POST /api/deploy-hook
  • GET /api/agent/pipelines
  • GET /api/agent/reports
  • GET /api/agent/reports/{filename}

Reports

Saved in backend/reports/:

  • redforge-report-*.json
  • redforge-report-*.md
  • redforge-intel-*.md (agentic intelligence brief)

Environment Configuration

Copy backend/.env.example to backend/.env and edit values for your environment.

Most commonly changed fields:

  • TARGET_MODEL
  • ATTACKER_OLLAMA_HOST
  • JUDGE_MODEL
  • DIRECT_TARGET_URL
  • ATTACKER_MODEL_POOL
  • ROUTER_MODE

Troubleshooting

  • Scan failed or empty stream:
    • Confirm backend is running on port 8000.
    • Confirm frontend points to correct API base.
  • model not found:
    • Pull/create model in Ollama and match exact name in Target Model.
  • Unexpected judge scores:
    • Use a stronger judge model and keep judge temperature low.
  • APISIX blocks not visible:
    • Verify scan target URL is :9080 endpoint and routes were bootstrapped.

Safety

Use only in authorized environments for defensive security validation.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages