Security
Zero-retention routing for sensitive data
Some prompts carry data that shouldn't be kept or trained on. The data_policy option restricts a request to providers that meet your rule, and here's how to use it well.
· 3 min read · Usefully team
Not every prompt is equal. A request that summarizes a public blog post can go to any provider. A request containing a customer's support ticket, a contract or health information probably shouldn't go to a provider that keeps prompts or may use them for training. Usefully lets you say so per request, with one option, and enforces it in routing.
The option
Add a provider object with a data_policy to any chat request. It takes one of three values:
zdr: only route to providers with zero data retention for this request.no_training: only route to providers that don't train on your data.any: no restriction (the default).
curl https://api.usefully.info/v1/chat/completions \
-H "Authorization: Bearer $USEFULLY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "anthropic/claude-sonnet-5-5",
"messages": [{"role": "user", "content": "Summarize this ticket: ..."}],
"provider": {"data_policy": "zdr"}
}'With the OpenAI Python SDK, pass the provider object through extra_body, since it isn't part of OpenAI's own parameters:
reply = client.chat.completions.create(
model="anthropic/claude-sonnet-5-5",
messages=messages,
extra_body={"provider": {"data_policy": "zdr"}},
)How it interacts with failover
The policy is applied before routing, not after. Usefully filters the list of providers serving the model down to those that meet the policy, and only then ranks them and applies health checks and failover. A failover can never move a zdr request to a provider that retains data; it can only move it to another provider that also qualifies.
The flip side: if no provider serving that model meets the policy, or every qualifying provider is currently unhealthy, the request fails with 503 no_provider_available instead of quietly going somewhere else. That's deliberate. A privacy rule that gives way under load isn't a rule. Failed requests aren't charged, so the only cost is the error you need to handle.
Choosing a policy
- Personal or regulated data (customer records, health, finance, legal documents): use
zdr. - Proprietary but not personal (internal code, product plans):
no_trainingis often enough, and leaves more providers available. - Public or synthetic content:
anygives routing the most room for price and reliability.
A simple pattern is to set the policy in one place in your code, keyed by the kind of data, rather than remembering it at every call site:
type Sensitivity = "public" | "internal" | "personal";
const POLICY: Record<Sensitivity, "any" | "no_training" | "zdr"> = {
public: "any",
internal: "no_training",
personal: "zdr",
};
export function chat(messages: Message[], sensitivity: Sensitivity) {
return client.chat.completions.create({
model: "anthropic/claude-sonnet-5-5",
messages,
// @ts-expect-error: Usefully routing option, not in OpenAI's types
provider: { data_policy: POLICY[sensitivity] },
});
}What Usefully itself keeps
The routing policy covers the provider. On our side, the dashboard Logs record metadata only: model, provider, token counts, cost, latency and status. Prompt and response bodies are not stored. Every connection, to us and from us to providers, uses HTTPS.
Checklist
- 1Decide which features in your app send sensitive data to a model.
- 2Set
data_policyfor those calls in one shared helper. - 3Handle
503 no_provider_availablewith a clear message or a fallback to a different model that has qualifying providers. - 4Check Logs to confirm which providers served those requests.
Testing the policy
Before relying on a policy in production, send a few requests with it from staging and look at the provider column in Logs. You'll see exactly which providers qualified for each model. If a model you planned to use has no qualifying provider, you find out during testing rather than from a 503 in front of a customer, and you can pick a different model for that feature instead.
Routing options are documented in models and routing. If you need a specific model available with zero retention, tell us at support@usefully.info.