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

# Quickstart

> Subscribe, deploy with CloudFormation, then prove it works from inside your VPC: a signed de-identify → re-identify round trip through VPC Lattice and the audit record that names your IAM role.

**Goal**: one de-identify → re-identify round trip inside your own AWS account, signed with your own IAM role, with the audit record to prove it happened. This path uses the [CloudFormation template](https://docs.tenetlabs.com/pii-engine/deploy/ecs-cloudformation.md) because it creates every dependency in one stack. Plan on about an hour, most of it Aurora and stack creation.

You need:

* An AWS account and Region where you can create IAM roles, a KMS key, Aurora, ECS, VPC Lattice and VPC endpoints.
* A VPC with **DNS hostnames enabled**, private subnets in at least two AZs that VPC Lattice supports, and **no route to a NAT or internet gateway**. [Prerequisites](https://docs.tenetlabs.com/pii-engine/deploy/prerequisites.md).
* **On-Demand vCPU quota** (Standard instances) for at least 12 vCPUs: each detect task fills a `c9g.xlarge`, two of them take 8, and rehydration needs one more instance.
* A **test host inside that VPC** — the services have no public endpoint. An EC2 instance you reach through Session Manager works; set `EnableSsmEndpoints=true` below. It needs Python 3.11+, `boto3`, `jq`, the AWS CLI and the `tenet-pii-lattice` client (`pip install https://platform.tenetlabs.com/enterprise/current/tenet_pii_lattice.tar.gz`). The VPC has no internet path, so install them before the host loses it, bake them into the AMI, or copy the files in.
* An IAM role for that host (the *test client role*). The stack names it as a detect, rehydrate and erasure invoker and as the audit reader; you attach the stack's caller policies to it after deploy.
* On your workstation: `aws` CLI v2, `jq` and [`cosign`](https://docs.sigstore.dev/cosign/system_config/installation/) v3.

Run this quickstart with a coding agent — it asks for your values, deploys, verifies, and stops before anything irreversible.

Deploy Tenet PII Engine (Enterprise) into my AWS account with the CloudFormation quickstart and verify one signed de-identify → re-identify round trip. Follow [https://docs.tenetlabs.com/pii-engine/quickstart](https://docs.tenetlabs.com/pii-engine/quickstart.md) exactly.

Before running anything, ask me for: AWS Region; VpcId and VpcCidr; one private subnet id per AZ (at least 2) and their route table ids; KeyAdminRoleArn (the role that runs the stack); the test client role ARN (used for DetectInvokerRoleArns, RehydrateInvokerRoleArns, ErasureInvokerRoleArns and AuditReaderRoleArn) and the instance id of the test host that runs as it; an S3 bucket I own in the Region for the template; a DeploymentId (3–63 chars, lowercase letters, digits, hyphens — it can never change later); whether this is a trial stack I'll delete.

Steps:

1. Check no subnet route table has a 0.0.0.0/0 route to a NAT or internet gateway (`aws ec2 describe-route-tables --route-table-ids ...`). If one does, stop and tell me. Check each subnet's AZ ID is supported by VPC Lattice (for example, use1-az3 in us-east-1 is not); if not, stop.
2. Download cosign.pub, the release record and its .sigstore.json bundle, and the CloudFormation template from [https://platform.tenetlabs.com/enterprise](https://platform.tenetlabs.com/enterprise) (paths on [https://docs.tenetlabs.com/pii-engine/get-started/marketplace](https://docs.tenetlabs.com/pii-engine/get-started/marketplace.md)). Run `cosign verify-blob --key cosign.pub --insecure-ignore-tlog --bundle tenet-pii-enterprise.release.sigstore.json tenet-pii-enterprise.release.json`; it must print Verified OK. Compare the record's `.image.digest` with what Marketplace serves for the record's `.image.tag` (`aws ecr batch-get-image`, as on that page). Stop if either check fails. In every Region, ImageUri is the record's `.image.repository` + `@` + `.image.digest` — never copy the image. Outside us-east-1 the stack creates cross-Region ECR and S3 endpoints to us-east-1; check the deploying role may (`vpce:AllowMultiRegion`, which Administrator and PowerUser roles have) and stop if not.
3. Check `c9g.xlarge` is offered in the Region (`aws ec2 describe-instance-type-offerings --location-type region --filters Name=instance-type,Values=c9g.xlarge`); if not, use InstanceType=c8g.xlarge. Check Aurora PostgreSQL 16.15 is offered (`aws rds describe-db-engine-versions --engine aurora-postgresql --query "DBEngineVersions[?EngineVersion=='16.15'].EngineVersion"`); if not, ask me which version to use. Look up the S3 and VPC Lattice prefix-list ids for the Region.
4. Show me the full `aws cloudformation deploy` command with every parameter filled in and wait for my explicit approval. It must include `--s3-bucket <a bucket I own in the Region>`, `--capabilities CAPABILITY_NAMED_IAM CAPABILITY_AUTO_EXPAND`, LatticePrefixListId, EnableSsmEndpoints=true, and for a trial stack AuroraDeletionProtection=false VaultDeletionPolicy=Delete AuditObjectLockMode=GOVERNANCE.
5. After CREATE\_COMPLETE, from my workstation: read the DetectEndpoint, RehydrateEndpoint, AuditBucket, LatticeClientSecurityGroupId, DetectCallerPolicy and RehydrateCallerPolicy outputs. Show me the change, then (after I approve) attach both caller policies to the test client role as inline policies and add LatticeClientSecurityGroupId to the test host's security groups. Check readiness: both ECS services at their desired count, and every target in the detect and rehydrate Lattice target groups HEALTHY.
6. On the test host: `python -m tenet_pii_lattice "$DETECT_ENDPOINT" deidentify` with a synthetic sample containing a name and an email; then `reidentify` with the returned text and session\_id against the RehydrateEndpoint; confirm the restored text equals the original and `restored` equals the number of placeholders.
7. List the newest object under s3://\$AUDIT\_BUCKET/rehydrate/ and print it. Confirm schema tenet.reidentify-audit.v3, outcome "restored", auth\_mode "lattice-iam", a caller ARN for the test client role, and no session\_id and no text.
   Never print database credentials or real data. Report the stack outputs, the readiness checks, and the round-trip results.

**1. Subscribe**

Subscribe on the [Tenet PII Engine listing in AWS Marketplace](https://aws.amazon.com/marketplace/pp/prodview-slrerbt3xmb3m) (choose **View purchase options**), or accept your private offer, from the account you deploy into. There's nothing to configure for billing: the detect service checks the subscription at startup through the `metering-marketplace` VPC endpoint the stack creates, and refuses to start without it. [Billing](https://docs.tenetlabs.com/pii-engine/concepts/billing.md).

**2. Download and verify the release**

Download the signing key, the signed release record and the template, verify the record, and take the image digest from it:

```bash theme={null}
export AWS_REGION=us-east-1   # your deployment Region
BASE=https://platform.tenetlabs.com/enterprise
REC=tenet-pii-enterprise.release
curl -sO "$BASE/cosign.pub"
curl -sO "$BASE/current/$REC.json"
curl -sO "$BASE/current/$REC.sigstore.json"
curl -sO "$BASE/current/tenet-pii-enterprise.yaml"

cosign verify-blob --key cosign.pub --insecure-ignore-tlog --bundle "$REC.sigstore.json" "$REC.json"
# → Verified OK
IMAGE_URI="$(jq -r .image.repository "$REC.json")@$(jq -r .image.digest "$REC.json")"   # by digest, never by tag
```

That Marketplace image is your `ImageUri` in every Region — don't copy it. Outside `us-east-1` the stack reaches it through cross-Region endpoints it creates, which needs `vpce:AllowMultiRegion` on the role that runs the stack ([The image in every Region](https://docs.tenetlabs.com/pii-engine/get-started/marketplace.md#the-image-in-every-region)). Comparing the record with the digest Marketplace serves, and why the Marketplace copy carries no signature: [Verify the release](https://docs.tenetlabs.com/pii-engine/get-started/marketplace.md#verify-the-release).

**3. Deploy the stack**

Use the `tenet-pii-enterprise.yaml` you downloaded. It's over CloudFormation's inline size limit, so `--s3-bucket` must name a bucket you own in the Region (`TEMPLATE_BUCKET`).

```bash theme={null}
pl() { aws ec2 describe-managed-prefix-lists --region "$AWS_REGION" \
  --filters Name=prefix-list-name,Values=com.amazonaws.$AWS_REGION.$1 \
  --query 'PrefixLists[0].PrefixListId' --output text; }
TEST_ROLE=arn:aws:iam::<account-id>:role/pii-test-client

aws cloudformation deploy \
  --stack-name tenet-pii \
  --template-file tenet-pii-enterprise.yaml \
  --s3-bucket "$TEMPLATE_BUCKET" \
  --capabilities CAPABILITY_NAMED_IAM CAPABILITY_AUTO_EXPAND \
  --parameter-overrides \
    VpcId=vpc-0123 VpcCidr=10.0.0.0/16 \
    PrivateSubnetIds=subnet-a,subnet-b PrivateRouteTableIds=rtb-a,rtb-b \
    S3PrefixListId=$(pl s3) LatticePrefixListId=$(pl vpc-lattice) \
    KeyAdminRoleArn=arn:aws:iam::<account-id>:role/PlatformAdmin \
    ImageUri="$IMAGE_URI" \
    DeploymentId=acme-trial-use1 \
    DetectInvokerRoleArns=$TEST_ROLE RehydrateInvokerRoleArns=$TEST_ROLE \
    ErasureInvokerRoleArns=$TEST_ROLE AuditReaderRoleArn=$TEST_ROLE \
    EnableSsmEndpoints=true \
    AuroraDeletionProtection=false VaultDeletionPolicy=Delete AuditObjectLockMode=GOVERNANCE   # trial only
```

Run it as `KeyAdminRoleArn`. `CAPABILITY_AUTO_EXPAND` is required — the template uses the `AWS::LanguageExtensions` transform. `DeploymentId` is bound into every KMS call and can never change on this vault. Every parameter: [ECS with CloudFormation](https://docs.tenetlabs.com/pii-engine/deploy/ecs-cloudformation.md).

**4. Authorize the test host and check readiness**

A caller needs its role in the services' auth policies (done by the invoker parameters above) **and** `vpc-lattice-svcs:Invoke` in its own IAM policy, plus a network path to VPC Lattice. From your workstation:

```bash theme={null}
out() { aws cloudformation describe-stacks --stack-name tenet-pii --region "$AWS_REGION" \
  --query "Stacks[0].Outputs[?OutputKey=='$1'].OutputValue" --output text; }
aws iam put-role-policy --role-name pii-test-client --policy-name tenet-detect-caller --policy-document "$(out DetectCallerPolicy)"
aws iam put-role-policy --role-name pii-test-client --policy-name tenet-rehydrate-caller --policy-document "$(out RehydrateCallerPolicy)"
# Add LatticeClientSecurityGroupId to the test host's ENI (keep its existing groups):
echo "$(out LatticeClientSecurityGroupId)"
echo "DETECT_ENDPOINT=$(out DetectEndpoint) REHYDRATE_ENDPOINT=$(out RehydrateEndpoint) AUDIT_BUCKET=$(out AuditBucket)"
```

The health probes aren't routed through VPC Lattice, so check readiness where it's reported — ECS and the Lattice target groups, which health-check `/readyz`:

```bash theme={null}
CLUSTER=$(out ClusterName)
aws ecs describe-services --cluster "$CLUSTER" --services detect rehydrate --region "$AWS_REGION" \
  --query 'services[].{name:serviceName,running:runningCount,desired:desiredCount}'
for tg in tenet-pii-detect tenet-pii-rehydrate; do
  id=$(aws vpc-lattice list-target-groups --region "$AWS_REGION" --query "items[?name=='$tg'].id" --output text)
  aws vpc-lattice list-targets --target-group-identifier "$id" --region "$AWS_REGION" --query 'items[].status'
done
# → every target "HEALTHY": model loaded, vault reachable
```

**5. De-identify, then re-identify**

On the test host, running as the test client role. The client signs each request with SigV4 for `vpc-lattice-svcs`:

```bash theme={null}
TEXT='Email Jane Doe at jane@example.com about the invoice.'
DEID=$(echo "$TEXT" | python -m tenet_pii_lattice "$DETECT_ENDPOINT" deidentify)
echo "$DEID" | jq '{text, session_id}'
# → {"text": "Email [FIRST_NAME_1] [LAST_NAME_1] at [EMAIL_1] about the invoice.", "session_id": "AbC…"}

# Send .text — never the raw input — to your LLM. Then restore the reply:
echo "$DEID" | jq -r .text \
  | python -m tenet_pii_lattice "$REHYDRATE_ENDPOINT" reidentify "$(echo "$DEID" | jq -r .session_id)"
# → {"text": "Email Jane Doe at jane@example.com about the invoice.\n", "session_id": "AbC…", "restored": 3, "unresolved": []}
```

Exact placeholders depend on what the model detects. The restored text must equal the original. A `403` means the role, its identity policy or the network path is missing — see the gotchas.

**6. Read the audit record**

Every re-identify call writes one object to the Object Lock bucket **before** the response is returned:

```bash theme={null}
KEY=$(aws s3api list-objects-v2 --bucket "$AUDIT_BUCKET" --prefix rehydrate/ \
  --query 'sort_by(Contents,&LastModified)[-1].Key' --output text)
aws s3 cp "s3://$AUDIT_BUCKET/$KEY" - | jq
```

```json theme={null}
{"schema": "tenet.reidentify-audit.v3", "auth_mode": "lattice-iam", "request_id": "…", "session_ref": "<32 hex>",
 "caller": "arn:aws:sts::<account-id>:assumed-role/pii-test-client/i-0abc…",
 "caller_account": "<account-id>", "caller_org_id": null,
 "source_vpc": "arn:aws:ec2:us-east-1:<account-id>:vpc/vpc-0123…", "upstream_request_id": "<uuid>",
 "outcome": "restored", "placeholders_requested": 3, "restored": 3, "unresolved": 0,
 "timestamp_utc": "2026-11-12T12:34:56.789Z", "engine_version": "<engine version>"}
```

The record names your role session and holds counts and a keyed digest of the session — never the `session_id`, never a value. `upstream_request_id` joins it to the Lattice access log in `/<NamePrefix>/lattice`.

## Gotchas

* **No host in the VPC, no test.** The Lattice services resolve and route only inside VPCs associated with the service network. Calls from your laptop fail by design.
* **`403` on the first call** means one of three things is missing: the role in the invoker list, the caller policy on the role (a same-account caller needs both), or `LatticeClientSecurityGroupId` on the host. The response doesn't say which; the service's WARNING log line does when the request got that far.
* **Trial settings are not production settings.** `AuditObjectLockMode=COMPLIANCE`, `AuroraDeletionProtection=true` and `VaultDeletionPolicy=Snapshot` for anything real.
* **A detect replica fills a `c9g.xlarge`.** Rollouts replace tasks in place at 50% minimum healthy, so capacity halves during a deploy. [Upgrades](https://docs.tenetlabs.com/pii-engine/operate/upgrades.md).

## Next

* [Production deploy on EKS with Helm](https://docs.tenetlabs.com/pii-engine/deploy/eks-helm.md)
* [Size the detect service for your traffic](https://docs.tenetlabs.com/pii-engine/operate/sizing.md)
* [Who can rehydrate, and how it's audited](https://docs.tenetlabs.com/pii-engine/concepts/rehydration-and-audit.md)
* [What to alarm on](https://docs.tenetlabs.com/pii-engine/operate/monitoring.md)


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