anthropics / anthropics/claude-agent-sdk-python

Bedrock logs are not capturing trace info even when requests are blocked by the configured Guardrail.

Open
#1,252 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
8.1k
Forks
1.3k
PR merge metrics
PR metrics pending

Description

I have enabled Bedrock Guardrails, but the expected trace data is missing from the Bedrock invocation logs upon a block intervention.
The implementation looks something like this:
```
guardrail_env['ANTHROPIC_CUSTOM_HEADERS'] = (
f'X-Amzn-Bedrock-GuardrailIdentifier: {guardrail_id}\n'
f'X-Amzn-Bedrock-GuardrailVersion: {guardrail_ver}\n'
'X-Amzn-Bedrock-Trace: ENABLED'
)

options = ClaudeAgentOptions(
model=model,
env={
**guardrail_env,
},
)
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.