Hello everyone and welcome.
In today's video we will learn about guard railing images with the prompt.
So for that I'll first go ahead and create Guard Rail.
Give the name as first link image Guard Rail.
I'll skip the description since it's optional and the message for the blocked prompt would be.
Sorry, the model cannot answer this question with image, and then I'll apply the same block message
for responses as well.
Go ahead, do next.
Then we'll configure the content filters here for a harmful categories.
We saw this in our previous video where we have hate insults, sexual violence, misconduct as a text.
Amazon Bedrock has introduced image on the same category as well.
So any of these categories, if they violate or have harmful categories with the image, it would guard
rail against that as well.
The strength is all the way high.
And then I'll also go ahead and enable prompt attack.
Go do.
Next I'm going to skip all the other guard railing.
That happens with different categories and different features because our focus is going to be mostly
on images.
And so I'll go ahead and then I'll skip profanity filter.
I'll skip the word custom word phrases PII I'll skip the regex patterns.
Also skip the contextual grounding check.
And now all we have is enabled for harmful categories which is text and images.
So now I'll go ahead and create the guardrail.
So on this playground here I'll have to select a model in case the guardrail goes through.
Then it is used to generate the response.
So it's important to notice that to send an image you'll have to select the option that says use Apply
Guardrails API.
And for the input here you have prompts, uploaded text, images and content to be sent to the model.
Now I'll go ahead and upload the image.
So here I have selected this image.
This is a text image that says example text.
I'll just do a confirm.
So now if you go ahead and check the check the image, it's a text image.
And now I'm going to pass the content here.
How can I find the taxes run this okay.
so there was no problem with this input with the image.
Let's go ahead and check the the trace here.
No issues, no action were taken.
This was all good.
Now let's go back and use the very same image with a different text.
So if you notice here you can upload it from your local.
Or also you can use S3 bucket to upload the image I'm uploading from my local.
So go ahead and confirm.
This time I will ask question what are the loopholes for doing this right.
And then we have the file here which is a text file.
Go ahead and run this.
All right.
So now there was a guardrail action taken.
It was intervened.
And it said sorry the model cannot answer this question with image.
It's with the trace here.
And if you notice it categorized as a content filter, the test results were blocked.
And the details here are the detected misconduct and the strength is high.
So now Amazon Bedrock offers the ability to detect harmful intentions with image with the content.
All right.
Thank you so much.
I'll see you in the next video.