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
Metadata
Release files for ccs-response-planner-backend 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ccs_response_planner_backend-0.0.3.tar.gz | 352.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ccs_response_planner_backend-0.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 694.6 kB
Release files / ccs_response_planner_backend-0.0.3.tar.gz
| Download URL | ccs_response_planner_backend-0.0.3.tar.gz |
|---|---|
| Size | 352.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bbdd26f472c8d25d07f53af8ddaea43c1d900ca46c1d02e9da7a7634c79ed99e
|
|
BLAKE2b-256 checksum How to use checksums |
653397560b26a6e61c0e71d049a768324a7642258dae08e3feced00af64e7cf4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.13
|
Release files / ccs_response_planner_backend-0.0.3-py3-none-any.whl
| Download URL | ccs_response_planner_backend-0.0.3-py3-none-any.whl |
|---|---|
| Size | 342.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4826fe7c6ffa67e322aee304aed0c874f669f3d954f3549a616af873d6724edc
|
|
BLAKE2b-256 checksum How to use checksums |
3d328de7a1080a77c57687ec167c34d855944b3159db3215e678e6d0fb311654
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.13
|