Universal ESG risk detection agent for natural resources: timber 🌲, amber 💎, ore ⛏️ — and extensible to any resource type.
Part of the AuditorSEC Initiative ecosystem. Implements the UHIP-2A Resource Integrity module for reconstruction risk analytics.
- Hack pattern detection: identifies misclassified shipments (e.g. roundwood smuggled as "firewood", raw amber as "scrap")
- Multi-resource rules engine: pluggable
RESOURCE_RULESconfig per resource type - ESG risk profiling: per-enterprise risk scores (LOW / MEDIUM / HIGH / CRITICAL)
- React dashboard: maps, pie charts, shipment tables, PDF export
- Grafana integration: real-time Prometheus metrics for all resource types
- n8n workflow: YouTube/RSS → LLM summaries → NATS events → ESG agent
agents/resource_esg/
├── models.py # SQLAlchemy: ResourceShipment, EsgResourceRiskProfile
├── service.py # RESOURCE_RULES engine + classify_shipment()
├── api.py # FastAPI endpoints
├── ui/ # React dashboard (maps, charts, reports)
├── grafana/ # Grafana dashboard.json (multi-resource metrics)
├── k8s/ # Helm charts for Kubernetes deployment
├── tests/
│ └── multi_resource.csv # Test data: timber/amber/ore
├── deploy.sh # One-command production deploy
└── README.md
git clone https://github.com/AuditorSEC-Initiative/resource-esg-agent
cd resource-esg-agent
# Install backend deps
pip install fastapi sqlalchemy psycopg2-binary uvicorn
# Start API
uvicorn agents.resource_esg.api:app --reload
# Load test data
python load_test_data.py
# Or full production deploy
bash deploy.shRESOURCE_RULES = {
"timber": {
"hack_patterns": {"firewood": [(1.8, 2.6, "roundwood")]},
"critical_species": {"бук", "модрина"}
},
"amber": {
"hack_patterns": {"scrap": [(0.1, 50, "raw_amber")]},
"export_limit_kg": 1000
},
"ore": {
"hack_patterns": {"construction_sand": [(1000, 5000, "strategic_ore")]},
"critical_species": {"titanium", "lithium"}
}
}Add new resource types by extending RESOURCE_RULES — no code changes needed.
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/v1/esg/resource/{enterprise_id}/{period} |
ESG risk profile |
| GET | /api/v1/esg/resource/{enterprise_id}/shipments |
Shipment list (filterable by resource_type) |
| POST | /api/v1/esg/resource/shipments |
Ingest new shipment |
| GET | /api/v1/esg/resource/metrics |
Prometheus metrics |
Import grafana/dashboard.json into your Grafana instance.
Panels:
- Risks by Resource Type — pie/bar per timber/amber/ore
- Hack Detection Rate — time series over 24h
- Enterprise Risk Heatmap
- Variable filter:
resource_type(multi-select)
YouTube RSS → summaries-fuel LLM →
if "ліс|янтарь|деревина" detected →
NATS event: resource_shipment.created →
ResourceESGAgent → ESG profile → alert → PDF report
Connects to:
auditorsec-summaries-fuel-mvp— LLM narrative pipelineauditorsec-llm-bridge— AI audit reasoningbachmach-pqc-iot-sentinel— IoT telemetrydabroiotexs-dao-decentralization— DAO governance
- UHIP-2A: Resource Integrity module for reconstruction risk
- MaJoR EDF: Dual-use resource monitoring (timber/amber in conflict zones)
- EU Horizon Europe: ESG compliance infrastructure
- Gitcoin Grants: Public goods — open ESG data for Ukraine
- BRAVE1: Defense-civilian resource integrity tool
See CONTRIBUTING.md. PRs for new resource types, detection rules, UI features always welcome.
See SECURITY.md.
MIT — see LICENSE.
Built in Bakhmach, Chernihiv oblast 🇺🇦 — AuditorSEC Initiative