AI AWS Guardrails Policy

Log blocked request and response content

Configure the AI AWS Guardrails policy to log the raw content of blocked requests and responses. When a request or response is blocked, the original prompt or response body is captured in the log entry under ai.proxy.aws-guardrails.input_faulty_prompt and ai.proxy.aws-guardrails.output_faulty_response.

Prerequisites

  • An AWS Bedrock Guardrails policy and access to the AWS Bedrock Guardrails service.

  • An existing AI Model.

  • An existing logging policy such as HTTP Log or File Log.

Environment variables

  • GUARDRAILS_ID: The guardrail identifier to apply.

  • GUARDRAILS_VERSION: The guardrail version to apply.

  • AWS_REGION: The AWS region where the guardrail is deployed.

  • AWS_ACCESS_KEY_ID: The AWS access key ID used to authenticate the request.

  • AWS_SECRET_ACCESS_KEY: The AWS secret access key used to authenticate the request.

Set up the policy

Attach the policy

Help us make these docs great!

Kong Developer docs are open source. If you find these useful and want to make them better, contribute today!