---
id: data-privacy
name: Data Privacy
version: 1.0.0
summary: |
  External Presidio system that detects and anonymizes personally identifiable
  information in the Reviews feedback-summarization and Chat agent pipelines.
scope: external
owners:
  - platform-engineering-team
services:
  - id: presidio-api
    version: 1.0.0
badges:
  - content: External
    backgroundColor: purple
    textColor: purple
    icon: GlobeAltIcon
---

## System Purpose & Boundary

The Data Privacy system provides external personally identifiable information (PII) detection and anonymization for BookWorm's AI agent pipelines using Microsoft Presidio. It serves internal AI-hosting systems—[[system|chat-system]] and [[system|rating-system]]—by screening prompts and model responses before they reach foundation models or end users. Owning customer feedback, storing conversation transcripts, and modifying persisted domain records are explicitly out of scope.

:::warning
BookWorm's PII middleware executes **fail-closed**: any timeout, connection error, or non-success response from Presidio aborts the AI turn rather than sending unscreened text to foundation models or customers.
:::

## Contained Capabilities

| Service / Agent           | Role in System                                                                      | Primary Data Store | Interaction Style (Sync / Async) |
| :------------------------ | :---------------------------------------------------------------------------------- | :----------------- | :------------------------------- |
| [[service\|presidio-api]] | External HTTP sidecar boundary exposing PII entity detection and text anonymization | None (Stateless)   | Sync (Internal HTTP)             |

## External Interactions & Trust Boundaries

- **AI pipeline consumers:** Invoked deterministically by PII middleware on behalf of [[agent|qa-agent]], [[agent|book-agent]], [[agent|book-catalog-researcher]], and [[agent|book-recommendation-researcher]] in [[system|chat-system]], and [[agent|rating-agent]] in [[system|rating-system]].
- **Scoped runtime usage:** BookWorm's integration targets email addresses, phone numbers, and credit-card numbers; broader upstream Presidio capabilities do not imply all recognizers are enabled in BookWorm.
- **No public exposure:** Presidio sidecars are internal-only and not routed through the public API Gateway; raw text and detected PII must never be written to routine logs.

## System Visualizations

### System Context

<ContextDiagram />

### Component Topology

<NodeGraph />

### Architecture Decisions

<ADRTable />

## Related Documentation

- [[service|presidio-api]] — External sidecar endpoints, consumers, and fail-closed semantics.
- [[system|chat-system]] — Conversational AI consumer of PII screening.
- [[system|rating-system]] — Review summarization consumer of PII screening.
