Sub topic 9
Privacy, Safety, and Compliance Risk
Assume you understand how software features are built and have basic familiarity with machine learning and large language models. This chapter focuses on deciding whether the risks of an AI feature are acceptable before you choose a model or ship a prototype.
Separate the three kinds of risk
Privacy concerns how the feature collects, uses, stores, and shares information about people. Personal data is information that can identify a person, such as an email address, voice recording, location, or account history. Some data, such as health or financial information, needs stronger protection.
Safety concerns whether the feature can cause harm through incorrect, biased, abusive, or unsafe behavior. For example, a support assistant might give dangerous medical advice, expose one customer's data to another customer, or confidently invent a policy.
Compliance concerns whether the feature follows laws, contracts, and internal rules. Requirements may control where data is stored, how long it is retained, whether users must give consent, and whether a human must review a decision.
These categories overlap, but they require different controls.
| Risk | Example failure | Possible control |
|---|---|---|
| Privacy | A prompt contains a customer's full account history | Remove unnecessary fields and restrict access |
| Safety | The model gives unsafe instructions | Refuse high-risk requests and add human review |
| Compliance | A regulated decision cannot be explained | Keep an audit trail and require an approved process |
Map data and decisions before testing
Draw the feature's data flow. Identify where data enters, which services process it, where outputs go, and how long records remain available. Include model providers, logging systems, analytics tools, and human reviewers. A hosted model provider may process your data outside your own infrastructure, so its contract and retention policy matter.
Ask these questions:
- What is the minimum data needed for the task?
- Can you remove names, contact details, or identifiers before inference?
- Will prompts or outputs be used for training?
- Who can view inputs, outputs, logs, and evaluation examples?
- Can a user request deletion or correction?
- What happens when the model is unavailable or wrong?
- Does the output recommend an action, or does it make the decision automatically?
A recommendation usually permits more oversight than an automatic denial, diagnosis, or account suspension. The higher the impact on a person, the stronger the review, explanation, appeal, and audit requirements should be.
Design controls for failure
Do not treat a model's refusal behavior as the entire safety plan. Use layered controls:
- Validate input size, type, and authorization before sending data.
- Filter or redact sensitive information when it is not needed.
- Limit what tools and records the model can access.
- Validate structured outputs before using them in software.
- Route uncertain or high-impact cases to a trained reviewer.
- Provide a deterministic fallback when the model fails.
- Log enough information to investigate incidents without creating a second privacy problem.
Evaluate realistic misuse as well as ordinary requests. Include prompt injection, where untrusted text tries to override the feature's instructions, and data leakage through generated responses.
Make risk a decision criterion
Reject or redesign the AI approach when you cannot obtain required consent, cannot control a provider's data use, cannot explain important decisions, or cannot provide a safe fallback. A lower-risk design might use redacted data, a private deployment, retrieval from approved documents, or rules for the final decision.
Record the assumptions behind the choice. Revisit them when the feature gains new users, handles new data, reaches a new country, or changes from suggestions to automatic actions.
Exercise
A model summarizes customer support tickets. It receives names and order numbers, and summaries are stored indefinitely. What should you change before a pilot?
Show answer
Remove identifiers unless they are required, confirm the model provider's data-use and retention terms, restrict access to summaries, set a retention period, and test for accidental disclosure before launch.