Doc-foundry – AI writes Security detection rules, then proves they work DOC-foundry, an open-source detection-engineering project, generates Sigma security detection rules from threat inputs such as CVE entries, CISA KEV listings and ATT&CK techniques, then validates each rule through a Blue-vs-Red adversarial loop and ships it with a proof bundle containing a positive corpus, a benign baseline, an adversarial mutation set and a computed coverage label of real-coverage, brittle or broken with FP/FN numbers and a reproducibility hash. Four role-specialized LLM agents (Threat Analyst, Blue Detection Engineer, Telemetry and Red-Team Adversary) do the authoring, while a deterministic referee handles FP/FN evaluation, adversarial evasion, the coverage verdict and the deployment gate so that, per the project, "Same input → same verdict → same reproducibility hash." The project ships a live example run on a CISA KEV entry that produced three rule versions and eight reviewer findings, and runs offline via `python src/run.py --evals` on the standard library alone. Turn a threat a CVE, a CISA KEV entry, an incident writeup, an ATT&CK technique into a validated first-version detection — a proven starting point a detection team hardens further, not a claim of finished, forever-bulletproof coverage — plus three artifacts that ship together : 1. a Sigma detection rule that has survived a Blue-vs-Red adversarial loop, 2. a threat report with the round-by-round convergence history , and 3. a proof bundle — a positive corpus the rule fires on, a benign baseline it stays silent on, an adversarial mutation set, and a computed coverage label real-coverage / brittle / broken with FP/FN numbers and a reproducibility hash. The thing nobody else produces is 3. A model can write you a Sigma rule; it cannot hand you a proof that the rule works, an adversary that provably evades the weak version, and an honest record of how the rule was hardened until it held. A bounded, fixed adversary. Red commits to two real, documented attacks in round one and re-throws those same two against the hardened rule each round — the same "built once, can't move its goalposts" discipline as the fixed test corpus. real-coverage therefore means something concrete and honest: the first-version rule fires on every attack in the corpus, stays silent on benign look-alikes, and caught both of Red's real attacks. It is a validated baseline, not a promise of coverage against every future evasion — that is the detection team's job to extend. Agents propose; the engine proves. Four role-specialized LLM agents Threat Analyst, Blue Detection Engineer, Telemetry, Red-Team Adversary do the creative work. Everything that decides truth — FP/FN evaluation, adversarial evasion, the coverage verdict, red-team verification, and the deployment gate — is a deterministic referee. Same input → same verdict → same reproducibility hash. Two pipelines share this agent cast. The one described above proves — Blue authors, Red attacks, a deterministic referee decides. The Review Chain reviews — draft → Red Team → revision → SOC Lead → final rule, with every note that shaped it. Different question, different deliverable; pick per what you need. 📄 See real output first: examples/joomla-icagenda-cve-2026-48939/review-history.md https://github.com/mjha-arya/DOC-foundry/blob/main/examples/joomla-icagenda-cve-2026-48939/review-history.md — a live run on a CISA KEV entry, three rule versions, eight reviewer findings. pip install -r requirements.txt or just run --evals on stdlib alone LIVE — any threat text; a real model authors it needs GEMINI API KEY or ANTHROPIC API KEY python src/run.py "CVE-2026-45659 SharePoint deserialization RCE" python src/run.py "T1218.011 rundll32 remote scriptlet execution via mshtml" CANNED — a fixture scenario, fully offline, no key what the test suite drives python src/run.py --threat fixtures/certutil t1105.json brittle→repair→proven python src/run.py --corpus atomic positives from REAL Atomic Red Team commands python src/run.py --max-rounds 3 self-repair loop cap default 3 python src/run.py --evals deterministic engine + proof + workflow tests python src/run.py --approve alice human approves → gated deploy succeeds python src/run.py --claude "..." force claude-opus-4-8 authoring ANTHROPIC API KEY python src/run.py --gemini "..." force Gemini authoring GEMINI API KEY There is no default scenario — the Foundry takes the threat you give it. A bare python src/run.py has nothing to work on and says so. Bundles are written to Outputs/