🔧 AI Nachrichten Major AI platforms go down in unprecedented simultaneous outage(03.09.2026 um 17:34 Uhr)
🔧 AI Nachrichten ChatGPT, Claude, and Grok Down? Users Report Widespread Outages(03.09.2026 um 19:14 Uhr)
🔧 AI Nachrichten OpenAI Launches GPT-6 Astra, Says We May Have Entered the AGI Era(03.09.2026 um 22:08 Uhr)
🔧 AI Nachrichten Claude Comes to CarPlay as Fifth Major AI Chatbot App(05.09.2026 um 05:31 Uhr)
🔧 AI Nachrichten OpenAI’s GPT-6 Astra Is AGI, Says NVIDIA CEO Jensen Huang(07.09.2026 um 06:31 Uhr)
🔧 AI Nachrichten Blame AI companies for Mac mini and Mac Studio shortage(31.08.2026 um 10:32 Uhr)
🔧 AI Nachrichten Major AI platforms go down in unprecedented simultaneous outage(03.09.2026 um 17:34 Uhr)
🔧 AI Nachrichten ChatGPT, Claude, and Grok Down? Users Report Widespread Outages(03.09.2026 um 19:14 Uhr)
🔧 AI Nachrichten OpenAI Launches GPT-6 Astra, Says We May Have Entered the AGI Era(03.09.2026 um 22:08 Uhr)
🔧 AI Nachrichten Claude Comes to CarPlay as Fifth Major AI Chatbot App(05.09.2026 um 05:31 Uhr)
🔧 AI Nachrichten OpenAI’s GPT-6 Astra Is AGI, Says NVIDIA CEO Jensen Huang(07.09.2026 um 06:31 Uhr)
🔧 AI Nachrichten Blame AI companies for Mac mini and Mac Studio shortage(31.08.2026 um 10:32 Uhr)

🔧 Programmierung 🕛 kürzlich 4 Min Lesezeit
0

Learn Data Minimization With a Tiny Python Health-Record Filter

↗ Quelle (dev.to)
🗣️ Stimme:
📑 Inhaltsübersicht

Expected transformation:




CODE
input keys:  date, steps, sleep_minutes, medication, note
purpose: activity_summary
output keys: date, steps






The learning question is not “how do I analyze health data?” It is “how can a program prove that one purpose receives fewer fields than the original record?” That is data minimization: collecting or passing only what a declared task needs.



This exercise is timely because OpenAI announced Health in ChatGPT on July 23, 2026. OpenAI says the rollout covers eligible US users who are logged in, age 18+, and using web or iOS. It says supported connections include medical records and Apple Health, and a dashboard may cover labs, medications, activity, sleep, and other health information. OpenAI further states connected data and relevant conversations are not used to train foundation models or target ads. Those are company statements from the primary source, not results from this lesson.






Prerequisite and tiny program



Use Python 3.11 or newer and only the standard library. The following code and outputs are labeled unexecuted examples.




CODE
from copy import deepcopy

POLICY = {
"activity_summary": {"date", "steps"},
"sleep_summary": {"date", "sleep_minutes"},
}

def minimize(record: dict, purpose: str) -> dict:
if purpose not in POLICY:
raise ValueError(f"unknown purpose: {purpose}")
allowed = POLICY[purpose]
return {key: deepcopy(value) for key, value in record.items()
if key in allowed}






There are two important choices. The policy maps purposes to fields instead of maintaining one giant “safe” list. Also, an unknown purpose raises an error rather than returning the complete input. That second behavior is fail-closed.






Tests express the privacy rule



Place this beside the function in test_minimize.py, adjusting the import name to your file:




CODE
import unittest
from minimizer import minimize

RECORD = {
"date": "2026-07-20",
"steps": 4200,
"sleep_minutes": 395,
"medication": ["example-only"],
"note": "private free text",
}

class MinimizerTests(unittest.TestCase):
def test_activity_keeps_exact_fields(self):
out = minimize(RECORD, "activity_summary")
self.assertEqual(out, {"date": "2026-07-20", "steps": 4200})

def test_input_is_not_changed(self):
before = RECORD.copy()
minimize(RECORD, "sleep_summary")
self.assertEqual(RECORD, before)

def test_unknown_purpose_fails_closed(self):
with self.assertRaises(ValueError):
minimize(RECORD, "personalization")

if __name__ == "__main__":
unittest.main()






The intended command is python3 -m unittest -v. Because it was not run for this article, readers should treat the expected three successful tests as a target, not observed evidence.






Try the bad input first



Add "location_history": [...] to RECORD. The activity test should still expect exactly two output fields. If a future edit changes the implementation to return all fields, that equality assertion fails visibly. Next, add a policy typo such as activity_summry; the unknown-purpose test explains why silently guessing would be risky.



Common mistakes include deleting keys from the original dictionary, using record.get() for an unknown policy, and testing only that steps exists rather than checking the whole output. A minimizer test should detect extra information, not merely missing information.






What this teaches—and what it does not



After the exercise, a learner should be able to explain purpose limitation, field allowlists, fail-closed behavior, and negative tests. An extension is to represent each policy with an owner and expiry date, then reject expired policies.



This toy handles flat dictionaries only. It does not sanitize values, understand nested clinical formats, anonymize people, validate accuracy, secure files, enforce deletion, or integrate with any announced service. The sample values are fictional and provide no medical meaning. Never use the function as a production health-data control without a broader privacy and security review.



OpenAI says its health feature is designed to support rather than replace medical care and is not intended for diagnosis or treatment. This programming lesson likewise offers no medical advice and makes no clinical claim.



AI assistance disclosure: This article was drafted with AI assistance and reviewed against the cited primary source.

Vollständiger Original-Bericht
Ausführliche Details, Code-Beispiele & Hersteller-Stellungnahme auf dev.to.
↗ Original-Artikel auf dev.to lesen
Wie bewertest du diesen Beitrag?
1 Klick Feedback
Teilen mit Netzwerk & Team:

Community-Analysen & Experten-Meinungen 0

Verfasse deine eigene Analyse, teile Workarounds oder diskutiere diesen Vorfall im Blog.
Noch keine Community-Analyse verfasst. Markiere einen Textabschnitt oder klicke oben auf Eigene Analyse verfassen“!
Community Pulse: Relevanz-Einschätzung
1 Klick Experten-Votum
🔴 Akute Relevanz 0%
🟡 In Evaluierung 0%
🟢 Keine Auswirkung 0%
Spannende Innovation 0%
Verwandte Story-Cluster & Quellen (Vektor-KI)
Port 8095 Engine
3 Quellen
GPT-6 Astra Release Today? OpenAI’s Next Major AI Model Is Almost Here
1 Quelle
Apple accuses OpenAI of destroying evidence as trade-secrets fight intensifies
1 Quelle
Major AI platforms go down in unprecedented simultaneous outage