> ## 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.

# PII Engine (Enterprise)

> De-identification that runs in your AWS account: text in, typed placeholders out, originals sealed so only a separate, IAM-gated and audited rehydrate service can open them. Callers sign with their own IAM role through VPC Lattice.

**PII Engine (Enterprise)**: raw text → typed placeholders (`[FIRST_NAME_1]`, `[EMAIL_1]`) in place of the values it detects → the originals restored afterwards by a separate, audited service — all inside your own AWS account.

It ships as one container image from AWS Marketplace, deployed by you with Helm (EKS), CloudFormation (ECS) or Terraform (ECS). Callers reach it through Amazon VPC Lattice and sign every request as their own IAM role — there are no shared secrets. By default, Tenet has no IAM principal, network path, key grant or log subscription anywhere in the deployment; the one exception is usage telemetry, and only if you opt in. This documentation describes the current release.

## When to use it

Use it when text containing PII or PHI has to pass through a model or a third party, and your security review says the identifiers — and the keys to them — must never leave your account. De-identify before the LLM call, re-identify the reply for the person allowed to see it.

If you only need to know *where* the PII is, or to strip it irreversibly, the detect service alone is enough (`/detect`, `/redact`) and you can deploy without rehydration.

## Two services, one image

| | Detect service | Rehydrate service |
| - | - | - |
| `TENET_ROLE` | `detect` | `rehydrate` |
| Routes | `POST /detect`, `POST /redact`, `POST /deidentify`, `DELETE /sessions/{session_id}` | `POST /reidentify` |
| Who may call | Roles in the detect invoker list; erasure only for roles in the erasure invoker list | Roles in the rehydrate invoker list (plus break-glass), optionally only with an approval session tag |
| Returns stored plaintext | Never — and KMS denies it the key that would open the vault | Yes, after writing an audit record |
| KMS on vault keys | `kms:Encrypt` of new key pairs; `kms:Decrypt` of the lookup key only | `kms:Decrypt` of the lookup and private keys |
| Audit records | `tenet.erasure-audit.v1`, one per erasure | `tenet.reidentify-audit.v3`, one per call |
| Replicas (default) | ≥ 2, one per 4-vCPU Graviton node, spread across AZs | 2, small |
| Optional | No | Yes — turn it off and nothing for it is created |

Each service is its own VPC Lattice service, and Lattice forwards only that service's exact routes: `/reidentify` on the detect endpoint is a `404` that never reaches a task. Both serve HTTPS on port `19991` inside the VPC, and accept traffic only from VPC Lattice.

```text theme={null}
your app ──SigV4──► VPC Lattice ──► detect ──[EMAIL_1]…──► your app ──► LLM
                                      │  each value sealed to the vault key pair's public key
                                      ▼
                                 Aurora vault ◄── rehydrate ◄── VPC Lattice ◄──SigV4── allow-listed role
                                                      │
                                                      └──► S3 Object Lock: one audit record per call, written before plaintext is returned
```

## What never leaves your account

* **Payloads.** Raw, de-identified and restored text stay on your network. No NAT gateway, no internet route; AWS APIs are reached through VPC endpoints.
* **The placeholder map.** Stored only as HPKE ciphertext plus keyed digests in your Aurora cluster.
* **Keys.** Vault key pairs are wrapped by your customer-managed KMS key. Only the rehydrate role can unwrap a private key; Tenet can't decrypt anything.
* **Logs, audit records and usage counts.** Logs and audit records carry counts and identifiers, never values. Usage records are counts of documents by length and of findings per entity label, written to stdout or a local file.

Two things reach outside your VPC, neither carrying payload: AWS Marketplace metering (`MeterUsage` over a VPC endpoint — usage quantities only, see [Subscription and metering](https://docs.tenetlabs.com/pii-engine/concepts/billing.md)), and, only if you opt in on CloudFormation or Terraform, hourly usage counts sent to Tenet. See [Data flow](https://docs.tenetlabs.com/pii-engine/security/data-flow.md).

## Built for the failure case

* **No audit, no plaintext.** If the audit record can't be written, `/reidentify` returns `503` and restores nothing. An erasure that can't be audited doesn't happen either.
* **Least privilege enforced by KMS.** The detect role's key policy and IAM policy deny it the vault's private keys, so a compromised detect task can't read back what it stored — even with the database credentials. It still sees each request's text as it passes through.
* **Refuses unsafe configuration at startup.** Neither service starts without an Object Lock audit bucket, a valid caller allow-list, a password-free `TENET_VAULT_URL`, or the deployment id the vault was created with — and detect doesn't start without an active Marketplace subscription.

## Links

* [Quickstart — subscribe to first verified round trip](https://docs.tenetlabs.com/pii-engine/quickstart.md)
* [Using these docs with an AI agent](https://docs.tenetlabs.com/pii-engine/agents.md)
* [Prerequisites](https://docs.tenetlabs.com/pii-engine/deploy/prerequisites.md)
* [Placeholders and sessions](https://docs.tenetlabs.com/pii-engine/concepts/placeholders-and-sessions.md)
* [Rehydration and audit](https://docs.tenetlabs.com/pii-engine/concepts/rehydration-and-audit.md)
* [Architecture](https://docs.tenetlabs.com/pii-engine/concepts/architecture.md)
* [API Reference](https://docs.tenetlabs.com/pii-engine/api-reference/introduction.md)

## Which deployment path

| Path | Platform | Use when |
| - | - | - |
| [Helm](https://docs.tenetlabs.com/pii-engine/deploy/eks-helm.md) | Amazon EKS, EC2 managed node groups (Graviton), AWS Gateway API Controller | You already run EKS. The primary path. You bring the KMS key, Aurora, audit bucket and IAM roles. |
| [CloudFormation](https://docs.tenetlabs.com/pii-engine/deploy/ecs-cloudformation.md) | ECS on EC2 (Graviton), one template | You want the whole stack — KMS key, Aurora, audit bucket, endpoints, VPC Lattice, services — from one template. |
| [Terraform](https://docs.tenetlabs.com/pii-engine/deploy/terraform.md) | ECS on EC2, reusable module | Same shape as the CloudFormation template, for Terraform shops. |


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