How praveenk8051/agentic_security works
Project Type and Purpose
• This is a full-stack, open-source vulnerability scanner ("Agentic Security") for AI/LLM workflows.
• Backend: Python package (agentic_security/…) exposing HTTP endpoints (via FastAPI/Uvicorn).
• Frontend: Vue.js Single-Page Application in ui/, served as static assets.
• CLI: Entry-point agentic_security for command-line scanning and CI checks.
• Features: multimodal attacks (text, image, audio), multi-step jailbreaks, fuzzing, RL-based probes, plugin modules, dataset registry.
File Structure Analysis
• Top-level:
• .github/workflows, CI/CD config (Docker build, tests, security scans, releases)
• Dockerfile, .dockerignore, pyproject.toml
• agentic_security/: backend code
• ui/: frontend SPA (Vue, Tailwind CSS)
• docs/: markdown docs and MkDocs config
• tests/, tests/routes/, tests/probe_actor/, etc.
• Backend substructure:
• app.py, core/, routes/, middleware/, agents/, probe_actor/, probe_data/, refusal_classifier/, integrations/, mcp/
• Config & dependencies (config.py, dependencies.py, http_spec.py)
• Static file handlers (routes/static.py) serving frontend assets
• Frontend:
• ui/src/: Vue components (App.vue, page components)
• ui/public/: compiled assets, index.html, telemetry scripts
• Build config: vue.config.js, tailwind.config.js, ESLint, Babel
README Insights
• Defines core use cases: vulnerability probing, dataset extensions, CI integration, CLI usage.
• Lists HTTP spec for LLM calls, custom self-probe endpoints for text/image/audio.
• Shows modular design: dataset registry, dynamic mutation modules (stenography), plugin integrations (Garak, InspectAI, etc.).
• Mentions MCP micro-client (agentic_security/mcp) for service orchestration.
a. Main Components
• Browser (Client-Side SPA)
• Vue.js application (UI components, telemetry scripts)
• API Gateway / HTTP Server
• FastAPI application (agentic_security/app.py) hosted on Uvicorn
• Middleware layers: CORS, logging
• Routers: /probe, /scan, /report, /static, /telemetry, /v1/self-probe
• Scanning Engine / Core Services
• Probe Data Loader (probe_data/): dataset registry, local CSV, HF datasets, dynamic generators
• Probe Actor (probe_actor/): fuzzers, cost modules, stateful multi-step actor, refusal logic
• Agents (agents/): higher-level orchestration classes (operator_crew, operator_pydantic)
• Refusal Classifier (refusal_classifier/): model artifacts for post-processing
• Integrations (integrations/): external tools and libraries (Garak, InspectAI, RL-attacks)
• MCP Client & Server (mcp/): optional microservice orchestrator
• External Services
• LLM Providers (OpenAI API, custom self-probe endpoints)
• Hugging Face Datasets, local CSV storage
• Reporting & Storage
• In-memory or file-based results aggregator (report_chart.py, JSON/CSV)
• CI/CD pipeline integration (GitHub Actions, Docker registry)
• CLI Interface
• Entry point via agentic_security script
• Config loader (agesec.toml), commands: init, ls, ci
b. Relationships and Interactions
• Browser ↔ HTTP Server: REST/HTTP calls for scans, reports, telemetry
• HTTP Server → Scanning Engine: dependency injection launches pipeline
• Scanning Engine ↔ External LLMs: HTTP calls per http_spec for each probe
• Probe Data Loader → Probe Actor: feeds prompts into actor modules
• Probe Actor → Refusal Classifier: decides pass/fail of each response
• MCP Client ↔ MCP Server: optional RPC for distributed scanning
• CLI ↔ Scanning Engine: same code paths as HTTP endpoints for headless scans
• CI/CD Pipeline ↔ CLI: automated security scans during pre-commit or GitHub Actions
c. Architectural Patterns & Principles
• Modular plugin architecture: datasets, actors, integrations register through registries
• Layered design: HTTP layer, service layer, data layer
• Dependency Injection: FastAPI dependencies for config and modules
• Microservice support: MCP sub-system for distributed tasks
• Single-Page Application front/back separation
d. Key Technologies & Frameworks
• Python 3, FastAPI, Uvicorn, Pydantic
• Vue.js, Tailwind CSS, Babel
• Hugging Face Datasets, joblib for model artifacts
• Docker, GitHub Actions, MkDocs