{
  "version": "2026.08.04",
  "rules": [
    { "id": "key.aws.access", "label": "AWS access key ID", "jurisdiction": "ALL", "category": "secret", "severity": "critical", "tier": 1,
      "pattern": "AKIA[0-9A-Z]{16}", "boundary": "word", "redactAs": "[AWS KEY REDACTED]", "explains": "credentials",
      "examples": { "valid": ["AKIAIOSFODNN7EXAMPLE"], "invalid": ["AKIA123", "BKIAIOSFODNN7EXAMPLE"] } },

    { "id": "key.aws.secret", "label": "AWS secret access key", "jurisdiction": "ALL", "category": "secret", "severity": "critical", "tier": 1,
      "pattern": "[A-Za-z0-9/+=]{40}", "boundary": "word", "requiresContext": true, "contextWindow": 60,
      "contextWords": { "en": ["aws", "secret", "access key"] }, "redactAs": "[AWS SECRET REDACTED]", "explains": "credentials",
      "examples": { "valid": ["aws secret: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"], "invalid": ["hash wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"] } },

    { "id": "key.anthropic", "label": "Anthropic API key", "jurisdiction": "ALL", "category": "secret", "severity": "critical", "tier": 1,
      "pattern": "sk-ant-[A-Za-z0-9_-]{20,}", "boundary": "none", "redactAs": "[ANTHROPIC KEY REDACTED]", "explains": "credentials",
      "examples": { "valid": ["sk-ant-api03-aaaaaaaaaaaaaaaaaaaaaaaa"], "invalid": ["sk-ant-short"] } },

    { "id": "key.openai", "label": "OpenAI API key", "jurisdiction": "ALL", "category": "secret", "severity": "critical", "tier": 1,
      "pattern": "sk-(?:proj-)?[A-Za-z0-9_-]{20,}", "boundary": "none", "redactAs": "[OPENAI KEY REDACTED]", "explains": "credentials",
      "examples": { "valid": ["sk-proj-abcdefghijklmnopqrstuvwx"], "invalid": ["sk-short"] } },

    { "id": "key.github", "label": "GitHub token", "jurisdiction": "ALL", "category": "secret", "severity": "critical", "tier": 1,
      "pattern": "(?:gh[poasur]_[A-Za-z0-9]{36,})|(?:github_pat_[A-Za-z0-9_]{22,})", "boundary": "none",
      "redactAs": "[GITHUB TOKEN REDACTED]", "explains": "credentials",
      "examples": { "valid": ["ghp_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"], "invalid": ["ghp_tooshort"] } },

    { "id": "key.stripe", "label": "Stripe secret key", "jurisdiction": "ALL", "category": "secret", "severity": "critical", "tier": 1,
      "pattern": "(?:sk|rk)_(?:live|test)_[A-Za-z0-9]{10,}", "boundary": "none", "redactAs": "[STRIPE KEY REDACTED]", "explains": "credentials",
      "examples": { "valid": ["sk_live_aaaaaaaaaaaaaaaaaaaaaaaa"], "invalid": ["sk_live_short"] } },

    { "id": "key.slack", "label": "Slack token", "jurisdiction": "ALL", "category": "secret", "severity": "critical", "tier": 1,
      "pattern": "xox[abprs]-[A-Za-z0-9-]{10,}", "boundary": "none", "redactAs": "[SLACK TOKEN REDACTED]", "explains": "credentials",
      "examples": { "valid": ["xoxb-1234567890-abcdefghij"], "invalid": ["xoxq-1234567890-abcdefghij"] } },

    { "id": "key.google", "label": "Google API key", "jurisdiction": "ALL", "category": "secret", "severity": "critical", "tier": 1,
      "pattern": "AIza[0-9A-Za-z_-]{35}", "boundary": "word", "redactAs": "[GOOGLE KEY REDACTED]", "explains": "credentials",
      "examples": { "valid": ["AIzaSyA1234567890abcdefghijklmnopqrstuv"], "invalid": ["AIzaSyA123"] } },

    { "id": "key.azure.storage", "label": "Azure storage account key", "jurisdiction": "ALL", "category": "secret", "severity": "critical", "tier": 1,
      "pattern": "AccountKey=[A-Za-z0-9+/=]{40,}", "boundary": "none", "redactAs": "[AZURE KEY REDACTED]", "explains": "credentials",
      "examples": { "valid": ["AccountKey=abcdefghijklmnopqrstuvwxyzABCDEF0123456789+/=="], "invalid": ["AccountKey=short"] } },

    { "id": "key.private-key", "label": "Private key block", "jurisdiction": "ALL", "category": "secret", "severity": "critical", "tier": 1,
      "pattern": "-----BEGIN [A-Z ]*PRIVATE KEY-----[\\s\\S]+?-----END [A-Z ]*PRIVATE KEY-----", "boundary": "none",
      "redactAs": "[PRIVATE KEY REDACTED]", "explains": "credentials",
      "examples": { "valid": ["-----BEGIN RSA PRIVATE KEY-----\nMIIEow\n-----END RSA PRIVATE KEY-----"], "invalid": ["-----BEGIN PUBLIC KEY-----\nMIIBIj\n-----END PUBLIC KEY-----"] } },

    { "id": "key.jwt", "label": "JSON Web Token", "jurisdiction": "ALL", "category": "secret", "severity": "high", "tier": 1,
      "pattern": "eyJ[A-Za-z0-9_-]{8,}\\.[A-Za-z0-9_-]{8,}\\.[A-Za-z0-9_-]{8,}", "boundary": "none",
      "redactAs": "[JWT REDACTED]", "explains": "credentials",
      "examples": { "valid": ["eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxMjM0NTY3ODkwIn0.dozjgNryP4J3jVmNHl0w5N_XgL0n3I9PlFUP0THsR8U"], "invalid": ["eyJhbGciOiJIUzI1NiJ9.payload"] } },

    { "id": "key.connection-string", "label": "Database connection string with password", "jurisdiction": "ALL", "category": "secret", "severity": "critical", "tier": 1,
      "pattern": "\\b(?:postgres(?:ql)?|mysql|mongodb(?:\\+srv)?|redis|amqps?)://[^\\s/@]+:[^\\s@]+@[^\\s\"']+", "boundary": "none",
      "redactAs": "[CONNECTION STRING REDACTED]", "explains": "credentials",
      "examples": { "valid": ["postgres://admin:hunter2@db.internal:5432/prod"], "invalid": ["postgres://db.internal:5432/prod"] } },

    { "id": "key.env-assignment", "label": "Secret assignment (.env style)", "jurisdiction": "ALL", "category": "secret", "severity": "high", "tier": 1,
      "pattern": "(?:^|\\n)[ \\t]*[A-Z][A-Z0-9_]*(?:KEY|SECRET|TOKEN|PASSWORD)[ \\t]*=[ \\t]*[^\\s]{8,}", "boundary": "none",
      "redactAs": "[SECRET ASSIGNMENT REDACTED]", "explains": "credentials",
      "examples": { "valid": ["DB_PASSWORD=correcthorsebatterystaple"], "invalid": ["DB_PASSWORD=short", "username=alice"] } },

    { "id": "fin.card", "label": "Payment card number", "jurisdiction": "ALL", "category": "financial", "severity": "high", "tier": 1,
      "pattern": "[\\p{Nd}](?:[\\p{Nd} -]{11,21})[\\p{Nd}]", "boundary": "digit", "checksum": "card",
      "redactAs": "[CARD REDACTED]", "explains": "customer-data",
      "examples": { "valid": ["4242 4242 4242 4242", "4242424242424242"], "invalid": ["4242 4242 4242 4241"] } },

    { "id": "fin.iban", "label": "IBAN", "jurisdiction": "ALL", "category": "financial", "severity": "high", "tier": 1,
      "pattern": "[A-Z]{2}[\\p{Nd}]{2}[A-Z0-9 ]{11,40}", "boundary": "word", "checksum": "mod97_iban",
      "redactAs": "[IBAN REDACTED]", "explains": "customer-data",
      "examples": { "valid": ["GB82WEST12345698765432"], "invalid": ["GB82WEST12345698765433"] } },

    { "id": "net.email", "label": "Email address", "jurisdiction": "ALL", "category": "contact", "severity": "low", "tier": 1,
      "pattern": "[A-Za-z0-9._%+-]{1,64}@[A-Za-z0-9.-]{1,255}\\.[A-Za-z]{2,24}", "boundary": "none",
      "escalateAt": { "count": 5, "severity": "high" },
      "redactAs": "[EMAIL REDACTED]", "explains": "customer-data",
      "examples": { "valid": ["jane.doe@example.com"], "invalid": ["jane.doe@example"] } },

    { "id": "net.phone", "label": "Phone number (international format)", "jurisdiction": "ALL", "category": "contact", "severity": "low", "tier": 1,
      "pattern": "\\+[\\p{Nd}][\\p{Nd} ().-]{7,14}[\\p{Nd}]", "boundary": "digit",
      "escalateAt": { "count": 5, "severity": "high" },
      "redactAs": "[PHONE REDACTED]", "explains": "customer-data",
      "examples": { "valid": ["+61 412 345 678"], "invalid": ["+61 41"] } },

    { "id": "net.ipv4", "label": "IPv4 address", "jurisdiction": "ALL", "category": "network", "severity": "low", "tier": 1,
      "pattern": "(?:25[0-5]|2[0-4][\\p{Nd}]|1?[\\p{Nd}]{1,2})(?:\\.(?:25[0-5]|2[0-4][\\p{Nd}]|1?[\\p{Nd}]{1,2})){3}", "boundary": "digit",
      "redactAs": "[IP REDACTED]", "explains": "source-code",
      "examples": { "valid": ["203.0.113.42"], "invalid": ["999.0.113.442"] } },

    { "id": "au.tfn", "label": "Australian Tax File Number", "jurisdiction": "AU", "category": "tax-id", "severity": "high", "tier": 1,
      "pattern": "[1-9][\\p{Nd}]{2}[ -]?[\\p{Nd}]{3}[ -]?[\\p{Nd}]{3}", "boundary": "digit", "checksum": "mod11_tfn",
      "contextWords": { "en": ["tfn", "tax file"] }, "redactAs": "[TFN REDACTED]", "explains": "customer-data",
      "examples": { "valid": ["123 456 782", "TFN: 123456782"], "invalid": ["123 456 789"] } },

    { "id": "au.abn", "label": "Australian Business Number", "jurisdiction": "AU", "category": "tax-id", "severity": "medium", "tier": 1,
      "pattern": "[\\p{Nd}]{2}[ ]?[\\p{Nd}]{3}[ ]?[\\p{Nd}]{3}[ ]?[\\p{Nd}]{3}", "boundary": "digit", "checksum": "mod89_abn",
      "redactAs": "[ABN REDACTED]", "explains": "contracts",
      "examples": { "valid": ["51 824 753 556", "51824753556"], "invalid": ["51 824 753 557"] } },

    { "id": "au.acn", "label": "Australian Company Number", "jurisdiction": "AU", "category": "tax-id", "severity": "medium", "tier": 1,
      "pattern": "[\\p{Nd}]{3}[ ]?[\\p{Nd}]{3}[ ]?[\\p{Nd}]{3}", "boundary": "digit", "checksum": "acn", "requiresContext": true,
      "contextWords": { "en": ["acn", "company number"] }, "redactAs": "[ACN REDACTED]", "explains": "contracts",
      "examples": { "valid": ["ACN 000 000 019"], "invalid": ["ref 000 000 019", "ACN 000 000 018"] } },

    { "id": "au.medicare", "label": "Australian Medicare number", "jurisdiction": "AU", "category": "health-id", "severity": "high", "tier": 1,
      "pattern": "[2-6][\\p{Nd}]{3}[ ]?[\\p{Nd}]{5}[ ]?[\\p{Nd}]{1,2}", "boundary": "digit", "checksum": "medicare_au",
      "redactAs": "[MEDICARE REDACTED]", "explains": "health-legal",
      "examples": { "valid": ["2953 15663 1"], "invalid": ["2953 15664 1"] } },

    { "id": "au.bsb-account", "label": "BSB and account number", "jurisdiction": "AU", "category": "financial", "severity": "high", "tier": 1,
      "pattern": "[\\p{Nd}]{3}-[\\p{Nd}]{3}[ ]?[\\p{Nd}]{6,9}", "boundary": "digit", "requiresContext": true,
      "contextWords": { "en": ["bsb", "account"] }, "redactAs": "[BANK ACCOUNT REDACTED]", "explains": "customer-data",
      "examples": { "valid": ["BSB 062-000 12345678"], "invalid": ["part 062-000 12345678"] } },

    { "id": "us.ssn", "label": "US Social Security number", "jurisdiction": "US", "category": "national-id", "severity": "high", "tier": 1,
      "pattern": "(?!000|666|9)[\\p{Nd}]{3}[- ]?(?!00)[\\p{Nd}]{2}[- ]?(?!0000)[\\p{Nd}]{4}", "boundary": "digit", "requiresContext": true,
      "contextWords": { "en": ["ssn", "social security"] }, "redactAs": "[SSN REDACTED]", "explains": "customer-data",
      "examples": { "valid": ["SSN: 123-45-6789"], "invalid": ["order 123-45-6789", "SSN: 000-45-6789"] } },

    { "id": "us.ein", "label": "US Employer Identification Number", "jurisdiction": "US", "category": "tax-id", "severity": "medium", "tier": 1,
      "pattern": "[\\p{Nd}]{2}-[\\p{Nd}]{7}", "boundary": "digit", "requiresContext": true,
      "contextWords": { "en": ["ein", "employer identification"] }, "redactAs": "[EIN REDACTED]", "explains": "contracts",
      "examples": { "valid": ["EIN 12-3456789"], "invalid": ["part 12-3456789"] } },

    { "id": "us.aba", "label": "US bank routing number", "jurisdiction": "US", "category": "financial", "severity": "high", "tier": 1,
      "pattern": "[\\p{Nd}]{9}", "boundary": "digit", "checksum": "aba", "requiresContext": true,
      "contextWords": { "en": ["routing", "aba"] }, "redactAs": "[ROUTING REDACTED]", "explains": "customer-data",
      "examples": { "valid": ["routing 011000015"], "invalid": ["ref 011000015", "routing 011000016"] } },

    { "id": "us.npi", "label": "US National Provider Identifier", "jurisdiction": "US", "category": "health-id", "severity": "high", "tier": 1,
      "pattern": "[\\p{Nd}]{10}", "boundary": "digit", "requiresContext": true,
      "contextWords": { "en": ["npi", "provider identifier"] }, "redactAs": "[NPI REDACTED]", "explains": "health-legal",
      "examples": { "valid": ["NPI 1234567893"], "invalid": ["ref 1234567893"] } },

    { "id": "us.mbi", "label": "US Medicare Beneficiary Identifier", "jurisdiction": "US", "category": "health-id", "severity": "high", "tier": 1,
      "pattern": "[1-9][AC-HJKMNP-RT-Yac-hjkmnp-rt-y][A-Za-z0-9][\\p{Nd}]-?[AC-HJKMNP-RT-Yac-hjkmnp-rt-y][A-Za-z0-9][\\p{Nd}]-?[AC-HJKMNP-RT-Yac-hjkmnp-rt-y]{2}[\\p{Nd}]{2}", "boundary": "word", "requiresContext": true,
      "contextWords": { "en": ["medicare", "mbi", "beneficiary"] }, "redactAs": "[MBI REDACTED]", "explains": "health-legal",
      "examples": { "valid": ["Medicare MBI: 1EG4-TE5-MK73"], "invalid": ["code 1EG4-TE5-MK73"] } },

    { "id": "uk.nino", "label": "UK National Insurance number", "jurisdiction": "UK", "category": "national-id", "severity": "high", "tier": 1,
      "pattern": "[A-CEGHJ-PR-TW-Za-ceghj-pr-tw-z][A-CEGHJ-NPR-TW-Za-ceghj-npr-tw-z][ ]?[\\p{Nd}]{2}[ ]?[\\p{Nd}]{2}[ ]?[\\p{Nd}]{2}[ ]?[A-Da-d]", "boundary": "word", "requiresContext": true,
      "contextWords": { "en": ["national insurance", "nino", "ni number"] }, "redactAs": "[NINO REDACTED]", "explains": "customer-data",
      "examples": { "valid": ["NI number: AB 12 34 56 C"], "invalid": ["code AB 12 34 56 C"] } },

    { "id": "uk.nhs", "label": "UK NHS number", "jurisdiction": "UK", "category": "health-id", "severity": "high", "tier": 1,
      "pattern": "[\\p{Nd}]{3}[ -]?[\\p{Nd}]{3}[ -]?[\\p{Nd}]{4}", "boundary": "digit", "checksum": "mod11_nhs",
      "redactAs": "[NHS NUMBER REDACTED]", "explains": "health-legal",
      "examples": { "valid": ["943 476 5919"], "invalid": ["943 476 5918"] } },

    { "id": "uk.utr", "label": "UK Unique Taxpayer Reference", "jurisdiction": "UK", "category": "tax-id", "severity": "medium", "tier": 1,
      "pattern": "[\\p{Nd}]{10}", "boundary": "digit", "requiresContext": true,
      "contextWords": { "en": ["utr", "unique taxpayer"] }, "redactAs": "[UTR REDACTED]", "explains": "contracts",
      "examples": { "valid": ["UTR 1234567890"], "invalid": ["ref 1234567890"] } },

    { "id": "uk.sort-account", "label": "UK sort code and account number", "jurisdiction": "UK", "category": "financial", "severity": "high", "tier": 1,
      "pattern": "[\\p{Nd}]{2}-[\\p{Nd}]{2}-[\\p{Nd}]{2}[ ]?[\\p{Nd}]{8}", "boundary": "digit", "requiresContext": true,
      "contextWords": { "en": ["sort code", "account"] }, "redactAs": "[BANK ACCOUNT REDACTED]", "explains": "customer-data",
      "examples": { "valid": ["sort code 12-34-56 12345678"], "invalid": ["v 12-34-56 12345678"] } },

    { "id": "eu.vat", "label": "EU VAT number", "jurisdiction": "EU", "category": "tax-id", "severity": "medium", "tier": 1,
      "pattern": "(?:ATU|BE0|BG|HR|CY|CZ|DK|EE|FI|FR|DE|EL|HU|IE|IT|LV|LT|LU|MT|NL|PL|PT|RO|SK|SI|ES|SE)[0-9A-Z]{8,12}", "boundary": "word", "requiresContext": true,
      "contextWords": { "en": ["vat"] }, "redactAs": "[VAT NUMBER REDACTED]", "explains": "contracts",
      "examples": { "valid": ["VAT DE123456789"], "invalid": ["code DE123456789"] } },

    { "id": "nz.ird", "label": "NZ IRD number", "jurisdiction": "NZ", "category": "tax-id", "severity": "high", "tier": 1,
      "pattern": "[\\p{Nd}]{2,3}-?[\\p{Nd}]{3}-?[\\p{Nd}]{3}", "boundary": "digit", "checksum": "mod11_ird", "requiresContext": true,
      "contextWords": { "en": ["ird"] }, "redactAs": "[IRD REDACTED]", "explains": "customer-data",
      "examples": { "valid": ["IRD 49-091-850"], "invalid": ["ref 49-091-850", "IRD 49-091-851"] } },

    { "id": "nz.nhi", "label": "NZ National Health Index number", "jurisdiction": "NZ", "category": "health-id", "severity": "high", "tier": 1,
      "pattern": "[A-HJ-NP-Za-hj-np-z]{3}[\\p{Nd}]{4}", "boundary": "word", "checksum": "nhi_nz", "requiresContext": true,
      "contextWords": { "en": ["nhi", "health index"] }, "redactAs": "[NHI REDACTED]", "explains": "health-legal",
      "examples": { "valid": ["NHI ZZZ0016"], "invalid": ["ref ZZZ0016", "NHI ZZZ0017"] } },

    { "id": "nz.bank-account", "label": "NZ bank account number", "jurisdiction": "NZ", "category": "financial", "severity": "high", "tier": 1,
      "pattern": "[\\p{Nd}]{2}-[\\p{Nd}]{4}-[\\p{Nd}]{7}-[\\p{Nd}]{2,3}", "boundary": "digit", "requiresContext": true,
      "contextWords": { "en": ["account"] }, "redactAs": "[BANK ACCOUNT REDACTED]", "explains": "customer-data",
      "examples": { "valid": ["account 12-3456-7890123-00"], "invalid": ["v 12-3456-7890123-00"] } }
  ],
  "signals": [
    { "id": "doc.contract", "label": "Looks like a contract", "explains": "contracts", "threshold": 3,
      "terms": { "en": ["this agreement", "hereinafter", "indemnif", "governing law", "in witness whereof", "party of the first part", "confidentiality obligations", "termination clause"] } },
    { "id": "doc.health", "label": "Looks like a medical record", "explains": "health-legal", "threshold": 3,
      "terms": { "en": ["patient", "diagnosis", "prescribed", "medical history", "presenting complaint", "medication", "treatment plan", "date of birth"] } },
    { "id": "doc.legal-privilege", "label": "Looks legally privileged", "explains": "health-legal", "threshold": 2,
      "terms": { "en": ["privileged and confidential", "attorney-client", "legal advice", "without prejudice", "solicitor-client"] } },
    { "id": "doc.source-code", "label": "Looks like source code", "explains": "source-code", "threshold": 4,
      "terms": { "en": ["function ", "import ", "class ", "return ", "const ", "def ", "public ", "private "] } },
    { "id": "doc.financial", "label": "Looks like financial statements", "explains": "contracts", "threshold": 3,
      "terms": { "en": ["balance sheet", "profit and loss", "ebitda", "fiscal year", "gross margin", "accounts receivable", "cash flow"] } },
    { "id": "doc.hr-payroll", "label": "Looks like HR or payroll data", "explains": "customer-data", "threshold": 3,
      "terms": { "en": ["salary", "performance review", "termination", "employee id", "payroll", "annual leave", "disciplinary"] } }
  ]
}
