aitrainingdatabroker's picture
Upload 2 files
4e73342 verified
Raw History Blame Contribute Delete
32.4 kB
"""Builds data/frameworks.jsonl, data/elements.jsonl, data/crosswalk.jsonl and data/obligations.jsonl: which data elements HIPAA, CCPA and CPRA,
and GDPR (and UK GDPR) treat as personal, and what each law asks of you, in plain language.
Written by AI Training Data Broker as a working aid for removing personal information before data is licensed.
A summary for conversations with counsel, not legal advice and not a certification. Run: python build.py
"""
import json
import pathlib
DIR = pathlib.Path(__file__).parent / "data"
# ---- elements: law, source, category, element, plain-language note, placeholder used when cleaning ----
HIPAA_SRC = "45 CFR 164.514(b)(2) (Safe Harbor)"
ELEMENTS = [
("HIPAA", HIPAA_SRC, "Safe Harbor identifier 1", "Names", "Full or partial names of the individual, relatives, employers or household members.", "Person 1"),
("HIPAA", HIPAA_SRC, "Safe Harbor identifier 2", "Geographic units smaller than a state", "Street address, city, county, precinct and ZIP code. The first three ZIP digits may stay only if the area they cover holds more than 20,000 people.", "a city in <region>"),
("HIPAA", HIPAA_SRC, "Safe Harbor identifier 3", "Dates related to an individual", "All elements of dates except the year: birth, admission, discharge, death. Ages over 89 and their dates are grouped as 90 or older.", "<year> or <season> <year>"),
("HIPAA", HIPAA_SRC, "Safe Harbor identifier 4", "Telephone numbers", "Any phone number tied to the individual.", "[PHONE]"),
("HIPAA", HIPAA_SRC, "Safe Harbor identifier 5", "Fax numbers", "Any fax number tied to the individual.", "[FAX]"),
("HIPAA", HIPAA_SRC, "Safe Harbor identifier 6", "Email addresses", "Any email address tied to the individual.", "[EMAIL]"),
("HIPAA", HIPAA_SRC, "Safe Harbor identifier 7", "Social Security numbers", "Any SSN.", "[SSN]"),
("HIPAA", HIPAA_SRC, "Safe Harbor identifier 8", "Medical record numbers", "Any medical record number.", "[MRN]"),
("HIPAA", HIPAA_SRC, "Safe Harbor identifier 9", "Health plan beneficiary numbers", "Any member or beneficiary number.", "[PLAN_ID]"),
("HIPAA", HIPAA_SRC, "Safe Harbor identifier 10", "Account numbers", "Any account number tied to the individual.", "[ACCOUNT]"),
("HIPAA", HIPAA_SRC, "Safe Harbor identifier 11", "Certificate and license numbers", "Professional or other license and certificate numbers.", "[LICENSE]"),
("HIPAA", HIPAA_SRC, "Safe Harbor identifier 12", "Vehicle identifiers and serial numbers", "VINs, license plates and similar.", "[VEHICLE_ID]"),
("HIPAA", HIPAA_SRC, "Safe Harbor identifier 13", "Device identifiers and serial numbers", "Serial numbers of devices tied to the individual.", "[DEVICE_ID]"),
("HIPAA", HIPAA_SRC, "Safe Harbor identifier 14", "Web URLs", "Web addresses tied to the individual.", "[URL]"),
("HIPAA", HIPAA_SRC, "Safe Harbor identifier 15", "IP addresses", "Internet protocol addresses tied to the individual.", "[IP]"),
("HIPAA", HIPAA_SRC, "Safe Harbor identifier 16", "Biometric identifiers", "Finger and voice prints and similar.", "removed"),
("HIPAA", HIPAA_SRC, "Safe Harbor identifier 17", "Full-face photographs and comparable images", "Photos and images that show the face.", "removed"),
("HIPAA", HIPAA_SRC, "Safe Harbor identifier 18", "Any other unique identifying number, characteristic or code", "A catch-all for anything that could identify the individual.", "removed or replaced"),
("HIPAA", HIPAA_SRC, "Safe Harbor condition", "No actual knowledge", "Safe Harbor also requires that the holder has no actual knowledge that what remains could identify the individual.", "reviewed by a person"),
("CCPA and CPRA", "Cal. Civ. Code 1798.140", "Personal information category", "Identifiers", "Real name, alias, postal address, unique personal identifier, online identifier, IP address, email address, account name, SSN, driver's license or passport number.", "[ID] and placeholders"),
("CCPA and CPRA", "Cal. Civ. Code 1798.140", "Personal information category", "Customer records", "Name, address, phone, signature, bank or card details, insurance and medical or employment information when it is in a customer record.", "placeholders"),
("CCPA and CPRA", "Cal. Civ. Code 1798.140", "Personal information category", "Protected classifications", "Characteristics such as age, race, religion, sex, marital status, disability.", "remove or generalise"),
("CCPA and CPRA", "Cal. Civ. Code 1798.140", "Personal information category", "Commercial information", "Records of products purchased, purchasing history and tendencies.", "aggregate or replace identity"),
("CCPA and CPRA", "Cal. Civ. Code 1798.140", "Personal information category", "Biometric information", "Fingerprints, face and voice data, and similar.", "removed"),
("CCPA and CPRA", "Cal. Civ. Code 1798.140", "Personal information category", "Internet or network activity", "Browsing history, search history, interaction with a site or ad.", "aggregate or remove"),
("CCPA and CPRA", "Cal. Civ. Code 1798.140", "Personal information category", "Geolocation data", "Physical location or movements. Precise geolocation is also sensitive personal information.", "coarsen to a region"),
("CCPA and CPRA", "Cal. Civ. Code 1798.140", "Personal information category", "Sensory data", "Audio, electronic, visual, thermal, olfactory or similar information, such as call recordings.", "removed"),
("CCPA and CPRA", "Cal. Civ. Code 1798.140", "Personal information category", "Professional or employment information", "Job history, employer, title, performance notes.", "generalise"),
("CCPA and CPRA", "Cal. Civ. Code 1798.140", "Personal information category", "Education information", "Non-public education records.", "remove or generalise"),
("CCPA and CPRA", "Cal. Civ. Code 1798.140", "Personal information category", "Inferences", "Profiles or predictions drawn from other personal information.", "remove if tied to a person"),
("CCPA and CPRA", "Cal. Civ. Code 1798.121", "Sensitive personal information", "Government IDs, account log-ins, precise location, racial or ethnic origin, religion, union membership, genetic data, health, sex life or orientation, contents of mail, email and texts", "A set that carries extra duties, including a right to limit use. Treat it as restricted in any data you license.", "remove, or clear with counsel"),
("CCPA and CPRA", "Cal. Civ. Code 1798.140", "Scope note", "Employee, applicant and business-contact data", "California law covers personal information of employees, job applicants and business contacts, not only consumers.", "treat like other personal information"),
("GDPR and UK GDPR", "GDPR Article 4(1)", "Personal data identifier", "Name", "Any information relating to an identified or identifiable person.", "Person 1"),
("GDPR and UK GDPR", "GDPR Article 4(1)", "Personal data identifier", "Identification number", "National ID, tax, customer or employee numbers.", "[ID]"),
("GDPR and UK GDPR", "GDPR Article 4(1)", "Personal data identifier", "Location data", "Where a person is or has been.", "coarsen to a region"),
("GDPR and UK GDPR", "GDPR Article 4(1)", "Personal data identifier", "Online identifier", "IP addresses, cookie IDs, device identifiers, advertising IDs.", "[ONLINE_ID]"),
("GDPR and UK GDPR", "GDPR Article 4(1)", "Personal data identifier", "Factors specific to a person's identity", "Physical, physiological, genetic, mental, economic, cultural or social identity.", "remove or generalise"),
("GDPR and UK GDPR", "GDPR Article 9", "Special category data", "Racial or ethnic origin", "Extra protection; processing is prohibited unless an exception applies.", "remove"),
("GDPR and UK GDPR", "GDPR Article 9", "Special category data", "Political opinions", "Extra protection.", "remove"),
("GDPR and UK GDPR", "GDPR Article 9", "Special category data", "Religious or philosophical beliefs", "Extra protection.", "remove"),
("GDPR and UK GDPR", "GDPR Article 9", "Special category data", "Trade union membership", "Extra protection.", "remove"),
("GDPR and UK GDPR", "GDPR Article 9", "Special category data", "Genetic data", "Extra protection.", "remove"),
("GDPR and UK GDPR", "GDPR Article 9", "Special category data", "Biometric data used to identify a person", "Extra protection.", "remove"),
("GDPR and UK GDPR", "GDPR Article 9", "Special category data", "Health data", "Extra protection.", "remove"),
("GDPR and UK GDPR", "GDPR Article 9", "Special category data", "Sex life or sexual orientation", "Extra protection.", "remove"),
]
# ---- crosswalk: element -> how each law treats it ----
# (element, hipaa, ccpa, gdpr, placeholder, keywords)
CROSS = [
("Name", "Listed identifier", "Identifier", "Personal data", "Person 1", ["name", "full name", "first name", "surname", "signature"]),
("Email address", "Listed identifier", "Identifier", "Personal data", "[EMAIL]", ["email", "e-mail", "mailto", "reply-to"]),
("Phone number", "Listed identifier", "Identifier, customer record", "Personal data", "[PHONE]", ["phone", "mobile", "cell", "tel", "fax"]),
("Street address", "Listed identifier (smaller than a state)", "Identifier, customer record", "Personal data (location)", "a city in <region>", ["address", "street", "zip", "postcode", "apartment"]),
("Precise date tied to a person", "Listed identifier (except year)", "Can be personal information", "Personal data", "<season> <year>", ["date of birth", "DOB", "admission date", "birthday", "age"]),
("Government ID number", "Listed identifier (SSN)", "Identifier; sensitive personal information", "Personal data (identification number)", "[ID]", ["SSN", "passport", "driver license", "national ID", "tax ID"]),
("Account number", "Listed identifier", "Identifier, customer record", "Personal data", "[ACCOUNT]", ["account number", "member ID", "customer ID", "IBAN", "routing"]),
("Health information", "Protected health information", "Sensitive personal information", "Special category", "removed", ["diagnosis", "prescription", "treatment", "medical record", "condition"]),
("Genetic data", "Can be protected health information", "Sensitive personal information", "Special category", "removed", ["genome", "DNA", "genetic", "variant", "sequence"]),
("Biometric data", "Listed identifier", "Personal information; sensitive when used to identify", "Special category when used to identify", "removed", ["fingerprint", "voiceprint", "face scan", "iris", "biometric"]),
("IP address", "Listed identifier", "Identifier", "Personal data (online identifier)", "[IP]", ["IP address", "IPv4", "IPv6", "client IP", "remote addr"]),
("Device or cookie ID", "Listed identifier (device)", "Unique personal identifier", "Personal data (online identifier)", "[DEVICE_ID]", ["device ID", "cookie", "advertising ID", "IMEI", "MAC address"]),
("Precise location", "Listed identifier (smaller than a state)", "Geolocation; sensitive when precise", "Personal data (location)", "a region", ["GPS", "latitude", "longitude", "geolocation", "check-in"]),
("Photo or video of a person", "Listed identifier (full face)", "Sensory data", "Personal data; special category if used to identify", "removed", ["photo", "headshot", "selfie", "video", "CCTV"]),
("Voice recording", "Listed identifier (voice print)", "Sensory data", "Personal data; special category if used to identify", "removed", ["call recording", "voicemail", "audio", "transcript", "voice"]),
("Employment information", "Can be part of a health record", "Professional or employment information", "Personal data", "generalised", ["employer", "job title", "salary", "performance review", "work history"]),
("Race, religion, union or similar", "Not a listed identifier", "Protected classification; sensitive personal information", "Special category", "removed", ["ethnicity", "religion", "union member", "political", "sexual orientation"]),
]
# ---- obligations: law, kind, name, plain-language summary ----
OBL = [
("HIPAA", "method", "Safe Harbor", "Remove the 18 listed identifiers and have no actual knowledge that what remains could identify a person. Simple to state, strict in practice, and free text often hides identifiers."),
("HIPAA", "method", "Expert Determination", "A qualified expert applies statistical and scientific methods, finds the risk of identification very small, and documents the method and result."),
("HIPAA", "scope", "Who it covers", "Covered entities (such as providers, health plans, clearinghouses) and their business associates, for protected health information. Other holders of health data are not necessarily covered."),
("CCPA and CPRA", "method", "Deidentified information", "Information that cannot reasonably be used to infer information about, or be linked to, a consumer. The business also takes reasonable measures against re-identification, commits publicly to keep it deidentified, and binds recipients by contract."),
("CCPA and CPRA", "right", "Right to know", "A consumer can ask what personal information is collected, used, disclosed or sold, and for what purpose."),
("CCPA and CPRA", "right", "Right to delete", "A consumer can ask a business to delete personal information, with exceptions."),
("CCPA and CPRA", "right", "Right to correct", "A consumer can ask for inaccurate personal information to be corrected."),
("CCPA and CPRA", "right", "Right to opt out of sale or sharing", "A consumer can tell a business not to sell or share their personal information. Licensing data that includes personal information can count as a sale."),
("CCPA and CPRA", "right", "Right to limit use of sensitive personal information", "A consumer can limit use of sensitive personal information to what is needed to provide the service."),
("CCPA and CPRA", "right", "No retaliation", "A business may not penalise a consumer for using these rights."),
("GDPR and UK GDPR", "principle", "Lawfulness, fairness and transparency", "Process personal data on a valid legal basis and tell people what you do with it."),
("GDPR and UK GDPR", "principle", "Purpose limitation", "Collect for specified purposes and do not reuse for incompatible ones. Licensing data to train a model is a new purpose that needs its own basis."),
("GDPR and UK GDPR", "principle", "Data minimisation", "Keep only what is adequate, relevant and necessary for the purpose."),
("GDPR and UK GDPR", "principle", "Accuracy", "Keep personal data accurate and up to date."),
("GDPR and UK GDPR", "principle", "Storage limitation", "Keep personal data in identifiable form no longer than necessary."),
("GDPR and UK GDPR", "principle", "Integrity and confidentiality", "Protect personal data with appropriate security."),
("GDPR and UK GDPR", "principle", "Accountability", "Be able to show that you comply."),
("GDPR and UK GDPR", "method", "Pseudonymisation", "Replacing identifiers so data cannot be linked to a person without additional information kept separately. Pseudonymised data is still personal data."),
("GDPR and UK GDPR", "method", "Anonymisation", "Data is outside the GDPR only if no one can reasonably identify a person from it, using all means reasonably likely to be used (Recital 26). A high bar, and a question for counsel."),
("GDPR and UK GDPR", "right", "Access", "A person can ask for a copy of their personal data and information about its use."),
("GDPR and UK GDPR", "right", "Rectification", "A person can have inaccurate data corrected."),
("GDPR and UK GDPR", "right", "Erasure", "A person can ask for deletion in certain cases."),
("GDPR and UK GDPR", "right", "Restriction", "A person can ask that processing be limited in certain cases."),
("GDPR and UK GDPR", "right", "Portability", "A person can receive data they provided in a usable format."),
("GDPR and UK GDPR", "right", "Objection", "A person can object to some processing, including for direct marketing."),
("GDPR and UK GDPR", "right", "Automated decisions", "A person has protection against decisions based solely on automated processing that affect them significantly."),
]
# ---- frameworks: one row per framework ----
# (framework, type, jurisdiction, who oversees it, who it covers, what it protects, key duties, cleaning implications, keywords, questions for counsel, industries)
FW = [
("HIPAA", "law", "United States (federal)", "HHS Office for Civil Rights",
"Covered entities (providers, health plans, clearinghouses) and their business associates.",
"Protected health information: health data linked to a person.",
["Limit use and disclosure of protected health information", "Apply safeguards", "Use a business associate agreement with vendors", "De-identify by Safe Harbor or Expert Determination before treating data as non-PHI"],
"Remove the 18 identifiers or use an expert determination; scan free text and attachments, not only fields.",
["PHI", "patient", "medical record number", "diagnosis", "covered entity", "business associate"],
["Are we a covered entity or business associate for this data?", "Which de-identification method will we use, and who signs off?"],
["Healthcare administration", "Insurance", "Biotech and labs"]),
("42 CFR Part 2", "rule", "United States (federal)", "HHS",
"Federally assisted programs that treat substance use disorders.",
"Records that identify a person as having a substance use disorder or being treated for one.",
["Get written consent for most disclosures", "Limit redisclosure"],
"Treat any such record as restricted; exclude it unless counsel confirms consent or another basis.",
["substance use", "treatment program", "SUD", "recovery", "rehab"],
["Do any of our records come from a Part 2 program?"],
["Healthcare administration"]),
("CCPA and CPRA", "law", "California, United States", "California Privacy Protection Agency and the Attorney General",
"For-profit businesses that meet size or data thresholds and do business in California.",
"Personal information of California residents, including employees, applicants and business contacts.",
["Tell people what you collect", "Honor rights to know, delete, correct, opt out of sale or sharing, and limit sensitive data", "Keep service provider and recipient contracts"],
"Licensing data that includes personal information can count as a sale; deidentify to the statute's standard and bind recipients by contract.",
["consumer", "personal information", "sale or sharing", "sensitive personal information", "deidentified"],
["Do we meet the thresholds?", "Does this license count as a sale or sharing?"],
["Every industry"]),
("Other US state privacy laws", "laws", "United States (states)", "State attorneys general and some state agencies",
"Businesses above state-specific size or volume thresholds.",
"Personal data of residents of that state, with varying definitions.",
["Notice", "Consumer rights", "Limits on sale and targeted use", "Extra rules for sensitive data"],
"Apply the strictest definition across the states where your people live; keep a record of what you removed.",
["state resident", "consumer rights", "targeted advertising", "sensitive data"],
["Which states do our customers and staff live in?"],
["Every industry"]),
("GDPR", "regulation", "European Union", "National data protection authorities",
"Anyone handling personal data of people in the EU, in the EU or offering services to them.",
"Any information relating to an identifiable person, with extra protection for special categories.",
["Have a lawful basis", "Follow the seven principles", "Honor data subject rights", "Use processor contracts", "Transfer data abroad only by a valid route"],
"Pseudonymised data is still personal data; only truly anonymous data falls outside. A new purpose such as model training needs its own basis.",
["data subject", "controller", "processor", "lawful basis", "special category", "anonymisation"],
["What is our lawful basis for this new use?", "Does the cleaned data count as anonymous?"],
["Any industry with EU customers, staff or contacts"]),
("UK GDPR", "law", "United Kingdom", "Information Commissioner's Office",
"Anyone handling personal data of people in the United Kingdom.",
"Personal data, with special category protections similar to the EU GDPR.",
["Same principles and rights as the GDPR, with UK-specific guidance and transfer rules"],
"Treat like the GDPR, then check UK guidance and transfer rules separately.",
["ICO", "UK data subject", "special category", "international transfer"],
["Do UK rules differ from EU rules for this transfer?"],
["Any industry with UK customers, staff or contacts"]),
("PIPEDA and Quebec Law 25", "laws", "Canada (federal and Quebec)", "Office of the Privacy Commissioner of Canada; Quebec's Commission d'acces a l'information",
"Private-sector organisations handling personal information in the course of commercial activity.",
"Information about an identifiable individual; Quebec adds rules on de-identification and anonymization.",
["Get meaningful consent", "Limit collection and use", "Safeguard data", "Quebec: conduct privacy impact assessments for some projects and follow its anonymization conditions"],
"Check Quebec's conditions before calling data anonymized; keep records of the method.",
["PIPEDA", "Quebec", "consent", "privacy impact assessment", "anonymized"],
["Do Canadian residents appear in our records?", "Does the cleaning meet Quebec's anonymization conditions?"],
["Any industry with Canadian customers or staff"]),
("GLBA and the FTC Safeguards Rule", "law and rule", "United States (federal)", "FTC and financial regulators",
"Financial institutions, a group that includes some tax, accounting and lending businesses.",
"Nonpublic personal information about customers.",
["Give privacy notices", "Limit sharing with third parties", "Maintain a written information security program"],
"Remove account and tax numbers entirely; sharing customer financial data needs a legal basis and often notice or consent.",
["nonpublic personal information", "NPI", "financial institution", "safeguards", "account number"],
["Are we a financial institution under the rule?"],
["Finance", "Insurance", "Accounting"]),
("FCRA", "law", "United States (federal)", "FTC and the Consumer Financial Protection Bureau",
"Consumer reporting agencies and users and furnishers of consumer reports.",
"Consumer reports such as credit, background and tenant screening reports.",
["Use reports only for permissible purposes", "Give notices for adverse action", "Keep reports accurate"],
"Exclude consumer reports and screening results from any licensed set unless counsel clears it.",
["consumer report", "background check", "credit report", "adverse action", "tenant screening"],
["Do our records contain consumer reports or their results?"],
["Staffing and recruiting", "Property management", "Finance"]),
("COPPA", "law", "United States (federal)", "FTC",
"Online services directed to children under 13, or that know they collect data from them.",
"Personal information of children under 13.",
["Give notice to parents", "Get verifiable parental consent in many cases", "Limit collection and retention"],
"Identify and exclude data from children unless counsel confirms a basis.",
["child", "under 13", "parental consent", "minor", "parent email"],
["Do any of our users or players appear to be under 13?"],
["Gaming", "Software", "Retail and e-commerce"]),
("PCI DSS", "industry standard", "Global (card networks)", "PCI Security Standards Council and card brands",
"Organisations that store, process or transmit payment card data.",
"Cardholder data and sensitive authentication data.",
["Protect stored card data", "Restrict access", "Test and monitor systems"],
"Never include card numbers or security codes in licensed data; scan free text for pasted card details.",
["card number", "PAN", "CVV", "cardholder", "expiry"],
["Could card details appear in tickets or chats?"],
["Retail and e-commerce", "Finance"]),
("CAN-SPAM", "law", "United States (federal)", "FTC",
"Senders of commercial email.",
"Recipients of commercial messages.",
["Include opt-out and a postal address", "Honor opt-outs promptly", "Do not use deceptive headers"],
"Mailing lists and opt-out records are customer data; treat them as personal information, not as a licensable asset by default.",
["unsubscribe", "opt-out", "mailing list", "subscriber", "commercial email"],
["Does our licensed data include mailing lists?"],
["Agencies", "Retail and e-commerce"]),
("Fair Housing Act", "law", "United States (federal)", "HUD and the Department of Justice",
"Housing providers, landlords, property managers, lenders and brokers.",
"People in protected classes in housing decisions.",
["Do not discriminate", "Avoid records that reveal discriminatory reasoning"],
"Review notes for mentions of protected characteristics; remove them and any decision data tied to them.",
["protected class", "familial status", "disability", "tenant selection", "accommodation request"],
["Do notes in our records mention protected characteristics?"],
["Property management"]),
("Driver's Privacy Protection Act", "law", "United States (federal)", "Federal and state authorities",
"Anyone who obtains personal information from state motor vehicle records.",
"Personal information in motor vehicle records.",
["Use such information only for permitted purposes"],
"Remove license numbers and data drawn from motor vehicle records.",
["driver license", "motor vehicle record", "DMV", "license plate"],
["Do our records include data from motor vehicle records?"],
["Logistics and freight"]),
("ITAR and EAR", "regimes", "United States (federal)", "State Department (ITAR) and Commerce Department (EAR)",
"Exporters and anyone who shares controlled technical data, including by transfer to foreign persons.",
"Controlled items, software and technical data.",
["Classify items and data", "Get licenses where required", "Control access by nationality in some cases"],
"Treat technical text as controlled until classified; a file shared with a foreign lab can be an export.",
["export controlled", "technical data", "ECCN", "USML", "defense article"],
["Is any of our technical content controlled, and who may receive it?"],
["Aerospace", "Semiconductors", "Manufacturing"]),
("CUI and DFARS", "requirements", "United States (government contracts)", "Department of Defense and contracting officers",
"Contractors handling controlled unclassified information.",
"Controlled unclassified information on government contracts.",
["Mark and protect CUI", "Meet specified security controls", "Report incidents"],
"Exclude anything marked or derived from CUI.",
["CUI", "DFARS", "controlled unclassified", "NIST 800-171", "contract data"],
["Which of our contracts carry CUI duties?"],
["Aerospace", "Manufacturing"]),
("GINA", "law", "United States (federal)", "Equal Employment Opportunity Commission and health regulators",
"Employers, health insurers and others in certain settings.",
"Genetic information, including family medical history.",
["Do not use genetic information in coverage or employment decisions", "Keep it confidential"],
"Treat genetic and family history data as restricted and exclude it.",
["genetic", "family history", "genetic test", "hereditary"],
["Do our records include genetic information?"],
["Biotech and labs", "Insurance"]),
("21 CFR Part 11", "rule", "United States (federal)", "FDA",
"Organisations keeping electronic records and signatures in FDA-regulated work.",
"Integrity and trustworthiness of electronic records.",
["Validate systems", "Keep audit trails", "Control access and signatures"],
"Licensing copies of regulated records can raise integrity and confidentiality questions; keep the originals and the audit trail intact.",
["audit trail", "electronic signature", "batch record", "validation", "GxP"],
["Are the records we license regulated records?"],
["Biotech and labs"]),
("Attorney-client privilege and professional conduct rules", "doctrine and rules", "Largely United States (varies by state)", "Courts and bar regulators",
"Lawyers and their clients, and anyone who holds privileged material.",
"Confidential communications and work product.",
["Preserve confidentiality", "Avoid waiving privilege by disclosure"],
"Sharing privileged material can waive privilege; exclude it unless the client agrees in writing and counsel advises.",
["privileged", "attorney-client", "work product", "legal advice", "confidential matter"],
["Would sharing this waive privilege?"],
["Legal"]),
("Contractual confidentiality and NDAs", "contract terms", "Depends on the contract", "The contracting parties and courts",
"Anyone bound by a customer, supplier or partner agreement.",
"Information the contract defines as confidential.",
["Use data only as the contract allows", "Get consent before disclosure where required"],
"Read each contract before licensing; a privacy law can allow what a contract forbids.",
["confidential information", "NDA", "MSA", "non-disclosure", "permitted use"],
["Which contracts limit reuse of this data?"],
["Every industry"]),
("Trade secret protection", "law and contract", "United States (federal and state) and elsewhere", "Courts",
"Owners of information that has value because it is secret.",
"Secret business and technical information.",
["Take reasonable steps to keep it secret"],
"Sharing without safeguards can weaken a claim; exclude process and design detail unless licensed deliberately.",
["trade secret", "proprietary", "process recipe", "confidential design", "know-how"],
["Will licensing this weaken any trade secret claim?"],
["Manufacturing", "Semiconductors", "Aerospace", "Professional services"]),
]
NOTICE = "A summary for conversations with counsel. Not legal advice and not a certification. Check the current text of each rule."
def main():
DIR.mkdir(parents=True, exist_ok=True)
el = [{"id": f"el-{i:03d}", "law": l, "source": s, "category": c, "element": e, "note": n, "placeholder_when_cleaning": p}
for i, (l, s, c, e, n, p) in enumerate(ELEMENTS, 1)]
cw = [{"id": f"cw-{i:02d}", "element": e, "hipaa": h, "ccpa_cpra": c, "gdpr": g, "placeholder_when_cleaning": p, "keywords": k}
for i, (e, h, c, g, p, k) in enumerate(CROSS, 1)]
ob = [{"id": f"ob-{i:02d}", "law": l, "kind": k, "name": n, "summary": s} for i, (l, k, n, s) in enumerate(OBL, 1)]
fw = [{"id": f"fw-{i:02d}", "framework": a, "type": b, "jurisdiction": c, "oversight": d, "covers": e, "protects": f, "key_duties": g,
"cleaning_implications": h, "keywords": k, "questions_for_counsel": q, "related_industries": r, "notice": NOTICE}
for i, (a, b, c, d, e, f, g, h, k, q, r) in enumerate(FW, 1)]
for name, rows in (("frameworks", fw), ("elements", el), ("crosswalk", cw), ("obligations", ob)):
txt = json.dumps(rows, ensure_ascii=False)
assert "—" not in txt and "–" not in txt, name
(DIR / f"{name}.jsonl").write_text("\n".join(json.dumps(r, ensure_ascii=False) for r in rows) + "\n", encoding="utf-8")
print(name, len(rows))
if __name__ == "__main__":
main()