Backend for an LLM-based incident response planner
Project description
CCS Response Planner Backend
Python backend for the CCS Incident Response Planner. Provides a Flask REST API, a multi-agent system for incident response planning, external security tool integrations, and a digital twin manager.
Architecture
The backend source lives under src/ccs_response_planner_backend/:
rest_api/— Flask app factory (create_app) with route blueprints for all API endpointsagents/— Multi-agent orchestration system with 10 specialized agent typesdb/—DatabaseFacadefor PostgreSQL operations (users, tokens, sessions, reports, incidents)planner/— Incident response planner core logic with plan generationdocker_manager/— Digital twin deployment and management (Docker container orchestration)constants/— Shared constants including API routes, database config, and example incidents
Agents
The multi-agent system coordinates 10 specialized agents:
| Agent | Role |
|---|---|
orchestrator |
Master coordinator that delegates tasks to other agents |
plan_manager |
Orchestrates response plan management |
report |
Generates incident reports from analysis |
report_manager |
Manages report generation workflow |
report_verifier |
Verifies generated reports for accuracy |
code |
Generates remediation code |
code_manager |
Manages code generation workflow |
code_verifier |
Verifies generated code for quality and safety |
plan_verifier |
Verifies response plans on the digital twin |
rl |
Reinforcement learning agent for policy optimization |
External Integrations
The backend integrates with 6 external security APIs:
| Service | Description |
|---|---|
| Tavily | Web search and reconnaissance |
| NVD | NIST National Vulnerability Database |
| MITRE ATT&CK | Adversary tactics, techniques, and procedures |
| VirusTotal | File and URL malware scanning |
| AbuseIPDB | IP reputation checking |
| AlienVault OTX | Open Threat Exchange intelligence |
Database
PostgreSQL via DatabaseFacade (static-method facade). The schema has 6 tables:
management_users— User credentials with bcrypt password hashingsession_tokens— Bearer tokens for authenticated sessionsexample_incidents— Pre-configured incident scenariosdigital_twin_configs— Docker network and container configurations (JSONB)agent_reports— Records of agent analysis and actions (JSONB)planning_sessions— User session state for incident response planning (JSONB)
Environment Variables
A .env file is required at the project root. Copy from ../.env.example and fill in your credentials. See the root README for the full variable list.
Development (Native)
pip install -e ".[test]"
pytest --cov=ccs_response_planner_backend
flake8 src tests
mypy src
tox # Run all checks (pytest + flake8 + mypy)
Agent Integration Tests
The agent integration tests exercise the full agent loop with real LLM calls (Gemini). They are excluded from the regular unit test suite and run separately:
# From the project root:
./agent_tests.sh # All agent tests (needs GEMINI_API_KEY + Docker)
./agent_tests.sh --no-docker # Skip tests that require a Docker daemon
Requires GEMINI_API_KEY in the root .env file. Tests marked @pytest.mark.docker also need a running Docker daemon.
Development (Docker)
From the project root:
docker compose up --build
docker compose exec app bash -c "cd ccs-response-planner-backend && pytest --cov=ccs_response_planner_backend"
docker compose exec app bash -c "cd ccs-response-planner-backend && flake8 src tests"
docker compose exec app bash -c "cd ccs-response-planner-backend && mypy src"
Author & Maintainer
Kim Hammar kimham@kth.se
Copyright and license
Creative Commons
(C) 2026, Kim Hammar, Tansu Alpcan, Emil Lupu
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ccs_response_planner_backend-0.0.3.tar.gz.
File metadata
- Download URL: ccs_response_planner_backend-0.0.3.tar.gz
- Upload date:
- Size: 352.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bbdd26f472c8d25d07f53af8ddaea43c1d900ca46c1d02e9da7a7634c79ed99e
|
|
| MD5 |
da2de565668675c6b19d58b9de95fb16
|
|
| BLAKE2b-256 |
653397560b26a6e61c0e71d049a768324a7642258dae08e3feced00af64e7cf4
|
File details
Details for the file ccs_response_planner_backend-0.0.3-py3-none-any.whl.
File metadata
- Download URL: ccs_response_planner_backend-0.0.3-py3-none-any.whl
- Upload date:
- Size: 342.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4826fe7c6ffa67e322aee304aed0c874f669f3d954f3549a616af873d6724edc
|
|
| MD5 |
2ee391164b50e5c4f609c296c38d0e78
|
|
| BLAKE2b-256 |
3d328de7a1080a77c57687ec167c34d855944b3159db3215e678e6d0fb311654
|