Prompt Caching on Anthropic, Bedrock, and Vertex AI: How Redaction and Cache Retention Interact
Redaction must run in your own request path, before content is sent to the provider, because any cache write happens on the provider side after the request arrives. Redaction applied later cannot reach content already cached. Once redaction is upstream, the remaining work is settling each provider's cache scope, lifetime, eligibility, and deletion terms, and keeping evidence of the redacted payload that was actually sent.
Redaction and the cache write are sequential steps
- 1
Before the call
Detection and redaction run in your path. This is the only point that precedes the cache write.
- 2
At the provider
The cache write, cache lookup, and cache expiry happen under provider terms you do not control.
- 3
After the call
Response handling, logging, and audit records are yours, but they cannot change what the provider already cached.
Cache retention questions to settle with each provider
- Does cached content persist after the request completes, and for how long by default and by configuration?
- What is the isolation boundary: customer, organization, workspace, account, or project?
- Is prompt or context caching eligible under zero-data-retention or equivalent terms, and how does cached-content retention differ from ordinary prompt and response retention?
- Can cached content be deleted before expiry on request, and what confirmation does the provider give?
- What minimum content length and eligibility rules decide whether a prefix is cached at all?
- Does your own retention policy explicitly cover cached prompt content, not only prompts and responses?
How redaction changes cache matching
Caches generally match on a stable prefix. If the prefix changes, the cache key changes, and the request is treated as a different prompt. Redaction modifies the prefix whenever it touches content inside it, so it interacts directly with hit rates.
The practical risk is nondeterminism. If a redaction step replaces the same value with a different placeholder on each request, a prefix that should be stable becomes unique every time. Cache hits fall, and the provider holds many near-duplicate entries, each one a separate retained object. Deterministic redaction avoids both problems. The same input should always produce the same output, and placeholders should follow a fixed, documented format.
Three design choices help. Keep static material, such as system instructions and reference text, free of per-request sensitive values so it can be redacted once and reused. Place variable, user-specific content after the stable portion of the prompt. Version your redaction rules, so a rule change is a deliberate prefix change rather than a silent one.
There is also a tradeoff to state plainly. A cache entry that contains redacted content is lower risk than one that contains original content, but it is still provider-held data. Redaction reduces what is exposed. It does not remove the need for retention terms.
Provider by provider: what differs and what to pin down
Each platform defines caching in its own terms, and those terms can change. Do not carry assumptions from one provider to another, and do not assume that a cloud platform hosting a model applies the same cache behavior as the model developer's own API.
On Anthropic's API, the questions concern the unit of isolation, such as organization or workspace, the lifetime options for a cache entry, the minimum length that qualifies for caching, and how cached content is treated under any zero-data-retention arrangement. On Amazon Bedrock, the same questions apply at the level of the AWS account and the way the service handles cached content in your region. On Google Vertex AI, they apply at the level of the Google Cloud project and the platform's context caching terms.
The reason to separate them is that cache scope, time-to-live, eligibility rules, and deletion behavior each affect a different part of your data-handling commitments. Scope determines who else could be served from shared infrastructure. Lifetime determines how long redacted content persists. Eligibility determines whether caching is even permitted under your retention arrangement. Deletion determines whether you can act before expiry.
OWASP guidance on sensitive information disclosure calls for clear policies on data retention, usage, and deletion, and OWASP Cornucopia flags inference caches as shared infrastructure that can become a cross-tenant leakage path. Add the provider cache to your threat model on that basis, as one more shared component.
Evidence that redacted content was what the provider received
An auditor will not accept an assertion that redaction happened. The useful evidence shows what left your boundary. Capture the redacted payload as sent, or a verifiable record of it such as a hash tied to the request, along with the policy decision and rule version that produced it. This is an enterprise design choice, and it should be made deliberately.
Apply the same discipline to your own records. OWASP Cornucopia recommends logging only the minimum interaction metadata needed for security monitoring, and redacting or anonymizing any prompt or output content before storage. An audit trail that stores original prompts reintroduces the exposure you removed upstream.
Trussed enforces policy in the execution path, with allow, redact, and block decisions applied before requests reach the model provider, and it produces audit-ready evidence of what was enforced. That evidence supports the claim that redacted content was what was sent. Trussed does not control provider-side cache storage or deletion, so retention of cached content still depends on the provider terms settled above.
Together, these give a defensible position: a pre-send control, evidence of its output, and documented provider retention terms that your policy explicitly covers.
One request path, two sequential steps
1. Enforce policy
Detect sensitive content and allow, redact, or block before the request leaves your boundary.
2. Record what was sent
Keep the redacted payload, or a verifiable record of it, as evidence.
3. Provider receives
The provider sees only the redacted request.
4. Provider caches
Any cache write contains the redacted prefix, held under the provider's retention terms.
Place redaction ahead of the cache write
Talk through where policy enforcement sits in your request path and what evidence it produces for each model provider.
Talk to an Expert