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

# Deploy on EKS with Helm

> Install the tenet-pii-enterprise Helm chart on Amazon EKS: detect and rehydrate as separate Deployments with separate IRSA roles, each behind its own VPC Lattice service with a per-route IAM auth policy.

**The Helm chart**: two Deployments from one image — detect (≥ 2 replicas) and, optionally, rehydrate (2 replicas) — each with its own ServiceAccount, IRSA role, PodDisruptionBudget, NetworkPolicy and VPC Lattice service. Callers sign every request with their own IAM role; Lattice checks a per-route IAM auth policy before anything reaches a pod.

## When to use it

You run Amazon EKS with EC2 managed node groups. This is the primary deployment path. The chart creates Kubernetes objects only (the AWS Gateway API Controller turns its routes into VPC Lattice services); the KMS key, Aurora cluster, audit bucket, IAM roles and VPC endpoints are yours to provide — this page shows each, and [Prerequisites](https://docs.tenetlabs.com/pii-engine/deploy/prerequisites.md) has the full list. Don't reuse the audit bucket or key from a CloudFormation or Terraform install: their policies admit only the ECS roles, so every rehydrate and erase call would return `503`.

Install the chart on an EKS cluster — collects your values, renders, and stops before installing into production.

Install the Tenet PII Engine (Enterprise) chart on Amazon EKS, following [https://docs.tenetlabs.com/pii-engine/deploy/eks-helm](https://docs.tenetlabs.com/pii-engine/deploy/eks-helm.md).

Ask me for: kube context; namespace (default tenet-pii) and release name (default tenet; the service accounts are `tenet-pii-enterprise-detect` / `-rehydrate` whatever the release is called, and the IRSA trust policies name them); whether the cluster is production; AWS Region; deploymentId (3–63 chars, lowercase letters/digits/hyphens; must match the tenet:deployment value in the IAM KMS conditions and can never change); KMS key ARN; Aurora writer endpoint (database `tenet`, no password in the URL); the detect and rehydrate IRSA role ARNs (they must differ); the VPC Lattice Gateway name and namespace; the IAM role ARNs allowed to call detect, rehydrate and erase; the caller VPC ids; whether to require the tenet-approval-id session tag; the audit bucket (Object Lock); the subnet CIDRs holding the VPC endpoint ENIs and Aurora; whether rehydration should be enabled at all.

1. Preflight, read-only: `kubectl get nodes -L kubernetes.io/arch,node.kubernetes.io/instance-type,topology.kubernetes.io/zone` shows arm64 c8g.xlarge nodes in ≥ 2 zones (4 with rehydration, 2 without); a NetworkPolicy enforcer is running (aws-node with enableNetworkPolicy=true, or Calico); the Gateway API CRDs and the AWS Gateway API Controller are installed and the Gateway shows Programmed with an HTTPS listener named https on 443 that allows routes from all namespaces; the node (or pod) security group admits tcp/19991 from the VPC Lattice prefix list, and the prefix list's entries are within lattice.peerCidrs; `aws iam get-role` succeeds for both role ARNs and their trust policies name this cluster's OIDC provider and the right service accounts; VPC endpoints for kms, sts, metering-marketplace, logs, vpc-lattice, tagging and the S3 gateway exist, and ecr.api and ecr.dkr reach us-east-1 (outside us-east-1: cross-Region interface endpoints for com.amazonaws.us-east-1.ecr.api, .ecr.dkr and .s3).
2. Verify the release record ([https://docs.tenetlabs.com/pii-engine/get-started/marketplace](https://docs.tenetlabs.com/pii-engine/get-started/marketplace.md)) and pull the chart from the Marketplace registry with `helm pull`; check its Digest: line equals the record's `.chart.digest`.
3. Create the namespace and the tenet-vault-db Secret from files (keys `username`, `password`), as on the page. Ask me for the credentials or the Secrets Manager secret to read them from. Never echo secret values.
4. Look up the S3 prefix-list CIDRs for the Region and write values.yaml exactly in the shape on the page, with image.digest from the release record; leave image.repository as the chart sets it, in every Region.
5. Run `helm lint` and `helm template ... -f values.yaml` and fix any schema errors. Show me the rendered Deployments' images, env var names and resources, and the two IAMAuthPolicy documents.
6. STOP and ask for explicit approval before `helm upgrade --install ... --wait --timeout 15m`. If the cluster is production, ask a second time and confirm the release name and namespace.
7. After install: `kubectl -n <ns> exec deploy/<release>-tenet-pii-enterprise-detect -- tenet-pii-enterprise healthcheck --ready` exits 0 (same for rehydrate); print each HTTPRoute's lattice-assigned-domain-name annotation; every pod's imageID ends in the record's `.image.digest`. If I set an access log destination, check `kubectl get accesslogpolicy` and run the same `helm upgrade` once more if any show TargetNotFound.
8. Show me the caller identity policies (vpc-lattice-svcs:Invoke on each service ARN, from `aws vpc-lattice list-services`) and ask before attaching them. Then, from a workload running as an allowed caller role, run `python -m tenet_pii_lattice https://<detect domain> deidentify` with synthetic text, then `reidentify` against the rehydrate domain with the returned text and session\_id, and confirm the round trip restores the original text.
   Report what you created and anything that failed.

## What it creates

| Object | detect | rehydrate (only if `rehydration.enabled`) |
| - | - | - |
| Deployment | ≥ 2 replicas, zone-spread; CPU `3500m` request / `4` limit; memory `3Gi` / `4Gi` | 2 replicas, zone-spread; CPU `1` / `2`; memory `3Gi` / `4Gi` |
| ServiceAccount | `tenet-pii-enterprise-detect` (whatever the release is called; `detect.serviceAccount.name` overrides), IRSA → detect role. AWS Marketplace meters through it. | `tenet-pii-enterprise-rehydrate`, IRSA → rehydrate role |
| Service | `ClusterIP`, port `19991`, only as the Lattice backend | The same |
| PodDisruptionBudget | `minAvailable: 1` | `minAvailable: 1` |
| NetworkPolicy | Ingress: `lattice.peerCidrs` only. Egress: DNS, AWS endpoints (443), the DB, S3 (erasure records), and public addresses on 443 only with `telemetry.egress.enabled` | The same, with S3 for re-identify records |
| VPC Lattice | HTTPRoute (one exact rule per route: `POST /detect`, `/redact`, `/deidentify`, `DELETE /sessions/…`), TargetGroupPolicy (HTTPS, health check `/readyz`), IAMAuthPolicy (callers per route), optional AccessLogPolicy. Lattice service name `<release>-tenet-pii-enterprise-detect`. | The same, for `POST /reidentify` |
| HPA (optional) | CPU target 60% | — |

With `rehydration.enabled=false` the chart renders nothing for rehydrate. Detection, de-identification and erasure still work fully.

## Before you install

1. **Subscribe and verify the release.** [Subscribe and get the image](https://docs.tenetlabs.com/pii-engine/get-started/marketplace.md). Detect refuses to start in an account that isn't subscribed.
2. **Node group: EC2 managed nodes on arm64, `c8g.xlarge`**, Kubernetes ≥ 1.29, not Fargate. Use `c8g.xlarge`, not `c9g.xlarge`: on Graviton5 the VPC CNI network policy agent can fail a map write with `ENOMEM` and never retry, leaving a rehydrate caller blocked until the next policy change ([aws-network-policy-agent issue](https://github.com/aws/aws-network-policy-agent/issues/686)). It fails closed, but callers time out; ECS isn't affected. With rehydration on, run **four nodes, two in each of two AZs** — each detect pod fills a node, and rehydrate's zone spread needs a free node in each AZ. That's 16 vCPUs: check your On-Demand Standard vCPU quota, and leave headroom if node group updates add a surge node. Pick AZs VPC Lattice supports (not `use1-az3` in us-east-1).
3. **A NetworkPolicy enforcer.** `enableNetworkPolicy=true` on the Amazon VPC CNI add-on, or Calico. Without one, the policies render but nothing enforces them.
4. **An IAM OIDC provider** for the cluster. AWS Marketplace metering accepts IRSA only — not EKS Pod Identity, not the node role. Only detect meters.
5. **VPC endpoints** with private DNS: interface `kms`, `sts`, `metering-marketplace`, `ecr.api`, `ecr.dkr`, `logs`, `vpc-lattice` and `tagging`, plus an S3 gateway endpoint. The image and chart come from AWS Marketplace in `us-east-1` in every Region: **outside `us-east-1`**, make `ecr.api` and `ecr.dkr` cross-Region interface endpoints whose service Region is `us-east-1` (`com.amazonaws.us-east-1.ecr.api`, `com.amazonaws.us-east-1.ecr.dkr`) and add a `com.amazonaws.us-east-1.s3` interface endpoint for the image layers, with an endpoint policy allowing `s3:GetObject` on `prod-us-east-1-starport-layer-bucket/*`. Creating them needs `vpce:AllowMultiRegion` (Administrator and PowerUser roles have it). With no internet route the nodes also need `ec2` and `eks`, plus `eks-auth` if you use EKS Pod Identity add-ons. Give the interface endpoints a security group that admits 443 from the VPC. Detect doesn't start without `metering-marketplace`. [Prerequisites](https://docs.tenetlabs.com/pii-engine/deploy/prerequisites.md#vpc-endpoints).
6. **A customer-managed KMS key.**
7. **The vault**: Aurora PostgreSQL (the templates use Serverless v2, `16.15`), encrypted with the KMS key, with a database named `tenet` — the URL below names it. Allow the cluster security group on 5432. The engine needs a database user that can create tables in `tenet`. An RDS-managed master password rotates every 7 days and leaves the Kubernetes Secret stale: sync it (for example with External Secrets Operator) or use a user whose password you manage.
8. **The audit bucket**: S3 with Object Lock and default encryption with the same KMS key. `COMPLIANCE` mode in production; `GOVERNANCE` lets you delete a trial afterwards.

## Set up VPC Lattice

Once per cluster:

1. **Install the Gateway API CRDs** (v1.5.0 or later, standard channel) and the [AWS Gateway API Controller](https://www.gateway-api-controller.eks.aws.dev/) v2.1.4, with its own IRSA role and the VPC Lattice permissions its documentation lists. In a cluster with no internet route, copy its image into your own ECR first. The controller needs the `vpc-lattice` and `tagging` endpoints: without `tagging` no Lattice service appears and the pods restart while they wait for it.

2. **Create the GatewayClass and Gateway.** The Gateway becomes a VPC Lattice service network, and the controller associates the cluster's VPC with it. A VPC can join only one service network — if yours already has one, name the Gateway after it. The routes live in the release namespace, so the listener must allow routes from other namespaces. Lattice serves the listener with an AWS-managed certificate; the chart attaches its routes only to `lattice.gateway.sectionName` (default `https`), never to an HTTP listener. Wait for the Gateway to show `Programmed`.

   ```yaml gateway.yaml theme={null}
   apiVersion: gateway.networking.k8s.io/v1
   kind: GatewayClass
   metadata:
     name: amazon-vpc-lattice
   spec:
     controllerName: application-networking.k8s.aws/gateway-api-controller
   ---
   apiVersion: gateway.networking.k8s.io/v1
   kind: Gateway
   metadata:
     name: tenet-pii
     namespace: lattice-system
   spec:
     gatewayClassName: amazon-vpc-lattice
     listeners:
       - name: https
         protocol: HTTPS
         port: 443
         allowedRoutes:
           namespaces: { from: All }
   ```

3. **Let VPC Lattice reach the pods** on 19991, in the security group the pods use — the node security group, or the pod security group with security groups for pods. The chart's NetworkPolicies then admit only `lattice.peerCidrs` (default `169.254.171.0/24`, `129.224.0.0/17`). If the last command prints other ranges, set `lattice.peerCidrs` to them.

   ```bash theme={null}
   LATTICE_PL=$(aws ec2 describe-managed-prefix-lists \
     --filters Name=prefix-list-name,Values=com.amazonaws.$AWS_REGION.vpc-lattice \
     --query 'PrefixLists[0].PrefixListId' --output text)
   aws ec2 authorize-security-group-ingress --group-id <node-security-group-id> \
     --ip-permissions "IpProtocol=tcp,FromPort=19991,ToPort=19991,PrefixListIds=[{PrefixListId=$LATTICE_PL}]"
   aws ec2 get-managed-prefix-list-entries --prefix-list-id "$LATTICE_PL" --query 'Entries[].Cidr' --output text
   ```

## Create the IAM roles

Two roles, each trusting your cluster's OIDC provider for one service account: `system:serviceaccount:tenet-pii:tenet-pii-enterprise-detect` and `system:serviceaccount:tenet-pii:tenet-pii-enterprise-rehydrate` (namespace `tenet-pii`). The chart uses these names whatever the release is called; set `detect.serviceAccount.name` / `rehydration.serviceAccount.name` only to run two releases in one namespace. The rehydrate trust policy is the same with the rehydrate service account.

```json Detect role trust policy theme={null}
{
  "Version": "2012-10-17",
  "Statement": [{
    "Effect": "Allow",
    "Principal": { "Federated": "arn:aws:iam::<account-id>:oidc-provider/<oidc-issuer-host-and-path>" },
    "Action": "sts:AssumeRoleWithWebIdentity",
    "Condition": { "StringEquals": {
      "<oidc-issuer-host-and-path>:aud": "sts.amazonaws.com",
      "<oidc-issuer-host-and-path>:sub": "system:serviceaccount:tenet-pii:tenet-pii-enterprise-detect"
    } }
  }]
}
```

Detect creates the vault's keys but can never decrypt a stored value: only rehydrate unwraps the private key. Keep detect's two `Deny` statements, and put them in the key policy as well, so no permission granted to the role later can undo them. If your key policy doesn't delegate to IAM, add the same KMS permissions there. Both roles look up their own VPC Lattice service at startup (`vpc-lattice:ListServices`).

```json Detect role policy theme={null}
{
  "Version": "2012-10-17",
  "Statement": [
    { "Effect": "Allow", "Action": "aws-marketplace:MeterUsage", "Resource": "*" },
    { "Effect": "Allow", "Action": "vpc-lattice:ListServices", "Resource": "*" },
    { "Effect": "Allow", "Action": "kms:Encrypt", "Resource": "<kms-key-arn>",
      "Condition": { "StringEquals": {
        "kms:EncryptionContext:tenet:purpose": ["pii-vault-lookup-key", "pii-vault-private-key"],
        "kms:EncryptionContext:tenet:deployment": "<deployment-id>" } } },
    { "Effect": "Allow", "Action": "kms:Decrypt", "Resource": "<kms-key-arn>",
      "Condition": { "StringEquals": {
        "kms:EncryptionContext:tenet:purpose": "pii-vault-lookup-key",
        "kms:EncryptionContext:tenet:deployment": "<deployment-id>" } } },
    { "Effect": "Deny", "Action": "kms:Decrypt", "Resource": "*",
      "Condition": { "StringEquals": { "kms:EncryptionContext:tenet:purpose": "pii-vault-private-key" } } },
    { "Effect": "Deny", "Action": ["kms:ReEncrypt*", "kms:CreateGrant"], "Resource": "*" },
    { "Effect": "Allow", "Action": "kms:GenerateDataKey", "Resource": "<kms-key-arn>",
      "Condition": { "StringEquals": { "kms:ViaService": "s3.<region>.amazonaws.com" } } },
    { "Effect": "Allow", "Action": "s3:GetBucketObjectLockConfiguration", "Resource": "arn:aws:s3:::<audit-bucket>" },
    { "Effect": "Allow", "Action": "s3:PutObject", "Resource": "arn:aws:s3:::<audit-bucket>/erasure/*" }
  ]
}
```

```json Rehydrate role policy theme={null}
{
  "Version": "2012-10-17",
  "Statement": [
    { "Effect": "Allow", "Action": "vpc-lattice:ListServices", "Resource": "*" },
    { "Effect": "Allow", "Action": "kms:Decrypt", "Resource": "<kms-key-arn>",
      "Condition": { "StringEquals": {
        "kms:EncryptionContext:tenet:purpose": ["pii-vault-lookup-key", "pii-vault-private-key"],
        "kms:EncryptionContext:tenet:deployment": "<deployment-id>" } } },
    { "Effect": "Allow", "Action": "kms:GenerateDataKey", "Resource": "<kms-key-arn>",
      "Condition": { "StringEquals": { "kms:ViaService": "s3.<region>.amazonaws.com" } } },
    { "Effect": "Allow", "Action": "s3:GetBucketObjectLockConfiguration", "Resource": "arn:aws:s3:::<audit-bucket>" },
    { "Effect": "Allow", "Action": "s3:PutObject", "Resource": "arn:aws:s3:::<audit-bucket>/rehydrate/*" }
  ]
}
```

Rehydrate has no `aws-marketplace:MeterUsage`: only detect checks the subscription and meters.

## Install

Pull the chart with the account that subscribed ([verify the release](https://docs.tenetlabs.com/pii-engine/get-started/marketplace.md#verify-the-release) first; `$REC` is the downloaded record):

```bash theme={null}
REGISTRY=$(jq -r .chart.repository "$REC.json" | cut -d/ -f1)
aws ecr get-login-password --region us-east-1 | helm registry login "$REGISTRY" --username AWS --password-stdin
helm pull "oci://$(jq -r .chart.repository "$REC.json")" --version "$(jq -r .chart.version "$REC.json")"   # Digest: must equal .chart.digest
```

Create the vault credentials from files, so the password never appears in a process list or your shell history:

```bash theme={null}
NS=tenet-pii
kubectl create namespace "$NS"
# DB_USER / DB_PASSWORD: a database user that can create tables in the tenet database
printf %s "$DB_USER" > user.txt; printf %s "$DB_PASSWORD" > password.txt
kubectl -n "$NS" create secret generic tenet-vault-db \
  --from-file=username=user.txt --from-file=password=password.txt
rm user.txt password.txt

# S3 address ranges for the NetworkPolicy (audit writes go through the S3 gateway endpoint)
PL=$(aws ec2 describe-managed-prefix-lists --filters Name=prefix-list-name,Values=com.amazonaws.$AWS_REGION.s3 \
      --query 'PrefixLists[0].PrefixListId' --output text)
aws ec2 get-managed-prefix-list-entries --prefix-list-id "$PL" --query 'Entries[].Cidr' --output text
```

The chart pulls straight from the Marketplace registry in `us-east-1`, in every Region — outside `us-east-1` through the cross-Region endpoints above. Set `image.digest` so it pulls by digest, and leave `image.repository` alone; don't copy the image ([The image in every Region](https://docs.tenetlabs.com/pii-engine/get-started/marketplace.md#the-image-in-every-region)).

```yaml values.yaml theme={null}
deploymentId: acme-prod-use1            # stable forever; pinned in the IAM KMS conditions
image:
  digest: sha256:<digest>               # the release record's .image.digest
aws:
  region: us-east-1
  kmsKeyArn: arn:aws:kms:us-east-1:<account-id>:key/<id>
vault:
  url: postgresql://<aurora-writer-endpoint>:5432/tenet?sslmode=require   # no password
  credentialsSecret: { name: tenet-vault-db }
lattice:
  gateway: { name: tenet-pii, namespace: lattice-system }
  detectInvokerRoleArns:    [arn:aws:iam::<account-id>:role/claims-app]            # POST /detect, /redact, /deidentify
  rehydrateInvokerRoleArns: [arn:aws:iam::<account-id>:role/claims-reviewer]       # POST /reidentify
  erasureInvokerRoleArns:   [arn:aws:iam::<account-id>:role/claims-retention-job]  # DELETE /sessions/{id}; empty = nobody
  allowedSourceVpcIds:      [vpc-<cluster VPC>]
  requireApprovalTag: true                # rehydration only from sessions tagged tenet-approval-id
  erasureAuditS3Uri: s3://<audit-bucket>/erasure/
detect:
  serviceAccount: { roleArn: arn:aws:iam::<account-id>:role/tenet-pii-detect }
rehydration:
  serviceAccount: { roleArn: arn:aws:iam::<account-id>:role/tenet-pii-rehydrate }
  auditS3Uri: s3://<audit-bucket>/rehydrate/
networkPolicy:
  awsEndpointCidrs: [10.0.0.0/19, 10.0.32.0/19, 10.0.64.0/19]   # subnets holding the endpoint ENIs
  databaseCidrs:    [10.0.0.0/19, 10.0.32.0/19, 10.0.64.0/19]   # subnets holding Aurora
  s3PrefixListCidrs: [<from the command above>]
```

```bash theme={null}
CHART=./tenet-pii-enterprise-$(jq -r .chart.version "$REC.json").tgz
helm lint "$CHART" -f values.yaml
helm upgrade --install tenet "$CHART" -n "$NS" -f values.yaml --wait --timeout 15m
kubectl -n "$NS" get pods
kubectl -n "$NS" get httproute \
  -o custom-columns='NAME:.metadata.name,DOMAIN:.metadata.annotations.application-networking\.k8s\.aws/lattice-assigned-domain-name'
```

The last command prints each service's domain name, such as `tenet-tenet-pii-enterprise-detect-0abc123.7d67968.vpc-lattice-svcs.us-east-1.on.aws`; it can take a minute to appear. On a first install, rehydrate pods wait up to two minutes for detect to create the first key (`vault keyring is empty; waiting …s for the detect role`), every pod may log `vault not ready yet` while Aurora comes up, and pods wait for the controller to create their Lattice service. That's expected.

Detection only: add `--set rehydration.enabled=false` and drop the rehydrate role, `auditS3Uri` and `rehydrateInvokerRoleArns`. Erasures are still audited, so keep the audit bucket, `lattice.erasureAuditS3Uri` and `networkPolicy.s3PrefixListCidrs`.

`values.schema.json` rejects an install missing a required input — region, CMK ARN, vault URL, the Gateway, the detect invoker roles, the source VPCs, the erasure audit URI, the rehydrate invoker roles and `auditS3Uri` when rehydration is on, or fewer than 2 detect replicas. Template guards reject the same IAM role for both services, a missing `networkPolicy.s3PrefixListCidrs`, and a Lattice service name over 40 characters (shorten it with `fullnameOverride`).

> [!NOTE]
>
> **With `lattice.accessLogDestinationArn`, check the access log policies after the first install:** `kubectl -n "$NS" get accesslogpolicy`. The controller can reconcile them before it has created the Lattice services, leave them at `TargetNotFound`, and not retry. Run the same `helm upgrade` once more after the HTTPRoutes carry a domain name; they then show `Accepted`.

## Verify

The health probes aren't routed through VPC Lattice, so check readiness inside the pods. Exit `0` means the model is loaded and the vault answers. Then check every pod runs the digest the release record names:

```bash theme={null}
kubectl -n "$NS" exec deploy/tenet-tenet-pii-enterprise-detect    -- tenet-pii-enterprise healthcheck --ready && echo detect ready
kubectl -n "$NS" exec deploy/tenet-tenet-pii-enterprise-rehydrate -- tenet-pii-enterprise healthcheck --ready && echo rehydrate ready
kubectl -n "$NS" get pods -o jsonpath='{range .items[*]}{.status.containerStatuses[0].imageID}{"\n"}{end}'   # each ends in .image.digest

dom() { kubectl -n "$NS" get httproute "tenet-tenet-pii-enterprise-$1" \
  -o jsonpath='{.metadata.annotations.application-networking\.k8s\.aws/lattice-assigned-domain-name}'; }
DETECT_ENDPOINT="https://$(dom detect)"; REHYDRATE_ENDPOINT="https://$(dom rehydrate)"
```

## Set up a caller

Each workload that calls the services — for example a pod with its own IRSA role — needs four things:

| What | How |
| - | - |
| Its role in an invoker list | `lattice.detectInvokerRoleArns`, `lattice.rehydrateInvokerRoleArns` or `lattice.erasureInvokerRoleArns`. The IAMAuthPolicy names these roles per route and method. IAM role ARNs only. |
| An identity policy on that role | `vpc-lattice-svcs:Invoke` on the service (below). The chart can't create it. A same-account caller needs both this and the auth policy; either alone is a `403`. |
| Its VPC allowed | In `lattice.allowedSourceVpcIds`, and associated with the Gateway's service network. The controller associates the cluster's VPC. |
| Signed requests | SigV4 for `vpc-lattice-svcs`, header `x-amz-content-sha256: UNSIGNED-PAYLOAD`, HTTPS on 443 to the service's domain name. |

The identity policy names the service ARN. The rehydrate one is the same with `tenet-tenet-pii-enterprise-rehydrate`:

```bash theme={null}
aws vpc-lattice list-services \
  --query "items[?name=='tenet-tenet-pii-enterprise-detect'].arn" --output text
```

```json Detect caller identity policy theme={null}
{
  "Version": "2012-10-17",
  "Statement": [{
    "Effect": "Allow",
    "Action": "vpc-lattice-svcs:Invoke",
    "Resource": "<detect-service-arn>/*"
  }]
}
```

Install the `tenet-pii-lattice` client (Python 3.11+, `boto3`) — with no internet route, build it into your application's image:

```bash theme={null}
pip install https://platform.tenetlabs.com/enterprise/current/tenet_pii_lattice.tar.gz
```

Then run the round trip as caller roles, from a pod in the cluster:

```bash theme={null}
DEID=$(echo "Follow up with Jane Smith (MRN 4482913) about her visit." \
  | python -m tenet_pii_lattice "$DETECT_ENDPOINT" deidentify)
echo "$DEID" | jq '{text, session_id}'
# → {"text": "Follow up with [FIRST_NAME_1] [LAST_NAME_1] ([MRN_1]) about her visit.\n", "session_id": "…"}
echo "$DEID" | jq -r .text \
  | python -m tenet_pii_lattice "$REHYDRATE_ENDPOINT" reidentify "$(echo "$DEID" | jq -r .session_id)"
```

Exact placeholders depend on what the model detects. Any SigV4 signer works in other languages. A refusal is a fixed `403`; a path outside the routes is a `404` from Lattice; calls to the Kubernetes Services directly are dropped by the NetworkPolicies.

## Values you'll actually change

| Value | Env var | Default | Notes |
| - | - | - | - |
| `deploymentId` | `TENET_DEPLOYMENT_ID` | — | Required. `^[a-z0-9][a-z0-9-]{2,62}$`. Never change it. |
| `image.digest` | — | empty | The release record's `.image.digest`. The Marketplace chart presets `image.repository` and `image.tag`. |
| `lattice.detectInvokerRoleArns` | — | `[]` | Required. Roles allowed `POST /detect`, `/redact`, `/deidentify`. IAM role ARNs only. |
| `lattice.rehydrateInvokerRoleArns` | `TENET_LATTICE_REIDENTIFY_PRINCIPALS` | `[]` | Required with rehydration. In the auth policy and the runtime's own allow-list. |
| `lattice.erasureInvokerRoleArns` | `TENET_LATTICE_ERASE_PRINCIPALS` | `[]` | `DELETE /sessions/{id}`. Empty = nobody can erase; sessions expire. |
| `lattice.allowedSourceVpcIds` | — | `[]` | Required. `vpc-lattice-svcs:SourceVpc` in every auth-policy statement. Include the cluster's VPC. |
| `lattice.requireApprovalTag` | — | `false` | Rehydration only from a role session tagged `tenet-approval-id`, checked by Lattice on every call. |
| `lattice.breakGlassRoleArn` | — | empty | A role you create (MFA-gated) that may rehydrate without the tag. [Break-glass](https://docs.tenetlabs.com/pii-engine/operate/break-glass.md). |
| `lattice.accessLogDestinationArn` | — | empty | CloudWatch Logs, S3 or Firehose ARN for Lattice access logs. |
| `lattice.peerCidrs` | `TENET_LATTICE_PEER_CIDRS` | `169.254.171.0/24`, `129.224.0.0/17` | The ranges Lattice connects from. NetworkPolicy ingress and the runtime's peer check both use them. |
| `telemetry.path` | `TENET_TELEMETRY_PATH` | empty = stdout | Counts-only usage records, always written locally. |
| `telemetry.egress.enabled` | — | `false` | Opt in to sending the usage records to Tenet. Detect only: adds the two env vars below and one NetworkPolicy rule, tcp/443 to `0.0.0.0/0` except `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`, `100.64.0.0/10` and `169.254.0.0/16`. Your node subnets need a route to a NAT gateway. [Setup](https://docs.tenetlabs.com/pii-engine/operate/monitoring.md#sending-usage-records-to-tenet). |
| `telemetry.egress.sinkUrl` | `TENET_TELEMETRY_SINK_URL` | `https://judge.tenetlabs.com` | https, no credentials, query or fragment. |
| `telemetry.egress.apiKeySecret.name` / `.key` | `TENET_TELEMETRY_API_KEY` | empty / `api-key` | Required with egress. A Secret in the release namespace holding a Tenet Platform API key. |
| `detect.replicaCount` | — | `2` | ≥ 2. One replica per 4-vCPU node. |
| `detect.autoscaling.enabled` | — | `false` | HPA on CPU, target 60% **of the request** (2.1 cores). |
| `detect.rollout.maxSurge` / `maxUnavailable` | — | `0` / `1` | Replace in place. See below. |
| `rehydration.enabled` | — | `true` | `false` renders nothing for rehydrate. |
| `detect.extraEnv` | — | `[]` | e.g. `TENET_PII_SERVE_VAULT_TTL` (seconds, default `3600`: a session lasts an hour after its last `/deidentify`). |

## Gotchas

* **A caller needs two grants.** Its role in the chart's invoker list (the IAMAuthPolicy) **and** `vpc-lattice-svcs:Invoke` on the service in its own IAM policy. One without the other is a `403`.
* **Pods that never become ready:** check the HTTPRoutes have a domain name. If not, the controller's logs usually name a missing endpoint (`tagging`, `vpc-lattice`) or permission. [Troubleshooting](https://docs.tenetlabs.com/pii-engine/troubleshooting.md#lattice-service-lookup-fails-on-eks).
* **Don't request a full `cpu: 4`.** The chart requests `3500m` with a `4` limit: a 4-CPU request can't schedule on a 4-vCPU node once the kubelet reserve and DaemonSets are counted, and pods sit `Pending`. The engine still sizes its thread pool to 4 from the limit.
* **Rollouts replace pods in place.** A detect pod fills its node, so a surge pod would sit `Pending` on every deploy. With `maxSurge: 0`, one replica is down while each pod restarts — deploy off-peak or scale up first. With Karpenter, Cluster Autoscaler or spare nodes, set `maxSurge: 1`, `maxUnavailable: 0`.
* **Kubelet probes vs. NetworkPolicy.** The policies admit only `lattice.peerCidrs`. Confirm your enforcer still admits kubelet → pod probe traffic; Calico does by default, test the VPC CNI policy agent on your cluster version.
* **IRSA with `automountServiceAccountToken: false`.** The pods never call the Kubernetes API, so the chart turns automount off. Confirm the pod identity webhook still injects its token: `kubectl -n "$NS" get pod -l app.kubernetes.io/component=detect -o yaml | grep aws-iam-token`.
* **`sslmode=require` encrypts but doesn't verify the server certificate.**
* **Version numbers.** `/healthz` and audit records report the detection engine's own version, not the product release's (the record's `.version`).
* **Clusters outside AWS aren't supported.** There's no Marketplace metering or IRSA path for them.

## Remove the release

`helm uninstall tenet -n tenet-pii` keeps your KMS key, vault and audit bucket. In `COMPLIANCE` mode nobody can delete audit objects until their retention ends; in `GOVERNANCE` mode an administrator can, with `--bypass-governance-retention`. To remove everything after a trial, delete in this order: the Helm release and namespace, the Gateway, the controller, the node group and cluster, the Aurora database, the audit bucket, the VPC endpoints and the VPC, then the IAM roles. Schedule the KMS key for deletion last.

## Security posture of the pods

Non-root UID/GID `10001`, `RuntimeDefault` seccomp, no privilege escalation, read-only root filesystem, all capabilities dropped. `/tmp` is a 512Mi `emptyDir`. Pods serve HTTPS with a certificate generated at startup; Lattice terminates the caller's TLS on 443. NetworkPolicy admits ingress only from VPC Lattice and blocks egress to IMDS, the internet and other pods. `AWS_STS_REGIONAL_ENDPOINTS=regional` keeps IRSA on the in-VPC STS endpoint. The chart never renders a credential.

## Links

* [Prerequisites](https://docs.tenetlabs.com/pii-engine/deploy/prerequisites.md)
* [Rehydration and audit](https://docs.tenetlabs.com/pii-engine/concepts/rehydration-and-audit.md)
* [Sizing](https://docs.tenetlabs.com/pii-engine/operate/sizing.md)
* [Upgrades](https://docs.tenetlabs.com/pii-engine/operate/upgrades.md)
* [Troubleshooting](https://docs.tenetlabs.com/pii-engine/troubleshooting.md)


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