AWS Bedrock Guardrails 2.0
Bedrock Guardrails now supports contextual grounding checks that score a response against retrieved source documents and block ungrounded claims before they reach the user:
const guardrail = await bedrock.applyGuardrail({
guardrailIdentifier: "gr-logistics-assistant",
guardrailVersion: "3",
source: "OUTPUT",
content: [{ text: { text: modelResponse } }],
});
if (guardrail.action === "GUARDRAIL_INTERVENED") {
return fallbackResponse;
}