Needs review
Project:
AWS Bedrock Provider
Version:
1.1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
9 Dec 2025 at 14:50 UTC
Updated:
31 Mar 2026 at 19:42 UTC
Jump to comment: Most recent
Comments
Comment #2
adam-delaney commentedI've been able to invoke a model that enforces a guardrail via IAM policy by hardcoding `guardrailConfig` array in the payload variable within the chat() method of the provider plugin. I'm not sure how we can set this dynamically using some type of Drupal config. My initial thought would be to provide configuration for the AWS Bedrock provider settings, so that the guardrails could be applied every time we call converse on the AWS Bedrock runtime client.
Comment #4
adam-delaney commentedI've opened a MR that allows altering the chat payload, https://git.drupalcode.org/issue/ai_provider_aws_bedrock-3562254/-/tree/....
You can alter the payload like this to set Guardrails:
Comment #5
jaydub commentedComment #6
fraserthompsonAI module has this now https://www.drupal.org/project/ai/issues/3518963 so maybe it'd be better to implement this as a AiGuardrail plugin?
Comment #7
jaydub commentedIn this case, the guardrail is something defined on the AWS Bedrock side of things and does not directly involve Drupal, so I don't think the AiGuardrail plugin in the latest version of the AI module would work in this case. The AWS Bedrock defined guardrails here are organization wide rules and are applied to calls going to AWS Bedrock whether from Drupal AI module calls as the requestor, or other sources. So the ability to be able to apply those Bedrock guardrails when using the Bedrock Drupal AI provider is still needed.