1 / 21
1
ComplianceGPT Lab · AI Innovation & Diffusion REU 2026

Contextual Integrity & Compliance

The theory this entire lab's system is built on — and why "who can see what" was never a fixed rule to begin with

2

Learning Arc

By the end of today you can

  • State Nissenbaum's Contextual Integrity (CI) theory in one sentence, with the 5-tuple
  • Explain why the 5-tuple alone is not enough — with a real example from this lab's own data
  • Point to the exact fields in connector/hipaa_engine.py that implement each CI parameter
  • Reframe your own project's research question in CI terms

Today's notebook

notebooks/contextual_integrity.ipynb — manually tag real scenarios with the CI 5-tuple before seeing what the real extractor produced, then find the exact real case where two scenarios share an identical tuple but opposite verdicts.

3
Part 1 — The Problem With "Public" vs. "Private"

You Already Reason About This Constantly

You tell your doctor your diagnosis. You wouldn't tell your employer. You post your birthday publicly on social media. You would never post your Social Security number the same way.

Same person, same fact, sometimes even the same platform — completely different judgment about whether sharing it is okay. If privacy were just "secret vs. not secret," this wouldn't make sense. It isn't about the information. It's about where the information is flowing, and under what expectation.

4
Part 1 — The Problem With "Public" vs. "Private"

Same Fact, Different Flow, Different Verdict

InformationThis flow feels fineThis flow feels wrong
Your grade on an examProfessor → youProfessor → posted publicly by name
Your medical diagnosisYou → treating physicianYou → your employer
Your location right nowYou → a close friend, casuallyAdvertiser → sold to data broker

Notice: the information itself never changed across each row. What changed is who is sending it to whom, about whom, and under what norm. That's the whole theory, in a table.

5
Part 2 — Formalizing It

Contextual Integrity (Nissenbaum, 2004/2010)

Helen Nissenbaum's core claim: there is no such thing as information that is simply "public" or "private" in the abstract. Every flow of information is governed by norms of appropriateness tied to the context it flows within — not by the sensitivity of the information alone.

Why this matters for compliance law

