anthropics / anthropics/claude-code
[FEATURE] Claude apps gateway: Support for Bedrock Guardrails headers
- Ngôn ngữ chính
- Python
- Star
- 145k
- Fork
- 23.1k
- Chỉ số merge pull request
- Chỉ số pull request đang chờ
Mô tả
### Preflight Checklist
- [x] I have searched [existing requests](https://github.com/anthropics/claude-code/issues?q=is%3Aissue%20label%3Aenhancement) and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
### Problem Statement
I work with multiple enterprise customers who deploy Claude apps gateway and would like to use Bedrock Guardrails but putting ANTHROPIC_CUSTOM_HEADERS in a managed.policies[].cli.env block just pushes that env var down to the Claude Code client, where it has the exact same problem as setting it locally: those headers are added to the request the client sends to the gateway, and the gateway strips them when it re-originates its own call to Bedrock.
Looking at the [gateway protocol reference](https://code.claude.com/docs/en/llm-gateway-protocol#request-headers): ANTHROPIC_CUSTOM_HEADERS values do arrive at the gateway as headers on the client's request to the gateway. But the [Bedrock upstream section](https://code.claude.com/docs/en/claude-apps-gateway-config#amazon-bedrock) shows the gateway builds its own signed InvokeModel call to Bedrock from region, auth, and base_url there's no documented field that copies arbitrary inbound client headers onto that outbound Bedrock call. The only fields the docs describe crossing that Anthropic→Bedrock translation boundary are the anthropic_beta/anthropic_version body fields (per the [format-translation table](https://code.claude.com/docs/en/llm-gateway-protocol#api-formats)), not headers generally, and definitely not a guardrail header.
### Proposed Solution
Forwarding the ANTHROPIC_CUSTOM_HEADERS sent by the client when the gateway builds its own signed InvokeModel call to Bedrock
### Alternative Solutions
_No response_
### Priority
Critical - Blocking my work
### Feature Category
Configuration and settings
### Use Case Example
_No response_
### Additional Context
_No response_
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Hướng nghiên cứu
Start with the gateway protocol reference’s request-headers section and the Amazon Bedrock upstream configuration, then trace how ANTHROPIC_CUSTOM_HEADERS are handled when the gateway creates its signed InvokeModel call. Done means the Bedrock request preserves the client’s guardrail headers without changing the documented format translation behavior.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- aws
- Lĩnh vực
- api, cloud
- Loại issue
- Tính năng
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Sôi nổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 45/100