Prominent privacy controls and sensitive-data mode for professional users
Summary
Make privacy controls prominent and understandable, especially for patient, legal, financial, family, and other sensitive information.
A user should always be able to tell what stays local, what may be sent to an external model or service, which service receives it, whether it contains identifiable information, and whether the transfer was approved.
Problem
OpenHuman's local-first philosophy is a major differentiator, but professional users need the privacy model to be visible at the moment of use. Doctors, lawyers, financial professionals, and families cannot rely on vague trust when sensitive information might leave the machine.
Scope
- Privacy status surface showing local vs external processing for the active task.
- Per-action disclosure of model/service destination before external transfer.
- User approval trail for sensitive data transfer.
- Identification risk indicator for documents or prompts that may contain patient, legal, financial, family, or other sensitive data.
- Anonymisation/redaction workflow before external processing.
- Special privacy mode for patient, legal, financial, and family information.
- Policy integration with existing approval, autonomy, and workspace security controls.
Acceptance criteria
- [ ] Before external model/service use, the UI can show the destination provider/service and why it is needed.
- [ ] Sensitive-data mode can require approval before identifiable content leaves the local machine.
- [ ] The system records whether the user approved each sensitive external transfer.
- [ ] The app offers an anonymisation/redaction step before external processing of sensitive documents.
- [ ] Privacy mode applies consistently across chat, tool calls, file workflows, and desktop automation where data transfer may occur.
- [ ] Local-only mode has clear behavior when a requested action cannot be completed without external services.
- [ ] The implementing PR includes policy tests for allowed, prompted, and blocked sensitive-transfer cases.
- [ ] Diff coverage >= 80% on changed lines.
Implementation design — phased breakdown
This is an epic: the 7 acceptance criteria span config, the policy engine, egress plumbing, a PII classifier, a redaction workflow, UI, and audit. It can't land as one PR. This comment records a slice breakdown so the work can ship incrementally, each slice a reviewable PR with its own tests.
What already exists (reuse, don't rebuild)
- Approval gate (
src/openhuman/approval/) — parks external-effect tool calls, prompts the user (approve once / always / deny), persists an audit trail in SQLite, and surfaces viaApprovalRequestCard+ApprovalHistoryPanel. EmitsDomainEvent::ApprovalRequested { request_id, tool_name, action_summary, args_redacted, thread_id }. - Security policy engine (
src/openhuman/security/policy/) —AutonomyLevel {ReadOnly, Supervised, Full},CommandClass,GateDecision {Allow, Prompt, Block},SecurityPolicy. Hot-reloadable vialive_policy.rs(install/current/reload_from). Config inconfig/schema/autonomy.rs. - Frontend privacy surface —
PrivacyPanel.tsx(capability catalog, local-vs-external data-kind badges),SecurityPanel,AgentAccessPanel(autonomy tier), settings registry groupagentsAutonomy. ReusableConnectionIndicator(status pill),ConfirmDialog/ModalShell,CoreStateProvider+callCoreRpc. Disclosure text inapp/src/features/privacy/whatLeavesItems.ts.
Gap analysis
| Need | Status |
|---|---|
| Privacy posture (local-only / standard / sensitive) | Missing — autonomy tier is orthogonal (governs act power, not data-egress posture) |
| Per-action destination disclosure ("goes to provider X because Y") | Missing — gate shows the tool name, not the external destination/reason |
| PII / identification-risk detection | Missing |
| Redaction / anonymisation step | Missing |
| Local-only enforcement | Missing — no flag; egress happens at many scattered points, not one choke |
| Sensitive-transfer approval + audit | Partial — approval gate + audit store exist, but no sensitive-data arm keys off them |
Egress is not a single funnel. Current external-transfer points: LLM inference (inference/provider/compatible_provider_impl.rs), integrations (composio/client.rs, integrations/client.rs), network tools (tools/impl/network/*), embeddings (embeddings/cloud.rs). Consistent coverage (AC5) requires centralizing egress metadata.
Slices
S1 — Privacy Mode foundation + local-only enforcement for model calls (small–medium)
- Add
PrivacyMode {LocalOnly, Standard, Sensitive}to config (defaultStandard, back-compat serde default). Thread intoSecurityPolicy+live_policyhot-reload (this is the "policy integration with existing controls" the issue asks for). - Enforce at the inference chokepoint:
LocalOnly+ externally-resolved provider → typed block with a clear "needs external provider X; switch to a local model or change privacy mode" message. - Privacy Mode selector in
PrivacyPanel.tsx; RPC get/set mirroringconfig_*_autonomy_settings. - Files:
config/schema/privacy.rs(new),config/schema/types.rs,security/policy/types.rs,security/live_policy.rs, new RPC module + schema registration,app/.../PrivacyPanel.tsx,app/src/services/rpcMethods.ts. - Delivers the core of AC6 for the inference path. Foundation — unblocks S2/S3/S4/S7.
S2 — Egress descriptor + disclosure event (medium)
- Define
EgressDescriptor { provider_slug, service, is_external, reason, data_kinds }produced at each egress point; emit aDomainEventbefore external transfer. The spine for consistent coverage. - Files: new descriptor type in
security/orinference/, wiring at each egress point, event-bus subscriber. - Foundation for AC1 and AC5.
S3 — Privacy status surface + per-action destination disclosure UI (medium)
- Persistent pill (local vs external for the active task) reusing
ConnectionIndicator; pre-transfer disclosure dialog reusingConfirmDialog; wired to S2 events. - Delivers AC1. Depends on S1 + S2.
S4 — Sensitive-data approval arm + audit trail (medium)
- When mode =
Sensitive, route external transfers of identifiable content through the existing approval gate; record approve/deny in the existing audit store; surface inApprovalHistoryPanel. - Delivers AC2 + AC3. Depends on S1 + S2, reuses approval gate.
S5 — PII / identification-risk detector (medium–large)
- Classifier over prompt/document content → risk flag/score; feeds S3's indicator and S4's gate trigger.
- Delivers the "identification risk indicator" scope item. Consumed by S3/S4.
S6 — Redaction / anonymisation workflow (large)
- Offer a redaction step before external processing of sensitive documents.
- Delivers AC4. Depends on S5.
S7 — Local-only enforcement across integrations + network tools (medium)
- Extend S1's local-only block from inference to
composio/integrationsclients and network tools, with graceful "cannot complete without external service X" messaging. - Completes AC5 + AC6. Depends on S1 + S2.
Dependency graph
S1 ─┬─> S3 (S3 also needs S2)
├─> S4 (S4 also needs S2)
└─> S7 (S7 also needs S2)
S2 ─┴─> S3, S4, S7
S5 ──> S6
Recommended order: S1 → S2 → S3 → S4 → S7 → S5 → S6. S1 and S2 are the two roots; S1 is the smallest self-contained foundation and is the recommended first PR.
AC → slice mapping
| AC | Slice |
|---|---|
| AC1 destination disclosure before transfer | S2 + S3 |
| AC2 sensitive-mode approval before identifiable content leaves | S4 |
| AC3 record approval per sensitive transfer | S4 |
| AC4 anonymisation/redaction step | S5 + S6 |
| AC5 consistent across chat/tools/files/automation | S2 + S7 |
| AC6 local-only clear behavior | S1 (inference) + S7 (full) |
| AC7 policy tests allowed/prompted/blocked, ≥80% diff cov | every slice |
Each slice will honestly mark only the ACs it actually delivers; enforcement ACs won't be ticked by foundation-only slices.
Slice tracking — child issues filed
The epic is broken into 7 implementation slices, each its own PR-sized issue (assigned @oxoxDev):
| Slice | Issue | Delivers |
|---|---|---|
| S1 | #4435 | Privacy Mode config + policy + local-only inference enforcement (foundation) |
| S2 | #4436 | Egress descriptor + disclosure event (foundation) |
| S3 | #4437 | Privacy status surface + per-action destination disclosure UI (AC1) |
| S4 | #4438 | Sensitive-data approval arm + audit trail (AC2, AC3) |
| S5 | #4439 | PII / identification-risk detector |
| S6 | #4440 | Redaction / anonymisation workflow (AC4) |
| S7 | #4441 | Local-only enforcement across integrations + tools (AC5, AC6 full) |
Sequence: S1 → S2 → S3 → S4 → S7 → S5 → S6. S1 and S2 are the roots; S1 is first.
Closing the epic. Outcome after building through it and aligning with @senamakel on UX:
SHIPPED (silent infra, on main): Privacy Mode setting incl. Sensitive (S1 #4435), egress descriptor spine (S2 #4436), PII/identification-risk detector library (S5 #4439), local-only enforcement across integrations + tools (S7 #4441).
DECLINED (interruptive UI — product decision, no per-action prompts): in-chat disclosure card + status pill (S3 #4437, reverted in #4874), sensitive-transfer approval arm (S4 #4438), redaction-review dialog (S6 #4440).
Net: local-only mode enforces silently; the disclosure/approval/redaction UX is intentionally not pursued. Reopen or file a fresh issue if a SILENT/adaptive privacy behaviour (e.g. auto-keep-local / auto-redact without a dialog) is wanted later.