HIPAA, GDPR, and every privacy statute you'll encounter are society's attempt to codify context-relative informational norms for a specific domain (healthcare, in HIPAA's case) into enforceable rules. Laws don't invent privacy norms from scratch — they formalize norms that already existed informally, like the doctor/employer example.

6
Part 2 — Formalizing It

The CI 5-Tuple this is the actual schema you've been reading

Nissenbaum formalizes a flow as five parameters. Every one of your projects' data is built on exactly this structure.

Sender

Who is disclosing the information

Receiver

Who receives it

Subject

Whose information it is

Attribute

What type of information

Transmission Principle

The norm the flow claims to satisfy

"Transmission principle" is the least intuitive term — think of it as the reason the flow is supposed to be okay: "with consent," "as required by law," "confidentially, for treatment." It's not just a label, it's a claimed justification.

7
Part 2 — Formalizing It

You Have Been Reading This Tuple All Along

Every scenario this lab's pipeline extracts is exactly Nissenbaum's 5-tuple, with HIPAA-specific field names.

CI ParameterField in DatalogScenario
Sendersender, sender_role
Receiverreceiver, receiver_role
Subjectsubject, subject_category
Attributeattribute
Transmission Principlepurpose

The paper states this directly: extraction "converts a natural-language compliance question into a structured Datalog fact set encoding the Contextual Integrity 5-tuple... plus 24 boolean oracle predicates." You'll see why the oracle predicates are needed starting next slide.

8
Part 2 — Formalizing It

Why CI, Specifically, and Not Some Other Framework?

Regulation-agnostic

The same 5-tuple structure applies to GDPR, CCPA, COPPA, and GLBA — not just HIPAA. If your project touches GDPR generalization, this is precisely the claim you're testing: does the tuple structure transfer, even if the specific rules encoded on top of it don't?

Matches HIPAA's own grammar

Every HIPAA permission rule is fundamentally about who may send what to whom for what purpose. The statute is already organized around this shape — CI isn't imposed on the law from outside, it matches how disclosure-centric law is naturally written.

9
Part 3 — Why the Tuple Alone Isn't Enough

Four Reasons the 5-Tuple Can't Be the Whole Story

These are the actual design challenges this lab's paper documents (§"Design Challenges," C1–C4) — not hypothetical, these drove real architecture decisions.

10
Part 3 — Why the Tuple Alone Isn't Enough

C1 — Closed-World Semantics

Most reasoning about evidence is "open-world": if there's enough support, believe it. HIPAA's legal architecture is the opposite.

Permission requires an affirmative derivation. A disclosure is only PERMITTED if a specific statutory exception actually fires given the facts. Ambiguous or missing facts don't default to "probably fine" — they default to DENIED. An AI system that reasons probabilistically ("this looks 80% like a normal treatment disclosure") is already legally wrong in structure, before it even gets a fact wrong.

11
Part 3 — Why the Tuple Alone Isn't Enough

C2 — Non-Derivable Enabling Conditions why the 24 oracle predicates exist

The 5-tuple tells you the shape of a flow. It cannot tell you facts about the world that determine whether an exception applies.

None of these are derivable from role and purpose strings alone — they require evidence beyond the 5-tuple. This is exactly what the 22–24 boolean oracle predicates (has_court_order, obtained_authorization_164_508, etc.) are for: they carry the transmission-principle detail Nissenbaum's framework calls for that a single purpose string can't hold.

12
Part 3 — Why the Tuple Alone Isn't Enough

C3 — Cross-Section Interactions

Privacy rules aren't independent — one section can override another for the same tuple.

§164.506 permits treatment-purpose disclosures without patient authorization. §164.508(a)(2) OVERRIDES this for psychotherapy notes — even within an active treatment relationship, written authorization is required. // A hospital disclosing therapy notes to a treatment team: // satisfies §164.506 ... but VIOLATES §164.508

A purely positive-rule system says PERMITTED, because the §164.506 rule fires and nothing stops it. This is why the Datalog encoding needs explicit negation guards — rules can't just say what's allowed, they have to say what's allowed unless a more specific rule blocks it.

13
Part 3 — Why the Tuple Alone Isn't Enough

C4 — Structurally Indistinguishable Violations real example, next slide

The sharpest limitation. Some violations are invisible at the level of the 5-tuple — two scenarios can share an identical tuple and still have opposite correct verdicts.

Classic version: a nurse disclosing records to a patient for treatment, vs. a nurse accessing her ex-husband's records — same roles, same attribute, same claimed purpose. The tuple can't tell them apart. The violation lives entirely at the instance level, in facts the tuple doesn't capture.

14
Part 3 — Why the Tuple Alone Isn't Enough

This Actually Happens in Real Data verified — GoldCoin-HHS rows 48 & 50

Both scenarios below have the identical CI 5-tuple: hospital → patient, adult, medical-record, treatment.

Row 48 — DENIED

Patient requests own medical records from a state hospital — but the patient is an inmate, and the hospital operates under a correctional institution. HIPAA's access-request right can be limited for inmates (§164.524).

Row 50 — PERMITTED

Patient's legal representatives request copies of his own records for a lawsuit against the records-copying vendor — a proper access request through a business associate, no restriction applies.

The 5-tuple is identical in both. The correct verdict depends entirely on facts like belongstorole(..., "inmate") and organization_member(..., "kansas_srs") — pure C2/C4 territory. You'll pull these two rows yourself in the notebook.

15

C1–C4, One Table

ChallengeThe problemArchitectural answer
C1Open-world reasoning is legally wrong hereClosed-world Datalog — permission requires affirmative derivation
C2Enabling conditions aren't derivable from role/purpose22–24 boolean oracle predicates
C3One section can override another for the same tupleExplicit negation guards
C4Some violations are invisible at the tuple levelOracle predicates + instance-level facts (rows 48/50)
16
Part 4 — Live Code

One Scenario, Start to Finish

Narrative text
CI 5-tuple + oracle predicates
LLM₁ extraction
Datalog facts
Verdict + proof tree
Soufflé, deterministic

Live in class: open connector/hipaa_engine.py, find scenario_to_datalog(), and trace exactly which extracted field becomes which Datalog fact line for row 48 or row 50.

17
Part 5 — Your Project, in CI Terms

This Vocabulary Sharpens Every Project

ProjectCI-framed research question
Red-Teaming / AdversarialWhich attacks succeed by spoofing the transmission principle (claiming a purpose/oracle) without changing sender, receiver, subject, or attribute?
GDPR GeneralizationDoes the 5-tuple structure transfer across regulations even when the rules built on top of it don't?
Error TaxonomyDo errors concentrate in tuple extraction (wrong sender/receiver/purpose) or in oracle-predicate extraction (C2-style)?
Explanation QualityDo explanations correctly cite which CI parameter or oracle made the difference — or do they just restate the verdict?
LLM Benchmark ComparisonDo smaller models fail more on tuple extraction, oracle extraction, or both?
18

Today's Notebook — contextual_integrity.ipynb

  1. Read 5 real GoldCoin scenario texts. By hand, write down your guess at the CI 5-tuple for each — before looking at any code.
  2. Compare your guesses to the real extracted scenario_json for those exact rows.
  3. Pull the real row 48 / row 50 pair yourself — verify the identical tuple, then find the facts that actually explain the different verdicts.
  4. Given a new scenario, guess which oracle predicates apply before seeing the extraction.
19

Recap

  1. Privacy/compliance is about appropriate flow, not secret vs. public — Contextual Integrity, Nissenbaum 2004/2010
  2. The CI 5-tuple (sender, receiver, subject, attribute, transmission principle) is literally this system's extraction schema
  3. The tuple alone fails in 4 documented ways (C1–C4) — each has a specific architectural answer
  4. C4 is real, not hypothetical — rows 48 and 50 prove it
  5. Every project's research question gets sharper stated in CI terms
20

Questions to Sit With

21

Now You Know What the Code Was Always Encoding

Every field you've read in DatalogScenario all summer has a name in a 20-year-old privacy theory. That's not a coincidence — it's the design.