Applying F5 WAAP to MCP / AI-agent API traffic. Full project: charter, architecture, a working detection engine (validated against both simulated and real MCP protocol traffic), a multi-agent Claude analysis pipeline, F5 policy artifacts, an expanded precision/recall benchmark, and a live dashboard β all built on top of the same detection engine.
π Read the whitepaper β "Securing the Agentic Attack Surface: An F5 WAAP Governance Framework for MCP and AI-Agent API Traffic." Every number in it is reproducible from the commands in this README.
- 100% recall, 0 false positives across a 36-incident labeled benchmark spanning all 5 detection rules, enforced as a CI gate on every push
- Detection accuracy holds against genuine MCP JSON-RPC protocol traffic (official MCP SDK), not just the synthetic simulator
- Every finding maps 1:1 to a deployable F5 AS3 declaration or iRule β
see
f5-policy-artifacts/ - A 4-agent Claude pipeline (Triage β Root-Cause β Remediation β Report-Writer) triages every CRITICAL/HIGH finding with a logged, auditable reasoning trail
- A live dashboard ties all of the above together β traffic feed, findings, agent reasoning, benchmark trend β in one view
- Traffic flow, live
- Project structure
- Run the dashboard (full stack, recommended)
- Run just the POC (no UI)
- Run the real MCP protocol lab
- Run the multi-agent analysis pipeline
- Run the tests
- Run with Docker Compose
- API reference
- Further reading
Green traffic sails through to the downstream APIs untouched; the gray
mirrored copy is what the WAF layer actually inspects; anything that trips
one of the 5 detection rules turns red and gets diverted into the SIEM β
ticket path instead. This is the same rule engine end to end β POC,
real-MCP lab, benchmark, and dashboard all score traffic through
poc/waf_detection_engine.py unmodified.
agentic-api-security-framework/
βββ PROJECT_CHARTER.md Scope, phases, success metrics
βββ ARCHITECTURE.md System design + traffic flow
βββ assets/ Animated SVG diagrams embedded in this README
βββ poc/ Standalone simulator + detection engine (first-stage signal generator)
β βββ mcp_traffic_simulator.py
β βββ waf_detection_engine.py
β βββ run_demo.py
β βββ tests/ pytest suite (recall + false-positive checks)
β βββ sample_output/
βββ mcp_layer/ Real MCP server/client (official MCP SDK) β genuine JSON-RPC
β β traffic against the unchanged detection engine
β βββ mcp_server.py
β βββ client_agents.py
β βββ run_lab.py
βββ agents/ Multi-agent Claude pipeline
β βββ triage_agent.py Severity/priority + false-positive triage
β βββ root_cause_agent.py Why it happened, with a confidence level
β βββ remediation_agent.py Proposed F5 AS3/iRule diff
β βββ report_writer_agent.py Anonymized incident summary
β βββ ticketing.py GitHub Issues (dry-run by default)
β βββ pipeline.py Chains all of the above; logs the reasoning trail
βββ benchmark/ ~30-incident labeled corpus + precision/recall report
β βββ scenarios.py
β βββ run_benchmark.py
β βββ tests/
βββ backend/ Flask API wrapping the detection engine + agent outputs
β βββ app.py
β βββ data_engine.py
βββ frontend/ Dashboard (vanilla HTML/CSS/JS, Chart.js β vendored, no CDN)
β βββ index.html
β βββ styles.css
β βββ app.js
βββ f5-policy-artifacts/ Real F5 config mapped to each finding
β βββ agentic_api_waf_policy.as3.json
β βββ mcp_traffic_irule.tcl
β βββ README.md
βββ docker-compose.yml backend + frontend + one-shot mcp-lab job
βββ .github/workflows/ci.yml Runs the pytest suites on every push
Requires Python 3.9+.
cd backend
pip install -r requirements.txt
python3 app.pyThen open http://localhost:5050 in a browser.
What you'll see:
- Live traffic feed β a
tail -f-style stream of simulated MCP/agent API events, color-coded by severity - Findings by severity / by rule β donut + bar charts driven by
/api/summary - Findings table β filterable, click any row to expand and see the
OWASP mapping, the F5 control, a ticket status chip, and (if
agents/pipeline.pyhas been run) the full Agent Reasoning trail β Triage β Root-Cause β Remediation β Ticket - Agent risk profile β per-agent risk score derived from finding count
- Detection Benchmark panel β precision/recall/false-positive rate per
rule from the last
benchmark/run_benchmark.pyrun, plus a recall trend sparkline across runs - Re-run simulation β regenerates traffic and re-scores it live, no page reload
The backend serves the frontend directly (same origin, no CORS needed) and
reuses the exact detection logic from poc/waf_detection_engine.py β every
layer below (real MCP traffic, the agent pipeline, the benchmark) runs the
same unmodified rule engine; nothing replaces it.
cd poc
python3 run_demo.py
cat sample_output/detection_report.mdDrives genuine MCP JSON-RPC traffic (official mcp Python SDK, stdio
transport) against a real MCP server, then runs the exact same detection
rules against the resulting log β proving detection isn't an artifact of
the synthetic generator.
pip install mcp
cd mcp_layer
python3 run_lab.py
cat sample_output/mcp_detection_report.mdChains four Claude agents over every CRITICAL/HIGH finding: Triage (severity/priority + false-positive filtering) β Root-Cause (why it happened, with a confidence level) β Remediation (a proposed F5 AS3/iRule diff) β Report-Writer (one anonymized incident summary for the whole batch). Logs every agent's full response β including its thinking/reasoning text β so the dashboard can show a "why the system flagged this" trail per finding.
Requires ANTHROPIC_API_KEY in your environment.
pip install -r agents/requirements.txt
export ANTHROPIC_API_KEY=sk-ant-... # never commit this
python3 agents/pipeline.pyWrites agents/sample_output/reasoning_trail.json (read by the dashboard's
Agent Reasoning panel and ticket status column) and
agents/sample_output/incident_report.md.
Model defaults to claude-sonnet-5; override with AGENT_MODEL.
agents/ticketing.py opens a GitHub Issue for each non-false-positive
CRITICAL/HIGH finding, with the Remediation Agent's proposed fix attached.
Dry-run by default β nothing calls the GitHub API unless you opt in:
export TICKET_DRY_RUN=false
export GITHUB_TOKEN=ghp_...
export GITHUB_REPO=your-org/your-repo
python3 agents/pipeline.py# Original 5-scenario POC suite (recall + false-positive guard)
cd poc && pip install -r requirements-dev.txt && python3 -m pytest tests/ -v
# Expanded ~30-incident benchmark suite (100% recall / 0 FP gate)
python3 -m pytest benchmark/tests -v
# Full precision/recall/false-positive report, per rule, plus OWASP coverage gaps
python3 benchmark/run_benchmark.py
cat benchmark/sample_output/benchmark_report.mdCI (.github/workflows/ci.yml) runs both pytest suites on every push. The
agents/ pipeline isn't in CI since it requires a committed API key β
smoke-test it manually with a real key instead.
docker compose up backend frontend
# One-shot real-MCP-protocol lab job, on demand:
docker compose --profile lab up mcp-labbackend serves the dashboard at :5050; frontend is a standalone
nginx static host of the same UI at :8080 (the backend also serves it
directly β this is for the "frontend as its own service" deployment shape).
Set ANTHROPIC_API_KEY, TICKET_DRY_RUN, GITHUB_TOKEN, GITHUB_REPO in
your shell or a local .env (not committed) before docker compose up if
you want the agent pipeline / real ticketing inside the container.
| Endpoint | Method | Description |
|---|---|---|
/api/health |
GET | Liveness check |
/api/summary |
GET | Counts by severity / rule, agent count |
/api/findings |
GET | All findings; optional ?severity= ?rule= filters |
/api/traffic |
GET | Raw traffic events; optional ?limit= |
/api/agents |
GET | Per-agent event/finding counts + risk score |
/api/simulate |
POST | Regenerate traffic and re-run detection |
/api/reasoning-trail |
GET | Last agents/pipeline.py run's Triage/Root-Cause/Remediation/Ticket trail per finding |
/api/benchmark |
GET | Latest per-rule precision/recall/false-positive results |
/api/benchmark-history |
GET | Overall recall across every benchmark run (trend data) |
| Document | What's in it |
|---|---|
WHITEPAPER.md |
The flagship write-up β problem statement, methodology, validation results, and honest gap list, built on this repo's actual output as evidence |
PROJECT_CHARTER.md |
Scope, phased delivery status, success metrics |
ARCHITECTURE.md |
Component-level design and traffic flow |
f5-policy-artifacts/README.md |
How each detection rule maps to a real AS3/iRule control, plus known deployment gaps |
CONTRIBUTING.md |
Project layout, setup, ground rules for changes |
LICENSE |
MIT |