DEV Community

Cover image for Why AWS Bedrock Returned an Empty Agent Response
Interro
Interro

Posted on

Why AWS Bedrock Returned an Empty Agent Response

Bedrock reported generated output tokens, but the user received an empty assistant message. No exception explained the failure.

INC-003 came from an adapter that only extracted ordinary text blocks. Bedrock Converse can return reasoningContent, guardContent, toolUse, empty text, and unknown future block types. A second layer discarded the message because it used a truthiness check instead of preserving an empty string.

Adapter controls

  • Validate the provider content-block schema.
  • Preserve empty text when a message exists.
  • Log reasoning and guardrail diagnostics without exposing internal reasoning.
  • Add fixtures for reasoning-only, guardrail, tool-use, empty-text, and unknown blocks.

Provider adapters are reliability boundaries. A graph can be correct while its translation layer silently drops the response.

Review source patterns with:

prevention-scanner scan . --format json
Enter fullscreen mode Exit fullscreen mode

Confirm the fix with provider contract tests, not only a happy-path mock.

Read the full INC-003 incident.

AI #AWS #Bedrock #LLMOps

Top comments (0)