> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tenetlabs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Data flow

> Where PHI and PII go in a PII Engine (Enterprise) deployment, what is stored where and for how long, who can read it, and what leaves the account — laid out for a HIPAA risk analysis.

**Data flow summary**: text containing PHI enters the detect service from your application through VPC Lattice, signed by the caller's IAM role, and is replaced with placeholders. The originals are stored only as sealed values in your Aurora vault for the session TTL — sealed so that only the rehydrate service can open them. Plaintext comes back out only through the rehydrate service, to callers its auth policy names, after an audit record is written. Every hop is inside your AWS account and encrypted in transit.

## When to use it

As input to your HIPAA Security Rule risk analysis, a data-protection impact assessment, or a vendor review. It describes this product's flows; how your application handles the returned text is yours to add.

## Inventory

| Data | Contains PHI? | Where it exists | Encryption | Retention | Who can read it |
| - | - | - | - | - | - |
| Request text to `/detect`, `/redact`, `/deidentify` | Yes | In transit caller → Lattice → detect; in detect process memory during the request | TLS caller → Lattice (AWS-managed certificate) and Lattice → task (the task's self-signed certificate) | Request lifetime only | Detect process |
| De-identified text (response) | Possibly — undetected identifiers remain | Your app, your LLM provider | Yours | Yours | Yours |
| `findings` (offsets, labels, confidence) | No values; offsets point into your text | Response to your app | — | Yours | Yours |
| Vault values | Yes | Aurora (`tenet_pii_mappings`) | Sealed per value with HPKE to the key pair's public key, bound to its session and placeholder; storage encrypted with your CMK | Session TTL (sliding, 1 h default; max 7 days) plus your Aurora backup window | Only the rehydrate service — KMS denies detect the private key |
| Vault dedupe digests | No (keyed HMAC) | Aurora | HMAC-SHA256 under the lookup key | Session TTL | — |
| `session_id` | No, but a capability for re-identification | Your app | Yours | Until expiry | Re-identifies only for a caller the rehydrate auth policy admits |
| Wrapped lookup and private keys, public keys | No | Aurora (`tenet_pii_vault_meta`) | Lookup and private keys wrapped by your CMK, each under its own encryption context | Forever | KMS, for roles your key policy allows (private key: rehydrate only) |
| Restored text (`/reidentify` response) | Yes | In transit rehydrate → Lattice → caller | TLS on both hops | Request lifetime | Rehydrate invokers and break-glass |
| Audit records | No PHI — ids, `session_ref` digest, counts, the caller's role session ARN, account, source VPC | S3 Object Lock bucket; service stdout → logs | SSE-KMS (your CMK) | Object Lock retention (templates: 6 years) | Audit reader role |
| Lattice access logs | No PHI — caller principal, path, status, request id | `/<NamePrefix>/lattice` (or your EKS destination) | Your CMK in the templates | `LogRetentionDays` | Your log readers |
| Service logs | No — counts, ids, AWS error codes | CloudWatch Logs or your log store | Your CMK in the templates | `LogRetentionDays` (templates: 365) | Your log readers |
| Usage records | No — documents by length, findings per entity label | stdout or a local file; Tenet only if you opt in | — | Yours | Yours; Tenet with the opt-in |
| Usage reported to AWS | No — quantities per usage dimension | AWS Marketplace Metering Service | TLS via PrivateLink | AWS-managed | AWS and Tenet see usage quantities, not data |

**Caller identities are personal data too.** Audit records and Lattice access logs carry the caller's role session ARN, and an SSO session name is often an email address. Treat them as workforce identifiers in your assessment, and prefer `sts:SourceIdentity` for human callers.

## Flows

```text theme={null}
1. App ──SigV4, text with PHI──► Lattice ──► detect ──► Aurora: sealed value + digest   [E22, E23, E5]
                                              └──► KMS: unwrap lookup key (no payload)    [E7]
2. detect ──placeholders──► App ──placeholders──► your LLM provider                     [yours]
3. Caller ──SigV4, placeholders + session_id──► Lattice ──► rehydrate ──► Aurora: read   [E22, E23, E6]
                                              ├──► KMS: unwrap private key (no payload)   [E8]
                                              ├──► S3 Object Lock: audit record (before reply) [E11]
                                              └──► restored PHI ──► caller
4. detect ──► AWS Marketplace metering: usage quantities only                           [E9]
5. (opt-in) detect ──► Tenet: hourly counts-only usage records                          [NAT path]
```

Edge numbers refer to the [architecture edge table](https://docs.tenetlabs.com/pii-engine/concepts/architecture.md#every-network-edge).

## What leaves your account

* **Nothing from the product carries PHI or PII out.** No payload, placeholder map, key, log line or audit record is sent to Tenet or any third party.
* **Metering** reaches AWS Marketplace over PrivateLink with usage quantities per dimension and your AWS identity. [Billing](https://docs.tenetlabs.com/pii-engine/concepts/billing.md).
* **Usage telemetry, only if you opt in** (CloudFormation and Terraform): the detect service sends the same hourly counts-only records it writes locally — documents by length, findings per entity label, deployment id, versions — through a NAT gateway. Off by default. [Monitoring](https://docs.tenetlabs.com/pii-engine/operate/monitoring.md).
* **Your LLM call is yours.** The de-identified text you send to a model leaves under your own agreements. It contains whatever the detector didn't catch — see [Attestation](https://docs.tenetlabs.com/pii-engine/security/attestation.md).

## Safeguards mapped to the flows

| Risk | Safeguard |
| - | - |
| Interception in transit | HTTPS end to end: caller → Lattice on an AWS-managed certificate, Lattice → task on the task's ephemeral certificate (Lattice doesn't verify target certificates; the hop stays inside your VPC); TLS to Aurora (`sslmode=require`). |
| Vault exfiltration | Values are HPKE-sealed; the private key exists only wrapped by your CMK and in rehydrate's memory. Even with the database credentials, a compromised detect task can't open a stored value. |
| Unauthorized re-identification | Per-request IAM identity (no shared secret), auth policy per route and source VPC, optional approval tag on every call, app-side allow-list re-check, network admits only Lattice, `/reidentify` not mounted on detect. |
| Unauthorized erasure | Separate erasure invoker list; every erasure audited before it runs. |
| Unrecorded re-identification | Audit-before-plaintext: no record, no response (`503`). Object Lock retention. Each record names the caller's role session. |
| Insider deletion of evidence | Object Lock retention — set `COMPLIANCE` mode in production; the templates default to `GOVERNANCE`. Bucket policy denies `BypassGovernanceRetention`. |
| Vendor access | None: no Tenet principal, network path, key grant or log subscription (unless you opt in to usage telemetry egress). |
| Residual identifiers | Detector recall is not 100%. Measure on your data; treat de-identified output as potentially containing PHI until you have. |

Draft the data-flow section of a HIPAA risk analysis from this page and my deployment.

Draft the data-flow and safeguards section of my HIPAA risk analysis for Tenet PII Engine (Enterprise), using only facts from [https://docs.tenetlabs.com/pii-engine/security/data-flow](https://docs.tenetlabs.com/pii-engine/security/data-flow.md) and [https://docs.tenetlabs.com/pii-engine/concepts/architecture](https://docs.tenetlabs.com/pii-engine/concepts/architecture.md) plus what I tell you.

Ask me for: which deployment path we used; the session TTL; Aurora backup retention; audit Object Lock mode and retention; log retention (service and Lattice access logs); which roles are in the detect, erasure and rehydrate invoker lists and whether the approval tag is required; whether a break-glass role exists; whether usage telemetry egress is on; whether human callers use SSO sessions (their names appear in audit records); which LLM provider receives de-identified text and under what agreement.

Produce: (1) a data inventory table with my actual values; (2) a flow description; (3) a risk/safeguard table; (4) a "residual risks" list that includes detector recall on our data, the session\_id as a re-identification capability for any admitted caller, the detect service seeing request plaintext in memory, the detect service's ability to test guesses of low-entropy values against a session's dedupe digests, caller ARNs as workforce identifiers in audit and access logs, and the telemetry NAT path if egress is on. Do not state or imply that the product makes us HIPAA compliant or that output is de-identified; write "Safe Harbor–aligned posture" where relevant. Mark anything you could not confirm as "to confirm".

## Links

* [Architecture](https://docs.tenetlabs.com/pii-engine/concepts/architecture.md)
* [Shared responsibility](https://docs.tenetlabs.com/pii-engine/security/shared-responsibility.md)
* [Rehydration and audit](https://docs.tenetlabs.com/pii-engine/concepts/rehydration-and-audit.md)
* [What the attestation does and does not certify](https://docs.tenetlabs.com/pii-engine/security/attestation.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.