Skip to content

[Bedrock Adapter] Prompt caching (cache_config) places cachePoint on user message instead of system prompt, causing cache misses on dynamic single-cycle agents #295

Description

@vipulu9

When using the Bedrock model provider with Anthropic prompt caching enabled (CacheConfig(strategy="anthropic")), cross-request caching fails (Cache Read = 0) for single-cycle agents that receive dynamic user inputs (such as upstream JSON payloads).

Upon enabling debug logging, the SDK trace reveals:
DEBUG:strands.models.bedrock:msg_idx=<0> | added cache point to last user message

EnvironmentSDK Version: Latest (strands-agents)
Model: global anthropic claude sonnet 4.5 via Amazon Bedrock
Configuration: CacheConfig(strategy="anthropic")

Expected Behavior
Developers should be able to cache large, static system prompts or tool schemas independently of ephemeral user turns, or have an explicit mechanism via cache_config to target the system array for caching. (Note: cache_prompt is currently documented as deprecated, but moving to cache_config removed the ability to pin cache markers to system instructions).

Proposed Solution / Feature Request
Provide an option or update the Bedrock adapter logic to allow placing cache breakpoints on the system prompt array or give finer-grained control over cachePoint placement for Anthropic prompt caching on Bedrock.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Language

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions