Repository navigation
data_validation: NER and gitleaks scans, SPDX/BCP 47 checks, NIST AI 100-2 IDs - #95
Merged
Merged
Conversation
…100-2 IDs - gitleaks (8.30.1, checksum-pinned) scans datasets/ and data_validation/ in CI and fails on a finding; the current data has none. - qc_tools/ner_pii_scan.py: Presidio + spaCy name detection in the datasets that require anonymization (person names; also organisations in incident_dataset, whose rules forbid them). Warnings in the CI job summary; proper-name and 85% confidence filters keep it to one false positive on current data, which is in a reviewed allowlist. Optional dependencies in requirements-ner.txt. - validators/metadata_check.py: licence fields must resolve to one SPDX licence (ID, expression or full name); language fields must be BCP 47 tags of registered IANA subtags. Tables from the SPDX License List 3.29.0 (with exceptions) and the IANA Language Subtag Registry (2026-09-17), regenerated by update_reference_data.py and the monthly refresh. - NIST AI 100-2e2025: reference_data/nist_ai_100_2.csv holds its 30 NISTAML identifiers; new optional nist_aml_mapping field in the exploit, vulnerability and agent-trace schemas; crossref_validator rejects unknown NISTAML IDs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| OWASP = list(csv.DictReader(open(REFERENCE_DIR / "owasp_top10.csv", newline="", encoding="utf-8"))) | ||
| LLM_IDS = sorted(r["id"] for r in OWASP if r["list"] == "LLM") | ||
| ASI_IDS = sorted(r["id"] for r in OWASP if r["list"] == "ASI") | ||
| NIST_IDS = [r["id"] for r in csv.DictReader(open(REFERENCE_DIR / "nist_ai_100_2.csv", newline="", encoding="utf-8"))] |
…gnore .pytest_cache Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Items 10–11 of the data-validation review.
Anonymization beyond regex
datasets/anddata_validation/, and fails on a finding. The current data has none: the datasets' synthetic secrets use placeholders, which gitleaks' real-credential rules don't match.qc_tools/ner_pii_scan.py: named-entity recognition with Microsoft Presidio and spaCyen_core_web_sm, run on the datasets whose rules require anonymization. It looks for person names, plus organisation names inincident_dataset, whose README forbids them.reference_data/ner_allowlist.txt). It still catches the fixture's planted "John Smith".requirements-ner.txtso the core checks keep a single dependency.Standard identifiers
validators/metadata_check.py): everylicense/*_licensefield must resolve to exactly one SPDX licence: an ID, an expression (MIT OR Apache-2.0,Apache-2.0 WITH LLVM-exception) or an SPDX full name, optionally followed by its short form. A mismatched pair such as "CC BY 4.0 International (CC BY-SA 4.0)" fails. All 898 licence strings in the data resolve.language/languages/*_languagefield must be a well-formed tag whose subtags are in the IANA registry.*_labelfields are skipped because they copy a source's own label (e.g.tr-en) verbatim.reference_data/nist_ai_100_2.csvholds all 30NISTAML.*identifiers. That's the document's Taxonomy Index plus NISTAML.016/.017, which appear only in §3.4.1. New optionalnist_aml_mappingfield in the exploit, vulnerability and agent-trace schemas, andcrossref_validatorrejects unknown NISTAML IDs.update_reference_data.py, and so the monthly refresh, now also regenerates the SPDX table (3.29.0, 826 licences and exceptions) and the IANA language table (2026-09-17, 8,802 subtags).Verification
run_all_checks.py: 0 errors. gitleaks: no leaks. NER: no findings after the allowlist.actionlintis clean.🤖 Generated with Claude Code