AI GCP Model Armor Policy

Log blocked request and response content

Configure the AI GCP Model Armor 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.gcp-model-armor.input_faulty_prompt and ai.proxy.gcp-model-armor.output_faulty_response.

Prerequisites

  • A GCP project with Model Armor enabled and a configured template.

  • An existing AI Model.

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

Environment variables

  • GCP_SERVICE_ACCOUNT_JSON: GCP service account credentials in JSON format.

  • GCP_PROJECT_ID: GCP project identifier.

  • GCP_LOCATION_ID: GCP location identifier.

  • GCP_TEMPLATE_ID: Guardrail template identifier.

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!