legal-red-team
Adversarial verification for AI-generated legal content. Use when fact-checking legal documents, validating citations, detecting hallucinations, scoring document quality, or assessing distribution readiness.
What this skill does
> **⚠️ EXPERIMENTAL** — This skill is provided for educational and informational purposes only. It does NOT constitute legal advice. All responsibility for usage rests with the user. Consult qualified legal professionals before acting on any output. # Legal Red Team Production-ready adversarial verification framework for AI-generated legal content. Covers factual accuracy, citation validation, arithmetic checking, speculation detection, and distribution readiness scoring. --- ## Table of Contents - [Verification Categories](#verification-categories) - [Tools](#tools) - [Six-Step Methodology](#six-step-methodology) - [Severity Taxonomy](#severity-taxonomy) - [Quality Score](#quality-score) - [Known Hallucination Patterns](#known-hallucination-patterns) - [Reference Guides](#reference-guides) - [Workflows](#workflows) - [Troubleshooting](#troubleshooting) - [Success Criteria](#success-criteria) - [Scope and Limitations](#scope-and-limitations) - [Anti-Patterns](#anti-patterns) - [Tool Reference](#tool-reference) --- ## Verification Categories Every AI-generated legal document must be checked across 6 categories. | # | Category | What to Check | Red Flags | |---|----------|--------------|-----------| | 1 | **Factual Accuracy** | Dates, references, numbers, entity names, timelines | Wrong effective dates, confused entity names, incorrect amounts | | 2 | **Legal Authority Citations** | Primary/secondary sources, format, hierarchy, currency | Non-existent articles, wrong section numbers, outdated citations | | 3 | **Arithmetic Validation** | Timelines, percentages, financial calculations, deadlines | Date math errors, percentage miscalculations, compounding mistakes | | 4 | **Source Verification** | Verifiable claims, official sources, cross-referencing | Unverifiable assertions stated as fact, single-source claims | | 5 | **Speculation Detection** | Opinion vs fact, uncertainty language, predictive claims | Predictions stated as certainty, guidance treated as binding law | | 6 | **Disclaimer Adequacy** | Legal advice disclaimers, jurisdiction, date, professional consultation | Missing disclaimers, overly broad claims, no jurisdiction limits | --- ## Tools ### Legal Fact Checker Scans legal text for verifiable claims and flags potential hallucination patterns. ```bash # Check a legal document python scripts/legal_fact_checker.py --input document.txt # Check with JSON output python scripts/legal_fact_checker.py --input memo.txt --json # Check inline text python scripts/legal_fact_checker.py --text "Under GDPR Article 83(5), fines can reach EUR 20 million..." # Save verification report python scripts/legal_fact_checker.py --input document.txt --output report.json ``` ### Legal Quality Scorer Scores legal document quality across all 6 verification categories. ```bash # Score a document python scripts/legal_quality_scorer.py --input document.txt # Score with JSON output python scripts/legal_quality_scorer.py --input document.txt --json # Score with detailed breakdown python scripts/legal_quality_scorer.py --input document.txt --verbose # Save quality assessment python scripts/legal_quality_scorer.py --input document.txt --output assessment.json ``` --- ## Six-Step Methodology ### Step 1: Initial Review Read the entire document with an adversarial mindset. For each claim, ask: - Is this verifiable? - Does this sound too specific to be generated without a source? - Does this sound too confident for an uncertain area? Mark every factual assertion, citation, date, number, and predictive statement. ### Step 2: Source Verification (ALWAYS Web Search) For every verifiable claim, attempt to verify against official sources. | Source Type | Verification Method | Examples | |-------------|-------------------|---------| | EU legislation | EUR-Lex official database | eur-lex.europa.eu | | US federal law | congress.gov, govinfo.gov | Official code and statutes | | US regulations | eCFR, Federal Register | ecfr.gov | | UK legislation | legislation.gov.uk | Official statute database | | Court decisions | Court databases, Westlaw, LexisNexis | Official reporters | | Agency guidance | Agency official website | Direct download from .gov/.europa.eu | | International treaties | UN Treaty Collection | treaties.un.org | **Rule:** If a claim cannot be verified from an official source, flag it. Do not assume accuracy. ### Step 3: Arithmetic Verification Check every calculation, date computation, and numerical claim. | Check Type | Method | |-----------|--------| | Timeline calculations | Count days/months/years between stated dates | | Percentage calculations | Recalculate from base figures | | Financial computations | Verify arithmetic and compounding | | Deadline calculations | Confirm against statutory text | | Penalty ranges | Cross-check against statute | ### Step 4: Citation Validation For every legal citation, verify: | Element | Check | |---------|-------| | Source exists | Does the cited statute/article/section actually exist? | | Content matches | Does the cited provision say what the document claims? | | Citation format | Is the citation in correct format for the jurisdiction? | | Currency | Is this the current, in-force version? | | Hierarchy correct | Is the source characterized at the right authority level? | ### Step 5: Speculation Identification Distinguish fact from opinion, certainty from prediction. | Language Pattern | Classification | Action | |-----------------|---------------|--------| | "The law requires..." | Factual claim | Verify against statutory text | | "Courts will likely..." | Speculation | Flag; add uncertainty qualifier | | "It is recommended..." | Guidance | Verify source; clarify if binding | | "Best practice suggests..." | Opinion | Label as opinion; cite source | | "This means that..." | Interpretation | Flag if stated as fact without authority | | "Companies must..." | Obligation claim | Verify statutory basis | ### Step 6: Disclaimer Review Every AI-generated legal document must include: | Required Element | Description | |-----------------|-------------| | Not legal advice | Clear statement that content is informational only | | Jurisdiction limitations | Which jurisdictions are and are not covered | | Date of preparation | When the content was prepared (law changes) | | Professional consultation | Recommendation to consult qualified legal counsel | | AI-generated disclosure | Statement that content was generated or assisted by AI | | Accuracy limitations | Acknowledgment that verification is recommended | --- ## Severity Taxonomy | Severity | Definition | Examples | Action | |----------|-----------|---------|--------| | **CRITICAL** | Factually wrong in a way that could cause legal harm | Wrong article number creating false obligation, incorrect penalty amount, non-existent legal requirement | Must fix before any distribution | | **HIGH** | Materially misleading or unverifiable | Guidance stated as binding law, unverifiable timeline, confident but unsourced claim | Must fix or add prominent caveat | | **MODERATE** | Imprecise or potentially confusing | Ambiguous language, minor date discrepancy, incomplete citation | Should fix; acceptable with caveat | | **LOW** | Style or formatting issue | Citation format inconsistency, missing cross-reference, minor redundancy | Fix if time permits | --- ## Quality Score | Score | Rating | Distribution Status | Criteria | |-------|--------|-------------------|----------| | **5/5** | Distribution Ready | Safe to distribute | Zero CRITICAL/HIGH issues; all citations verified; disclaimers complete | | **4/5** | Minor Revisions | Safe after small fixes | Zero CRITICAL; 1-2 HIGH issues with clear fixes; most citations verified | | **3/5** | Moderate Revisions | Needs work before distribution | Zero CRITICAL; 3+ HIGH issues; some unverified citations | | **2/5** | Major Revisions | Not safe to distribute | 1+ CRITICAL issues; multiple HIGH issues; significant
Related in Writing & Docs
jax-development
IncludedUse this skill when the user is writing, debugging, profiling, refactoring, reviewing, benchmarking, parallelising, exporting, or explaining JAX code, or when they mention JAX, jax.numpy, jit, grad, value_and_grad, vmap, scan, lax, random keys, pytrees, jax.Array, sharding, Mesh, PartitionSpec, NamedSharding, pmap, shard_map, Pallas, XLA, StableHLO, checkify, profiler, or the JAX repo. It helps turn NumPy or PyTorch-style code into pure functional JAX, fix tracer/control-flow/shape/PRNG bugs, remove recompiles and host-device syncs, choose transforms and sharding strategies, inspect jaxpr/lowering/IR, and benchmark compiled code correctly.
nature-article-writer
IncludedDrafts, rewrites, diagnostically critiques, and style-calibrates primary research manuscripts for Nature and Nature Portfolio journals. Use when the user wants a Nature-style title, summary paragraph or abstract, introduction, results, discussion, methods, figure legends, presubmission enquiry, cover letter, reviewer response, or when a scientific draft sounds generic, jargon-heavy, structurally weak, or AI-ish and needs precise, broad-reader-friendly prose without inventing data, analyses, or references. Best for primary research articles and letters rather than reviews or press releases unless explicitly adapting one.
deckrd
IncludedDocument-driven framework that derives requirements, specifications, implementation plans, and executable tasks from goals through structured AI dialogue. Use when user says "write requirements", "create spec", "plan implementation", "derive tasks", "structure this feature", "break down into tasks", or "document this module". Also use for reverse engineering existing code into docs (/deckrd rev). Do NOT use for direct code writing — use /deckrd-coder after tasks are generated. Do NOT use when the user only wants to run or fix existing code without planning.
clinical-decision-support
IncludedGenerate professional clinical decision support (CDS) documents for pharmaceutical and clinical research settings, including patient cohort analyses (biomarker-stratified with outcomes) and treatment recommendation reports (evidence-based guidelines with decision algorithms). Supports GRADE evidence grading, statistical analysis (hazard ratios, survival curves, waterfall plots), biomarker integration, and regulatory compliance. Outputs publication-ready LaTeX/PDF format optimized for drug development, clinical research, and evidence synthesis.
handling-sf-data
IncludedSalesforce data operations with 130-point scoring. Use this skill to create, update, delete, bulk import/export, generate test data, and clean up org records using sf CLI and anonymous Apex. TRIGGER when: user creates test data, performs bulk import/export, uses sf data CLI commands, needs data factory patterns for Apex tests, or needs to seed/clean records in a Salesforce org. DO NOT TRIGGER when: SOQL query writing only (use querying-soql), Apex test execution (use running-apex-tests), or metadata deployment (use deploying-metadata).
accelint-ac-to-playwright
IncludedConvert and validate acceptance criteria for Playwright test automation. Use when user asks to (1) review/evaluate/check if AC are ready for automation, (2) assess if AC can be converted as-is, (3) validate AC quality for Playwright, (4) turn AC into tests, (5) generate tests from acceptance criteria, (6) convert .md bullets or .feature Gherkin files to Playwright specs, (7) create test automation from requirements. Handles both bullet-style markdown and Gherkin syntax with JSON test plan generation and validation.