openhuman icon indicating copy to clipboard operation
openhuman copied to clipboard

privacy: Sensitive mode does not gate model prompts (needs a dispatch-time egress hook)

Open oxoxDev opened this issue 4 months ago • 1 comments

Context

Slice S4 of the privacy epic (#4438) gave PrivacyMode::Sensitive its first behaviour: an outbound payload is scanned locally for identification risk, and a Medium/High transfer parks on the approval gate before it leaves the device.

S4 wired that arm into tool-call, cloud-embedding and agent network-fetch egress. It does not cover model prompts, which is the highest-volume egress path in the product. This issue tracks closing that gap.

Why it was not covered in S4

The inference path builds its EgressDescriptor at provider/model construction time, not at request dispatch:

  • src/openhuman/inference/provider/factory.rs (~:700, :1407, :2647) calls emit_external_transfer while resolving a provider.
  • At that point the prompt does not exist yet, so there is nothing to scan and nothing to approve. The descriptor can only name the destination.
  • The crate owns dispatch, so there is no in-tree seam today between "prompt assembled" and "request sent".

emit.rs's own dedup_turn_scope doc already names the shape of this problem: a candidate tier can be disclosed at construction and never actually dispatched to, "inherent to emitting at build time rather than at request dispatch".

What is needed

A dispatch-time egress hook — a seam that runs once per outbound inference request, with the assembled prompt in hand, where the existing helpers can be applied in the established order:

let desc = attach_risk_if_sensitive(EgressDescriptor::inference(provider, model, true), &prompt_text);
enforce_egress(&desc)?;                  // S7 local-only
enforce_egress_sensitive(&desc).await?;  // S4 sensitive approval arm
emit_external_transfer(desc);            // S2 disclosure

Everything on the right-hand side already exists and is tested (security::egress::{risk, sensitive}). The work is the seam, not the policy.

Design notes / constraints:

  • Prompts are large and per-turn; the scan must stay behind the existing attach_risk_if_sensitive Sensitive-mode guard so Standard (the default) pays nothing.
  • Construction-time disclosure should probably move to (or be complemented by) the dispatch hook, which would also close the "disclosed but never dispatched" over-reporting the dedup scope currently bounds.
  • The unattended rule must hold: a park with no chat surface fails open and logs, rather than stalling a cron/CLI turn (enforce_egress_sensitive already handles this).

Impact

Until this lands, Sensitive mode's approval arm covers tool/embedding/network egress only. Users may reasonably read "heightened caution for sensitive data" as including what is typed into chat. It does not yet. The mode's doc-comment in config/schema/privacy.rs states this limitation explicitly so the gap is not silently overclaimed.

Related

  • Epic: privacy #4256
  • S4 (this gap's parent): #4438
  • S2 egress spine: #4436 / S5 detector: #4439 / S7 enforcement: #4441

oxoxDev avatar Jul 15 '26 13:07 oxoxDev

Closing — the prompt-based sensitive-transfer gate this tracked is not being pursued. Product direction (per maintainer) is no interruptive approval prompts on tool calls / egress; the agent adapts rather than asking. The S4 approval-arm work is shelved, so this dispatch-hook follow-up is moot.

oxoxDev avatar Jul 16 '26 10:07 oxoxDev