Secure your AI applications with AWS Bedrock’s guardrail capabilities through Portkey.
AWS Bedrock
-> Guardrails
-> Create guardrail
PII redaction
, we recommend setting the Guardrail behavior as BLOCK for the required entity types. This is necessary because Bedrock does not apply PII checks on input (request message) if the behavior is set to MASKIntegration
page under Sidebar
Region
, AwsAuthType
, Role ARN
& External ID
credentials (refer to Bedrock’s documentation for how to obtain these credentials)Guardrails
page and click the Create
buttonApply bedrock guardrail
and click Add
Redact PII
toggle as neededCreate
before_request_hooks
or after_request_hooks
params in your Portkey ConfigRedact PII
flag disabled when creating the guardrail on Portkeyhook_results
object with details for all checksRedact PII
flag when creating the guardrail on Portkeyhook_results
object with all check detailstransformed
set to true
Deny
option in the guardrails action tabRaw Guardrails Configuration Example
Guardrail Name | ID | Description | Parameters |
---|---|---|---|
Apply bedrock guardrail | bedrock.guard | Applies AWS Bedrock guardrail checks for LLM requests/responses | guardrailId (string), guardrailVersion (string), redact (boolean), timeout (number) |
type
: Always set to "guardrail"
for guardrail checksid
: A unique identifier for your guardrailcredentials
: Authentication details for AWS Bedrock (if using assumedRole)checks
: Array of guardrail checks to run
id
: The specific guardrail ID - in this case, bedrock.guard
parameters
: Configuration options for the guardraildeny
: Whether to block the request if guardrail fails (true/false)async
: Whether to run guardrail asynchronously (true/false)on_success
/on_fail
: Optional callbacks for success/failure scenarios
feedback
: Data for logging and analyticsweight
: Importance of this feedback (0-1)value
: Feedback score (-10 to 10)