Overview
A local-only investigation pipeline built in five days to help a friend being stalked: it organizes open-source intelligence to evidence standards — provenance manifests on every finding, fail-closed network defaults, and an attribution scoring model — and produces a report a detective can act on. 140 commits; ~22,000 lines, 44% of it tests.
Project Design
The design document was audited against the actual tools it would orchestrate before any code existed — the audit found five build-breaking errors and three architectural defects, and every finding became an enforced rule rather than a recommendation. Validation was the live case itself: the first real run happened four and a half hours after the first commit, and 24 runs over five days drove every redesign.
Security & ops decisions
- Chain of custody as code: every tool run writes an append-only manifest — exact version, full command line, operator, UTC timestamps, output hash — and finished outputs are made OS-level immutable.
- Capabilities that could tip off a subject are dual-gated: the riskiest tool runs only if two settings flip, and the skip reason is recorded so the report shows why.
- Egress control is enforced per tool wrapper and fails closed: if the proxy is enabled but unconfigured, the pipeline refuses to connect rather than going direct.
- Breach-check passwords are HMAC-hashed on receipt with a per-case ephemeral key that never persists beyond the run.
- False attribution is engineered against: existence confidence and attribution strength are scored separately, with negative graph weights for mismatched evidence.
Builder notes
- Every OSINT tool runs in its own isolated environment and the orchestrator only shells out to binaries — conflicting dependency pins were an audit finding, not a hypothetical.
- Stage-two runtime had a numeric SLO (under 15 minutes), hit by tuning to six scanner batches, 80 concurrent validators, and 25 avatar workers.
- Every wrapper logs command line, exit code, parse counts, and data freshness — silent tool failures were the postmortem's biggest finding.
- The design doc was audited against the actual tools it would orchestrate before any code was written; each finding became an enforced rule, catching five install-breaking errors early.
Lessons learned
- “Confidence” must mean attribution — does this actually belong to the subject? — not tool health. Conflating the two flooded early results with false positives.
- Victim safety precedes investigation, structurally: the hardening playbook for the person at risk runs before any investigative stage can.
- Restraint can be architecture: nothing behind a login is touched — the tool generates guidance for law enforcement requests instead — and anything that could tip off the subject is off by default, with its use recorded.
- Wrapping an unmaintained open-source tool means becoming its maintainer: one tool needed six fixes in 36 hours.
What carried forward
The audit-the-design-before-building gate and the fail-closed posture. The repository itself stays private, permanently — it contains a real case.