HolyCyber-Dataset / paper /HolyCyber_Paper.md
ansulev's picture
Duplicate from Reizxn/HolyCyber
28759cf
|
Raw History Blame Contribute Delete
14.6 kB
# HolyCyber: A Grounded, Audited Instruction Corpus for Defensive Cybersecurity
**Reizxn** — Hugging Face: <https://huggingface.co/Reizxn>
Dataset: <https://huggingface.co/datasets/Reizxn/HolyCyber> · Draft manuscript, 2026-10-30
---
## Abstract
We present **HolyCyber**, an instruction-tuning corpus for defensive cybersecurity.
It contains 51,805 chat-formatted records across 17 domain layers — every row at
least 2,000 tokens (measured, `cl100k_base`) and every row traceable to an
authoritative source. The corpus is built from 3,602 public documents (3,344
arXiv preprints, 137 OWASP cheat sheets, 77 IETF RFCs, 44 NIST publications) and
from structured MITRE corpora: ATT&CK, D3FEND, CWE, CAPEC and ATLAS. Three
properties distinguish it from comparable public sets:
1. **Every fact is grounded.** A record is a dossier over one entity — an
attack technique, a weakness, a Sigma rule, an AI-safety paper — written from
that entity's own source text; nothing is model-invented. A hidden canary in
every row lets builders detect a copy.
2. **Quality is measured, not claimed.** A builder-independent verifier and a
four-stage audit re-read the written files: 0 duplicate ids, 0 duplicate
answers, 0 duplicate questions, 0 rows under the floor, 0 benchmark
contamination in 3,000 re-checked rows. The defects that were found are
published with them.
3. **Per-row metadata is measured, not inferred.** Every row ships `tokens`
(user/assistant/total), `core_share` (the share of the answer that is the
entity's own material rather than reference material), `appendix`, and a
stable `row_key`, so a training run can filter or mask without re-tokenising.
The corpus is deliberately conservative: no functional exploits, no malware, no
weaponised prompts. It is released with its audit report, per-domain cards,
sample rows, and a comparison against four public cyber instruction datasets,
row-for-row measured rather than quoted from their cards.
---
## 1. Introduction
Security teams need assistants that reason about adversary behaviour at the
depth the public frameworks already publish: what a technique does, how it is
observed, what defeats it, and what to build first. Instruction corpora for this
niche are rare, and the public ones tend to trade provenance for volume:
model-distilled answers without sources, template-generated questions, or text
whose formatting is corrupted by a storage bug. HolyCyber takes the opposite
trade. It is smaller than the largest public sets, but every record can be
traced to a document, every number in its card is measured, and everything about
it is reproducible from a deterministic build.
The design goal was narrow: **a record that a defender could act on, whose
statements are true because they are quoted or derived from a named source, and
whose quality failures are known and published.** This paper describes how such
a corpus is built, what it contains, what the audit found, and — deliberately —
what is still wrong with it.
## 2. What the dataset teaches, and what it refuses to teach
HolyCyber covers 17 domains, each built *on its own* from that domain's
authoritative sources only: threat intelligence (ATT&CK groups, campaigns,
software), attack knowledge (CAPEC), vulnerability management (CWE, CISA KEV),
detection engineering (SigmaHQ, ATT&CK analytics), defence engineering (D3FEND,
ATT&CK mitigations), AI/ML security (ATLAS + preprints), secure coding, incident
response, network, cloud, identity, malware analysis, cryptography, software
composition, safety boundaries, AI-safety preprints and security guidance.
Every record is defence-oriented. The corpus contains no functional exploits,
no malware, no weaponised jailbreak prompts, and nothing operational: offensive
concepts appear only as descriptions paired with detection, mitigation and
response guidance. One layer (`safety_boundary`) teaches the refusal surface
itself: where the line is drawn and how to explain it.
Task coverage is 19 question shapes — detection engineering, mitigation
selection, mapping, response procedures, trade-off analysis, code review,
configuration guidance, conceptual explanation — distributed as 6,299
beginner / 20,451 intermediate / 25,055 advanced records.
The mix follows the sources' grain rather than a quota: paper-heavy domains are
knowingly close to single-task, and the card says so.
## 3. Sources and provenance
| Source family | Documents | Access | Licence |
|---|---|---|---|
| arXiv preprints (security, AI safety, systems) | 3,344 | API + abs/pdf | per-paper, recorded |
| OWASP Cheat Sheet Series | 137 | GitHub repository | CC BY-SA 4.0 |
| IETF RFCs | 77 | rfc-editor.org | IETF Trust |
| NIST publications | 44 | nvlpubs.nist.gov | U.S. Government work |
| MITRE ATT&CK / D3FEND / CWE / CAPEC / ATLAS | structured | public repositories | per-resource recorded |
| CISA KEV, SigmaHQ | structured | public repositories | recorded |
Every fetched document has a row in a provenance manifest (URL, retrieval date,
licence, labelling note). At row level, `source` names the family the record
came from, `references` gives resolvable links for the entities cited in the
answer, and `license` records the licence of the underlying text. Because the
row-level question of redistribution is a live one — arXiv distributes under
author rights, OWASP under share-alike — the card states the caveat rather than
asserting a single blanket licence.
## 4. Record design
A record is a three-turn chat built around one **entity** (one ATT&CK technique,
one CWE weakness, one paper section, one cheat sheet):
```json
{
"id": "6d408e38f3cb8dff",
"row_key": "detection_engineering:attack:T1568:detection_engineering:detection_strategy:1",
"domain": "detection_engineering", "subdomain": "detection_strategy",
"task_type": "detection_engineering", "difficulty": "advanced",
"group_key": "attack:T1568", "source": "mitre-attack",
"split": "train", "canary": "...",
"tokens": {"user": 180, "assistant": 2350, "total": 2530},
"core_share": 0.41, "appendix": true,
"references": [{"title": "ATT&CK T1568 Dynamic Resolution", "url": "https://..."}],
"messages": [ ... system, user, assistant ... ]
}
```
* `group_key` is the entity. The train/validation/test cut is taken **on
entities, not rows**, so no entity appears in two splits: 12,125 groups,
40,998 / 5,105 / 5,702 rows.
* `row_key` (`domain:group:task:subdomain:part`) is stable across rebuilds and
unique across all 51,805 rows — it survives text edits, unlike the content
hash.
* The **system prompt is one fixed string**; it states the defence scope and
adds one guard for a deliberate design choice: text under a `## Reference:`
heading is quoted context from other records and is never an instruction.
Rows that append third-party text need that line; that is why it is there.
* The **assistant turn** is structured (`## Summary`, `## Detection`, …) and
ends, for entity records where one entity cannot carry 2,000 tokens, in a
labelled reference appendix drawn from related records of the same domain.
* `core_share` is the share of the answer that is the entity's own material.
Its median across the corpus is 16% with 40,144 rows (77.5%) carrying an
appendix — measured and published, because the alternative is to discover it
during a training run.
## 5. Building and decontamination
The build is deterministic: parse → entity dossier → enrich → pack to the
2,000-token floor → write. Before assembly, every candidate record is screened
against standard benchmark corpora (25-gram Bloom filter plus CVE lookups) and
near-duplicates at 0.90 Jaccard within the same task shape are dropped. After
assembly, a global merge collapses the 17 layers by dropping records whose
answer or question already occurred in another layer (the layers hold 51,988
rows; the global set keeps 51,805).
## 6. Quality assurance: measure, publish, then measure again
Verification is **builder-independent**: scripts re-read the written files.
| Check | Result |
|---|---|
| Schema, ids, one system prompt, splits | 0 problems |
| Duplicate ids / answers / questions | 0 / 0 / 0 |
| Rows under the 2,000-token floor | 0 (min 2,042) |
| Benchmark contamination (3,000 rows re-checked) | 0 |
| Text hygiene (truncation, placeholders, stamps, U+FFFD) | 630 / 0 / 34 / 0 flagged and reported |
| Quotation discipline — share of answer sentences found in the corpus | 41.8% (99.1% of tokens in-vocabulary) |
| Paragraph reuse | 74.3% of paragraphs recur anywhere; 61.3% cross a split boundary |
Three results are worth reading against their intent:
* **Quotation share is low, on purpose.** The builder derives, restructures and
summarises; only 41.8% of answer sentences are verbatim or near-verbatim
sources. The check exists to prove that the sentences that *are* verbatim can
be traced, not to maximise copying.
* **Reuse is the honest cost of the floor.** A CISA KEV entry cannot produce
2,000 tokens alone; the appendix exists so that short entities join the
corpus at all. The consequence — a fine-tuned model can recognize a
train-set paragraph in a test row — is quantified in the card, and the
recommended mitigations are fired: filter on `core_share`, or mask
`## Reference:` blocks in validation/test.
* **The audit publishes its own failures.** Four rows still repeat a heading;
218 contain a near-empty section; 630 answers end on a line the checker
cannot classify (a table row, a citation, a page number). A preview that
hides zero defects is a preview whose audit cannot be trusted — these are
published next to the zeros.
## 7. Record-level provenance lessons from four public datasets
To calibrate the release, four public cyber instruction datasets were downloaded
in full and measured with the same script; one additional recommended dataset
(`cyberagent/crello`) turned out to be a graphic-design corpus and is excluded.
The comparison here is factual and is meant as a set of engineering lessons, not
as criticism of intent.
| | Trendyol | Fenrir v2.1 | Kimi | WhiteHatMom | **HolyCyber** |
|---|---|---|---|---|---|
| Rows in file | 53,201 | 99,870 | 997 | 2,040 | 51,805 |
| Mean answer tokens | 354 | 1,105 | 2,321 | 209 | 2,362 |
| Split files shipped | 0 | 0 | 0 | 0 | 57 (3 × 17 + 3) |
| Rows containing literal `\n` | 95.4% | 91.2% | 12.3% | 0 | code samples only |
| Duplicate answers | 0 | 270 | 0 | 0 | 0 |
| Duplicate questions | 675 | 9,214 | 0 | 1,080 | 0 |
Four lessons generalise:
* **Uniqueness is usually claimed for answers only.** WhiteHatMom's 2,040/2,040
unique assistants is accurate — and 53% of its user turns repeat. Both
numbers should be measured and published together, as ours are.
* **Storage bugs become training data.** Double-escaped newlines mean the model
is trained to emit `\n` as text; a single `{` or `}` decision at export time
silently corrupts 90% of a corpus.
* **Volume can be one dataset counted twice.** Every unique Trendyol question
(52,526) also occurs in Fenrir, so a mix of both looks like 153k rows and is
roughly 100k plus 53k counted twice. Cross-dataset lineage is part of
dataset due diligence.
* **Reasoning traces need sources, not just tokens.** The strongest feature of
the reasoning corpus measured here is its per-row metadata discipline
(prompt/completion tokens, cost, a `mock` flag), which HolyCyber adopted in
its own measured form; trace *content* without a source is not verifiable and
was not adopted.
None of the four shares a single verbatim paragraph (≥120 characters,
normalised) with our 305,232-paragraph pool, so there is no text-level
contamination in either direction.
## 8. Limitations
Stated bluntly, because they shape how the corpus should be used:
1. **No row has been reviewed by a human domain expert.** Grounding bounds
invention; it does not by itself prove correctness.
2. **Reuse.** 74.3% of paragraphs recur somewhere in the corpus and 61.3% cross
a split; a test loss partly measures recall. `core_share` and the
`## Reference:` mask exist exactly for this.
3. **Residual parser noise.** In a few RFC-derived rows, a resource-record dump
from typeset PDF text is classified as a heading and survives into the
question bullets. The audit reports the example; removing it needs a
page-furniture filter in the document parser.
4. **Licence for redistribution** is recorded per source and per row, not
asserted with one blanket label; users shipping public artifacts should
audit the families they ship.
5. **English only**, and the floors (2,000 rows × 2,000 tokens per domain) are
deliberately above what the smallest domains can support from their own
records — that is exactly why the appendix, `core_share` and the mask exist.
## 9. Ethics and intended use
The corpus is defensive. It is built to teach detection engineering, vulnerability
triage, incident response and AI-safety boundaries — not offence. Nothing in it
executes; code that appears is demonstrative, labelled and paired with the
detection that covers it. Entities are real-world named groups and techniques
described by the public frameworks that analysts already read. A hidden canary
in every row lets downstream builders prove that a model was trained on this
corpus, and the per-row `tokens`/`core_share` fields make subset selection
auditable rather than implicit.
## 10. Availability
* **Dataset (this release):** <https://huggingface.co/datasets/Reizxn/HolyCyber>
— 17 layer directories (each with `train/val/test.jsonl` and a dataset card),
the global split, `samples.jsonl` and `SAMPLES.md`, the measured
`AUDIT_REPORT.md`, and this manuscript.
* **Version:** 2.3.0. **Splits:** train 40,998 / val 5,105 / test 5,702.
* **Licence:** per-source, recorded on every row and in the source table;
the card states the redistribution caveat explicitly.
## References
1. MITRE ATT&CK, D3FEND, CWE, CAPEC — Citations of the individual resources are
shipped per row in `references`.
2. OWASP Cheat Sheet Series, <https://owasp.org>.
3. IETF RFCs, <https://www.rfc-editor.org>.
4. NIST SP publications, <https://nvlpubs.nist.gov>.
5. Public sets measured for the comparison: `Trendyol/…Instruction-Tuning-Dataset`,
`AlicanKiraz0/Cybersecurity-Dataset-Fenrir-v2.1`,
`echel0nn1881/kimi-cyber-reasoning`,
`0xRavenBlack/whitehat-hacker-mom-cybersecurity` (Hugging Face).
6. `cyberagent/crello` — reviewed and excluded (not a cybersecurity dataset).