feat(amazon-bedrock): add guardrail content support for text and image parts (#14302)
## Background The Amazon Bedrock Converse API supports [guardrail content blocks](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_GuardrailConverseContentBlock.html) that allow marking text and image parts for guardrail evaluation with optional qualifiers (`grounding_source`, `query`, `guard_content`). The existing `BedrockGuardrailConverseContentBlock` type was untyped (`guardContent: unknown`) and there was no way to opt into this behavior from the AI SDK. [Documentation on the Bedrock Feature](https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-use-converse-api.html) ## Summary - Added `BedrockGuardrailTextBlock` type extending `BedrockTextBlock` with optional `qualifiers` array. - Typed `BedrockGuardrailConverseContentBlock.guardContent` as a union of text and image variants instead of `unknown`. - Added Zod schemas (`bedrockTextPartProviderOptions`, `bedrockImagePartProviderOptions`) for validating provider options, used via `parseProviderOptions` consistent with existing patterns. - Users can now set `providerOptions.bedrock.guardContent: true` on text and image parts to wrap them as `guardContent` blocks, with optional `guardContentQualifiers` for text parts. - Added 8 tests covering text guard content (with/without qualifiers, false, no options) and image guard content (true, false, no options). ## Checklist - [x] Tests have been added / updated (for bug fixes / features) - [x] Documentation has been added / updated (for bug fixes / features) - [x] A _patch_ changeset for relevant packages has been added (for bug fixes / features - run `pnpm changeset` in the project root) - [x] I have reviewed this pull request (self-review) Co-authored-by: Aayush Kapoor <aayushkapoor34@gmail.com>
R
Raphael Eidus committed
df45e67b9dbcbe8542d09a1aa116859c14343767
Parent: 4b9bdbe
Committed by GitHub <noreply@github.com>
on 8/25/2026, 5:35:13 PM