Status: APPROVED / IN GOVERNANCE
Version: 2.0
Threat Model Scope: Hostile Maintainer, Data Contamination, Dispatch Escalation, Algorithmic Bias
- Physical Operational Safety: Prevent unauthorized, automated, or inadvertent dispatch of excavation crews based on unverified model outputs.
- Mathematical & Causal Integrity: Protect the causal evaluation barrier against label leakage, temporal contamination, and p-hacking.
- Protected-Class Data Privacy: Structurally isolate demographic indicators (race, income) from the predictive model to prevent discriminatory redlining.
- Cryptographic Provenance: Guarantee that all historical decisions, preflight evaluations, and audit logs are tamper-evident and signed.
A core assumption of LeadGuard 2.0 is that a compromised developer, model maintainer, or automated agent may attempt to manipulate metrics, inject future labels, or fabricate attestation signatures to artificially claim high utility.
| Threat ID | Threat Scenario | Architectural Defense |
|---|---|---|
| THREAT-01 | Label Leakage (Future to Past) Injecting future excavation results into training features. |
build_features requires explicit reference_df. Tested via metamorphic pathology test (test_leakage_detector_sensitivity.py). |
| THREAT-02 | Dispatch Escalation Autonomous system generating physical work orders. |
Hard-coded environment gate in /v1/decisions/issue requiring LEADGUARD_PRODUCTION_MODE=true. |
| THREAT-03 | Retrospective Ledger Tampering Modifying historical decision records to hide bad predictions. |
Append-only JSONL ledger with SHA-256 parent hashing forming an auditable merkle chain. |
| THREAT-04 | Demographic Redlining Predicting low lead risk in low-income areas to cut utility costs. |
Runtime column filter strictly prohibiting protected demographic columns from entering the feature matrix. |
| THREAT-05 | Attestation Forgery Faking human auditor approval to unlock Phase S1. |
Cryptographic key ceremony requiring an offline RSA/HMAC signature using keys/human_offline_key.pem. |
+-------------------------------------------------------------------+
| UNTRUSTED EXTERNAL SURFACE |
| Public Ingestion Feeds (Water Inventory CSV, Assessor Open Data) |
+---------------------------------+---------------------------------+
| (Input Validation via Pandera)
v
+-------------------------------------------------------------------+
| TRUSTED ANALYTICAL ZONE |
| Feature Store, XGBoost Engine, Conformal Quantifier |
+---------------------------------+---------------------------------+
| (Physical Column Boundary)
v
+-------------------------------------------------------------------+
| PROTECTED GOVERNANCE ZONE |
| Census Reference (Fairness), Decision Ledger, Cryptographic Keys |
+---------------------------------+---------------------------------+
| (Production Mode Gate: 403 Forbidden)
v
+-------------------------------------------------------------------+
| RESTRICTED FIELD OPERATIONS |
| Physical Excavation Dispatch (Human Authorization Required) |
+-------------------------------------------------------------------+
-
Pandera Schema Validation: All dataframes entering cleaning, feature extraction, and inference must satisfy strict Pandera schemas defining types, allowed categories, and valid ranges (e.g., coordinates within Cook County bounding box: lat
$[41.6, 42.1]$ , lon$[-87.9, -87.5]$ ). - Pydantic HTTP Request Validation: FastAPI endpoints parse JSON payloads into strongly-typed Pydantic schemas, rejecting unexpected attributes and preventing parameter injection.
-
Fail-Closed Verification Scripts: The S0 verification script (
scripts/run_s0_adversarial.py) immediately aborts if any network request is attempted or if artifact hashes differ from the frozen register.
- No Hardcoded Secrets: No API keys, credentials, or private keys are stored in source code.
- Offline Key Ceremony: The private key
keys/human_offline_key.pemis strictly ignored by Git (.gitignore). It is used exclusively in local ceremonies by authorized human auditors to signcontracts/S1_ATTESTATION_RECORD.md. - Pre-commit Hooks: Enforced via
.pre-commit-config.yamlto detect accidental inclusion of private keys, certificates, or credentials.
Before any release candidate or S1 consideration:
- Are all demographic columns completely excluded from
src/leadguard/data/features.py? - Does
/v1/decisions/issuereturn HTTP 403 whenLEADGUARD_PRODUCTION_MODEis unset? - Does
test_leakage_detector_sensitivity.pysuccessfully detect deliberate label leakage? - Is
keys/human_offline_key.pemexcluded from version control? - Are all dependencies checked against known CVEs via safety/pip-audit?
- Has the decision ledger maintained continuous hash chain integrity?