feat(privacy): S4 — Sensitive-data approval arm + audit trail (#4256)
Slice 4 of epic #4256.
Goal
When Privacy Mode = Sensitive, require approval before identifiable content leaves the machine, and record whether the user approved each sensitive transfer. Delivers parent AC2 + AC3. Reuses the existing approval gate + audit store.
Approach
- In
Sensitivemode, route external transfers of identifiable content through the existingApprovalGate(src/openhuman/approval/) — park, prompt, decide. - Record approve/deny in the existing SQLite audit store; extend the audit row with transfer destination + data-kind.
- Surface the sensitive-transfer trail in
ApprovalHistoryPanel.tsx.
Files (approx)
security/policy/ (sensitive arm keying off S2 egress descriptor), approval/ (audit row extension), app/.../ApprovalHistoryPanel.tsx.
Acceptance criteria delivered
- [ ] Sensitive-data mode requires approval before identifiable content leaves (parent AC2)
- [ ] Each sensitive external transfer records the approval decision (parent AC3)
- [ ] Policy tests: allowed / prompted / blocked sensitive-transfer cases (parent AC7)
- [ ] Diff coverage >= 80%
Dependencies
S1 (mode) + S2 (egress metadata). Reuses approval gate.
Part of #4256.
Closing as won't-do. Product direction (confirmed with @senamakel): no interruptive approval prompts on tool calls or external transfers — the agent should adapt and proceed, not ask per action, as it materially hurts UX. This slice's core was a Sensitive-mode approve/deny prompt before identifiable content leaves, which is exactly the interaction we're avoiding. The silent privacy infra already on main (mode setting, egress spine #4436, local-only enforcement #4441) stays. If privacy gating returns it must be silent/adaptive (auto-keep-local or auto-redact, no dialog), not a prompt.