File size: 7,170 Bytes
7194297
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
# Privacy & Biometric Data Notice — Sentinel-AI

Sentinel-AI processes **face images and biometric embeddings**. In many
jurisdictions that is special-category or sensitive personal data even when the
person is not named. This document is an engineering checklist, not legal
advice. Obtain a jurisdiction-specific review before any real-world use.

---

## 1. What the system processes

| Data | Where it goes | Retention |
|------|---------------|-----------|
| Uploaded frame (`/analyze-frame`) | Processed in memory; decoded, detected, embedded, discarded | Not persisted by the API |
| Face embedding (512-D vector) | Generated in memory; compared with the FAISS index | Not persisted per request |
| FAISS index | `backend/index_artifacts/` on the local disk | Until deleted by the operator |
| CelebA metadata + images | `Data/` on the local disk | Until deleted by the operator |
| Matched attributes | Sent to Gemini/Groq/Cohere to draft an alert | Provider retention depends on your account/plan |
| Generated person image (`/generate-person`) | Returned as base64; optionally saved to `backend/uploads/` | Until deleted by the operator |
| Logs | Client IP, timestamps, provider error text | Operator-defined |

The uploaded face image itself is **not** sent to the LLM providers. Only the
matched attribute list and similarity score are sent when drafting an alert.
`/generate-person` sends the user's text prompt to Google.

The FAISS index contains CelebA-derived embeddings and attribute labels. It does
not contain the raw dataset images; images are served from `CELEBA_IMAGES_DIR`
when explicitly requested.

---

## 2. Legal frameworks to review

At minimum, evaluate:

- **GDPR / UK GDPR** — face images and embeddings can be biometric data under
  Article 9; identify a lawful basis and a condition for processing, run a DPIA,
  and document retention.
- **Illinois BIPA** — written notice, written consent, a public retention and
  destruction policy, and no sale/profit from biometric identifiers.
- **Texas CUBI / Washington My Health My Data / other US state laws** — notice,
  consent, and retention rules vary.
- **CCPA/CPRA** — notice at collection, access/deletion rights, and limits on
  sensitive data use.
- **Workplace / school / public-space rules** — surveillance notice, works
  council consultation, and prohibitions in some locations.
- **CelebA dataset terms** — the dataset is licensed for non-commercial research.
  Do not use it for commercial identification, and do not imply that the
  depicted celebrities are suspects.

If you cannot establish a lawful basis and consent/notice, do not deploy the
system on real people.

---

## 3. Required operator controls

### Consent and notice

- Post a clear notice before capture: what is collected, why, who can access it,
  how long it is kept, and how to request deletion.
- For employees, contractors, or students, obtain written consent where required
  and make alternatives available.
- Do not use the system on children or vulnerable people without a specific
  legal basis.

### Purpose limitation

Use the system only for the stated security purpose (for example, verifying a
person at a controlled entry point). Do not repurpose embeddings for emotion
inference, marketing, or unrelated background checks.

### Retention and deletion

- Set a retention period for generated alerts, uploads, and logs.
- Delete `backend/uploads/` files and generated reports on schedule.
- Provide a deletion procedure for a person's biometric data and confirm it in
  writing.
- Deleting a `--save_to_disk` generated image is not enough if it was copied to
  backups; include backups in the retention policy.

### Access control

- Enable `SENTINEL_API_KEY`, rate limits, TLS, and a reverse proxy before any
  shared use.
- Restrict who can read `Data/`, `backend/index_artifacts/`, `backend/uploads/`,
  and logs.
- Do not expose `/images/{id}` publicly: it serves identifiable celebrity photos.
- Do not put provider keys in the frontend.

### Accuracy and human review

- Face matching is probabilistic. The default threshold is calibrated for
  CelebA-style portraits, not for CCTV, low light, masks, or children.
- Re-tune `MATCH_SIMILARITY_THRESHOLD` on your own camera footage and measure
  false accepts and false rejects by demographic group where lawful and ethical.
- Never take an automated enforcement action (denial of entry, alert to police,
  employment decision) solely on the model's output. Require human verification.
- Display confidence and expose the underlying attributes so an operator can
  challenge a bad match.

### Security

- Encrypt disks and backups containing images, embeddings, or logs.
- Rotate provider keys and the API token; see [SECURITY.md](SECURITY.md).
- Log access to biometric data and review it.
- Do not send face images or embeddings to third-party analytics.

---

## 4. Generated faces and deepfakes

`/generate-person` creates synthetic portraits. Depending on the prompt, the
output may resemble a real person. Do not use it to impersonate, harass, or
mislead. Label synthetic media, obtain consent for likeness, and comply with
applicable disclosure laws. The endpoint is optional and can be disabled by
removing the router or blocking the route at the proxy.

---

## 5. Research/demo use

For a hackathon demo:

- Use the bundled CelebA data and clearly state that it is a research dataset.
- Do not display a real attendee's face as a "suspect" without consent.
- Prefer a synthetic or volunteer image for live uploads.
- Do not retain demo uploads or alerts after the session.
- Treat any live camera feed as biometric data even if it is not stored.

---

## 6. Data subject requests

Prepare a simple process to:

1. Verify the requester's identity without collecting more biometric data.
2. Search `backend/uploads/`, logs, and any exported reports for their data.
3. Delete or correct the data and confirm completion.
4. Record the request and outcome for accountability.

Because the API does not persist per-request uploads or embeddings, most requests
will concern index membership, generated files, or logs. Document that fact.

---

## 7. Incident response

If biometric data is exposed:

1. Contain the exposure (revoke tokens, take the endpoint offline).
2. Preserve evidence without copying sensitive data further.
3. Assess whether notification is required (GDPR 72 hours where applicable;
   BIPA and state breach laws may also apply).
4. Notify affected people and the relevant authority if required.
5. Fix the root cause, rotate credentials, and update this document.

---

## 8. Open questions for your legal review

- What is the lawful basis and retention period for each data type?
- Is the deployment in a public, workplace, school, or retail context?
- Are there local bans or restrictions on face recognition?
- Do you need a DPIA, works council consultation, or vendor data-processing
  agreement with Google/Groq/Cohere?
- Will any data leave your jurisdiction? Provider regions matter.
- How will you handle a false match that caused harm?

Answer these before processing real people's faces.