Layered controls across the trust boundary
| Layer | Description |
|---|---|
| 1. Map | Identify every path by which PII can enter a prompt or tool-call payload. |
| 2. Contract | Pursue provider-side retention opt-outs and verify their exact scope. |
| 3. Transform | Detect and redact or tokenize PII before inference. |
| 4. Enforce | Route all model traffic through a gateway that applies policy. |
| 5. Evidence | Log decisions so the controls can be demonstrated, not assumed. |
Start by mapping where PII enters prompts
Identify every path by which PII can enter a prompt or tool-call payload.
Provider-side controls: useful, but bounded
Providers generally offer some combination of retention controls: agreements that limit or eliminate storage of prompts and completions, approval processes that modify abuse monitoring, and regional or dedicated deployment options. These are worth pursuing, particularly for workloads that must send regulated data to a model.
Treat each as conditional until proven otherwise. Eligibility can depend on the account type, the contract, the specific model, the endpoint, and the features in use. Approval may be required, and exceptions may apply to some data categories or functions. Documentation changes over time, so confirm the current terms with each provider and obtain the scope in writing rather than relying on a general statement.
Implement the enterprise-side layers
Detect and redact or tokenize PII before inference. Then route all model traffic through a gateway that applies policy.
Enforce at a gateway, not in each application
Per-application filtering drifts. Different teams use different libraries, and agents assemble context in places developers do not review. A gateway or proxy that is the only permitted egress path to model providers gives you one place to inspect assembled requests, apply policy, and record decisions.
Three design points determine whether this works:
- Restrict direct network egress to provider endpoints so the gateway cannot be bypassed.
- Bind policy to workload and data classification, so a workload approved to send certain data under a retention agreement is treated differently from one that is not.
- Decide the failure mode: fail closed for high-sensitivity workloads, and accept explicit, logged exceptions elsewhere.
Governance and regulatory alignment
Audit evidence to retain
Log decisions so the controls can be demonstrated, not assumed. Retain the following:
- Inventory of workloads, providers, models, and the data classes each is permitted to send
- Copies of provider retention terms and approvals, with scope and dates
- Gateway logs recording policy decision, detected entity types, and action taken, without storing the raw PII
- Detection test results and false-negative rates, reviewed on a set schedule
- Egress rules showing that model traffic cannot bypass the gateway
- Records of exceptions, including approver and expiry