How aisecurityconsortium/aigoat works
AIGoat is a deliberately vulnerable AI security playground: learners exercise attacks against a local AI shopping application, observe outcomes, and compare defense levels. The main path is browser UI → FastAPI routes → a chat, RAG, agent, MCP, challenge, or kill-chain surface → LLM and application state, with defenses applied at relevant stages. The README documents the product capabilities; source evidence is sampled, so links into unsampled subsystems are limited to documented relationships or omitted.
Main entry points: main.py FastAPI app · rag.py RAG routes · mcp.py MCP routes · pipeline.py Defense pipeline
Components 22
Learning experience
- Learning UI
frontend/src/App.js - RAG lab UI
frontend/src/components/rag/RagDocuments.jsx - MCP lab UI
frontend/src/components/mcp/McpClientGuide.jsx - Kill Chain UI
frontend/src/components/killchain/useKillChain.js
Attack surfaces
- Cracky chat
app/api/chat.py - RAG knowledge base
app/rag/service.py - Shop agent
app/agent/service.py - MCP surface
app/mcp/service.py - RAG routes
app/api/rag.py - MCP routes
app/api/mcp.py
Defense system
- Defense pipeline
app/defense/pipeline.py - Control chain
app/defense/chain.py - Defense controls
app/defense/control.py
Labs and evaluation
- Kill Chain
app/labs/killchain/service.py - Attack ingestion
app/labs/killchain/ingest.py - CTF challenges
app/challenges/engine.py - Challenge evaluation
app/challenges/evaluator.py
Application platform
- FastAPI app
app/main.py - Ollama client
app/services/ollama_client.py - Application database
app/core/database.py
Other components
- Learner
- Ollama runtime
Connections 24
- Learner → Learning UI: uses
README.md - Learning UI → FastAPI app: calls API
README.md - FastAPI app → Cracky chat: routes requests
app/main.py - FastAPI app → RAG routes: routes requests
app/main.py - FastAPI app → MCP routes: routes requests
app/main.py - FastAPI app → Shop agent: offers agent
README.md - FastAPI app → Kill Chain: offers capstone
README.md - FastAPI app → CTF challenges: offers challenges
README.md - RAG routes → RAG knowledge base: delegates to
app/api/rag.py - MCP routes → MCP surface: delegates to
app/api/mcp.py - Cracky chat → Defense pipeline: applies defenses
- RAG knowledge base → Defense pipeline: applies defenses
app/rag/service.py - MCP surface → Control chain: runs controls
app/mcp/service.py - Defense pipeline → Control chain: runs chain
app/defense/pipeline.py - Control chain → Defense controls: resolves controls
app/defense/chain.py - Shop agent → Ollama client: uses LLM
app/agent/service.py - Ollama client → Ollama runtime: sends prompts
app/services/ollama_client.py - RAG routes → Application database: reads and writes
app/api/rag.py - Kill Chain → Attack ingestion: uses ingestion
app/labs/killchain/service.py - Attack ingestion → Application database: persists sources
app/labs/killchain/ingest.py - CTF challenges → Challenge evaluation: evaluates attempts
- RAG lab UI → RAG routes: manages documents
- MCP lab UI → MCP routes: uses MCP labs
- Kill Chain UI → FastAPI app: drives capstone