Chapter 1. Enabling AI safety with Guardrails
The TrustyAI Guardrails Orchestrator service is a tool to invoke detections on text generation inputs and outputs, as well as standalone detections.
It is underpinned by the open-source project FMS-Guardrails Orchestrator from IBM. You can deploy the Guardrails Orchestrator service through a Custom Resource Definition (CRD) that is managed by the TrustyAI Operator.
The following sections describe the Guardrails components, how to deploy them and provide example use cases of how to protect your AI applications using these tools:
- Understanding detectors
Explore the available detector types in the Guardrails framework. Currently supported detectors are:
- The built-in detector: Out-of-the-box guardrailing algorithms for quick setup and easy experimentation.
- Hugging Face detectors: Text classification models for guardrailing, such as ibm-granite/granite-guardian-hap-38m or any other text classifier from Hugging Face.
- Configuring the Orchestrator
- Configure the Orchestrator to communicate with available detectors and your generation model.
- Configuring the Guardrails Gateway
- Define preset guardrail pipelines with corresponding unique endpoints.
- Deploying the Orchestrator
- Create a Guardrails Orchestrator to begin securing your Large Language Model (LLM) deployments.
- Automatically configuring Guardrails using
AutoConfig - Automatically configure Guardrails based on available resources in your namespace.
- Monitoring user-inputs to your LLM
- Enable a safer LLM by filtering hateful, profane, or toxic inputs.
- Enabling the OpenTelemetry exporter for metrics and tracing
- Provide observability for the security and governance mechanisms of AI applications.
1.1. Understanding detectors Copy linkLink copied to clipboard!
The Guardrails framework uses "detector" servers to contain guardrailing logic. Any server that provides the IBM /detectors API is compatible with the Guardrails framework. The main endpoint for a detector server is the /api/v1/text/contents, and the payload looks like the following:
1.1.1. Built-in Detector Copy linkLink copied to clipboard!
The Guardrails framework provides a set of “built-in” detectors out-of-the-box, which provides a number of detection algorithms. The built-in detector currently provides the following algorithms:
regex-
us-social-security-number- detect US social security numbers -
credit-card- detect credit card numbers -
email- detect email addresses -
ipv4- detect IPv4 addresses -
ipv6- detect IP6 addresses -
us-phone-number- detect US phone numbers -
uk-post-code- detect UK post codes -
$CUSTOM_REGEX- use a custom regex to define your own detector
-
file_type-
json- detect valid JSON -
xml- detect valid XML -
yaml- detect valid YAML -
json-with-schema:$SCHEMA- detect whether the text content satisfies a provided JSON schema. To specify a schema, replace $SCHEMA with a JSON schema -
xml-with-schema:$SCHEMA- detect whether the text content satisfies a provided XML schema. To specify a schema, replace $SCHEMA with an XML Schema Definition (XSD) -
yaml-with-schema:$SCHEMA- detect whether the text content satisfies a provided XML schema. To specify a schema, replace $SCHEMA with a JSON schema (not a YAML schema)
-
customDeveloper preview
Custom detectors defined via a
custom_detectors.pyfile.The detector algorithm can be chosen with
detector_params, by first choosing the top-level taxonomy (e.g.,regexorfile_type) and then providing a list of the desired algorithms from within that category. In the following example, both thecredit-cardandemailalgorithms are run against the provided message:
1.1.2. The Hugging Face Detector serving runtime Copy linkLink copied to clipboard!
To use Hugging Face AutoModelsForSequenceClassification as detectors within the Guardrails Orchestrator, you need to first configure a Hugging Face serving runtime.
The guardrails-detector-huggingface-runtime is a KServe serving runtime for Hugging Face predictive text models. This allows models such as the ibm-granite/granite-guardian-hap-38m to be used within the TrustyAI Guardrails ecosystem.
Example custom serving runtime
This YAML file contains an example of a custom serving Huggingface runtime:
The above serving runtime example matches the default template used with Red Hat OpenShift AI, and should suffice for the majority of use-cases. The main relevant configuration parameter is the SAFE_LABELS environment variable. This specifies which prediction label or labels from the AutoModelForSequenceClassification constitute a "safe" response and therefore should not trigger guardrailing. For example, if [0, 1] is specified as SAFE_LABELS for a four-class model, a predicted label of 0 or 1 is considered "safe", while a predicted label of 2 or 3 triggers guardrailing. The default value is [0].
1.1.2.1. Guardrails Detector Hugging Face serving runtime configuration values Copy linkLink copied to clipboard!
| Property | Value |
|---|---|
| Template Name |
|
| Runtime Name |
|
| Display Name |
|
| Model Format |
|
| Component | Configuration | Value |
|---|---|---|
| Server | uvicorn |
|
| Port | Container |
|
| Metrics Port | Prometheus |
|
| Metrics Path | Prometheus |
|
| Log Config | Path |
|
| Parameter | Default | Description |
|---|---|---|
|
| - | Container image (required) |
|
|
| Model mount path |
|
|
| HuggingFace cache |
|
|
| A JSON-formatted list |
|
|
| Number of Uvicorn workers |
|
|
| Server bind address |
|
|
| Server port |
| Endpoint | Method | Description | Content-Type | Headers |
|---|---|---|---|---|
|
| GET | Health check endpoint |
|
|
|
| POST | Content detection endpoint |
|
3 types: * |
1.2. Orchestrator Configuration Parameters Copy linkLink copied to clipboard!
The first step in deploying the Guardrails framework is to first define your Orchestrator configuration with a Config Map. This serves as a registry of the components in the system, namely by specifying the model-to-be-guardrailed and the available detector servers.
Here is an example version of an Orchestrator configuration file:
Example orchestrator_configmap.yaml
| Parameter | Description |
|---|---|
|
|
Describes the generation model to be guardrailed. Requires a |
|
| A service configuration. Throughout the Orchestrator config, all external services are described using the service configuration, which contains the following fields:
|
|
|
The
|
|
| Each key in the detector section defines the name of the detector server. This can be any string, but you’ll need to reference these names later, so pick memorable and descriptive names. |
|
|
The
|
|
| Defines which headers from your requests to the Guardrails Orchestrator get sent onwards to the various services specified in this configuration. If you want to ensure that the Orchestrator can talk to authenticated services, include "authorization" and "content-type" in your passthrough header list. |
1.3. Guardrails Gateway Config Parameters Copy linkLink copied to clipboard!
The Guardrails gateway provides a mechanism for defining preset detector pipelines and creating a unique, endpoint-per-pipeline preset. To use the Guardrails gateway, create a Guardrails Gateway configuration with a Config Map.
Example gateway_configmap.yaml
| Parameter | Description |
|---|---|
|
| The list of detector servers and parameters to use inside your Guardrails Gateway presets. The following fields are available:
|
|
| Define Guardrail pipeline presets according to combinations of available detectors. Each preset route requires the following fields:
|
The Guardrails Gateway only provides the /v1/chat/completions API for each route preset. The older /v1/completions API is not supported.
In the routes presets configuration, each input and output detector in the detectors list must use a unique server. For example, if we have the following detectors, the routes preset configuration is invalid because it uses two input: true detectors from the serverA server:
routes:
- name: route1
detectors:
- detector1
- detector2
routes:
- name: route1
detectors:
- detector1
- detector2
However, the following routes preset configuration is valid, because while both detectors use serverA, detector1 is only an input detector, while detector3 is only an output detector, and therefore does not conflict:
routes:
- name: route1
detectors:
- detector1
- detector3
routes:
- name: route1
detectors:
- detector1
- detector3
The following routes preset is also valid, because, while two input detectors from serverA are used, they are not used in the same route preset:
1.4. Deploying the Guardrails Orchestrator Copy linkLink copied to clipboard!
You can deploy a Guardrails Orchestrator instance in your namespace to monitor elements, such as user inputs to your Large Language Model (LLM).
Prerequisites
- You have cluster administrator privileges for your OpenShift cluster.
You have installed the OpenShift CLI (
oc) as described in the appropriate documentation for your cluster:- Installing the OpenShift CLI for OpenShift Container Platform
- Installing the OpenShift CLI for Red Hat OpenShift Service on AWS
-
You are familiar with how to create a
configMapfor monitoring a user-defined workflow. You perform similar steps in this procedure. See Understanding config maps. -
You have configured KServe to use
RawDeploymentmode. For more information, see Deploying models on the single-model serving platform. -
You have the TrustyAI component in your OpenShift AI
DataScienceClusterset toManaged. - You have a large language model (LLM) for chat generation or text classification, or both, deployed in your namespace.
Deploy your Orchestrator config map:
oc apply -f <ORCHESTRATOR CONFIGMAP>.yaml -n <TEST_NAMESPACE>
$ oc apply -f <ORCHESTRATOR CONFIGMAP>.yaml -n <TEST_NAMESPACE>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Optional: Deploy your Guardrails gateway config map:
oc apply -f <GUARDRAILS GATEWAY CONFIGMAP>.yaml -n <TEST_NAMESPACE>
$ oc apply -f <GUARDRAILS GATEWAY CONFIGMAP>.yaml -n <TEST_NAMESPACE>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create a Guardrails Orchestrator custom resource. Make sure that the
orchestratorConfigandguardrailsGatewayConfigmatch the names of the resources you created in steps 1 and 2.Example
orchestrator_cr.yamlCRCopy to Clipboard Copied! Toggle word wrap Toggle overflow If desired, the TrustyAI controller can automatically generate an
orchestratorConfigandguardrailsGatewayConfigbased on the available resources in your namespace. To access this, include theautoConfigparameter inside your Custom Resource, and see Auto Configuring Guardrails for documentation on its usage.Expand Table 1.6. Annotations from example orchestrator_cr.yaml CR Annotation Description security.opendatahub.io/enable-auth(optional)Boolean value to control whether the Guardrails Orchestrator routes will be authenticated by using the kube-rbac-proxy. If set to
true, the created routes to the Guardrails Orchestrator, Guardrails Gateway, and built-in detectors will all require authentication headers in the formAuthentication: Bearer $xyzfor access.Expand Table 1.7. Parameters from example orchestrator_cr.yaml CR Parameter Description orchestratorConfig(optional)The name of the
ConfigMapobject that contains generator, detector, and chunker arguments. If usingautoConfig, this field can be omitted.guardrailsGatewayConfig(optional)The name of the ConfigMap object that specifies gateway configurations. This field can be omitted if you are not using the Guardrails Gateway or are using
autoConfig.customDetectorsConfig(optional)This feature is in development preview.
autoConfig(optional)A list of paired name and value arguments to define how the Guardrails AutoConfig. Any manually-specified configuration files in
orchestratorConfigorguardrailsGatewayConfigtakes precedence over the automatically-generated configuration files.-
inferenceServiceToGuardrail- The name of the inference service you want to guardrail. This should exactly match the model name provided when deploying the model. For a list of valid names, you can runoc get isvc -n $NAMESPACE detectorServiceLabelToMatch- A string label to use when searching for available detector servers. All inference services in your namespace with the label$detectorServiceLabelToMatch: trueis automatically configured as a detector.See Auto Configuring Guardrails for more information.
enableBuiltInDetectors(optional)A boolean value to inject the built-in detector sidecar container into the Orchestrator pod. The built-in detector is a lightweight HTTP server containing a number of available guardrailing algorithms.
enableGuardrailsGateway(optional)A boolean value to enable controlled interaction with the Orchestrator service by enforcing stricter access to its exposed endpoints. It provides a mechanism of configuring detector pipelines, and then provides a unique
/v1/chat/completionsendpoint per configured detector pipeline.disableOrchestrator(optional)A boolean value to control whether the Guardrails Orchestrator is included in the deployment. This is intended for standalone built-in detector use cases, such as when you wish to interface with the built-in detectors but do not need orchestration capabilities, for example, when using llama-stack. If
disableOrchestratoris set totrue, thenenableBuiltInDetectorsmust be also set totrue.otelExporter(optional)A list of paired name and value arguments for configuring OpenTelemetry traces or metrics, or both:
-
otlpProtocol- Sets the protocol for all the OpenTelemetry protocol (OTLP) endpoints. Valid values aregrpc(default) orhttp -
otlpTracesEndpoint- Sets the OTLP endpoint. Default values arelocalhost:4317forgrpcandlocalhost:4318forhttp -
otlpMetricsEndpoint- Overrides the default OTLP metrics endpoint -
enableTraces- Whether to enable tracing data export, default false -
enableMetrics- Whether to enable metrics data export, default false
logLevel(optional)The log level to be used in the Guardrails Orchestrator- available values are
Error,Warn,Info(default),Debug, andTrace.tlsSecrets(optional)A list of names of
Secretobjects to mount to the Guardrails Orchestrator container. All secrets provided here are mounted into the directory/etc/tls/$SECRET_NAMEfor use in your Orchestrator config TLS configuration. Each secret should contain atls.crtand atls.keyfield.env(optional)A list of environment variables to set in the Guardrails Orchestrator deployment containers. These environment variables are created for every non-kube-rbac-proxy container, including the orchestrator, gateway, and built-in-detectors containers. You can use environment variables to pass API tokens and other configuration values. For more information on defining environment variables, see Define Environment Variables for a Container.
replicasThe number of Orchestrator pods to create.
-
Deploy the Orchestrator CR, which creates a service account, deployment, service, and route object in your namespace:
oc apply -f orchestrator_cr.yaml -n <TEST_NAMESPACE>
oc apply -f orchestrator_cr.yaml -n <TEST_NAMESPACE>Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
Confirm that the Orchestrator and LLM pods are running:
oc get pods -n <TEST_NAMESPACE>
$ oc get pods -n <TEST_NAMESPACE>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example response
NAME READY STATUS RESTARTS AGE guardrails-orchestrator-sample 3/3 Running 0 3h53m
NAME READY STATUS RESTARTS AGE guardrails-orchestrator-sample 3/3 Running 0 3h53mCopy to Clipboard Copied! Toggle word wrap Toggle overflow Query the
/healthendpoint of the Orchestrator route to check the current status of the detector and generator services. If a200 OKresponse is returned, the services are functioning normally:GORCH_ROUTE_HEALTH=$(oc get routes guardrails-orchestrator-sample-health -o jsonpath='{.spec.host}' -n <TEST_NAMESPACE)$ GORCH_ROUTE_HEALTH=$(oc get routes guardrails-orchestrator-sample-health -o jsonpath='{.spec.host}' -n <TEST_NAMESPACE)Copy to Clipboard Copied! Toggle word wrap Toggle overflow curl -v https://$GORCH_ROUTE_HEALTH/health
$ curl -v https://$GORCH_ROUTE_HEALTH/healthCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example response
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
1.5. Auto-configuring Guardrails Copy linkLink copied to clipboard!
Auto-configuration simplifies the Guardrails setup process by automatically identifying available detector servers in your namespace, handling TLS configuration, and generating configuration files for a Guardrails Orchestrator deployment. For example, if any of the detectors or generation services use HTTPS, their credentials are automatically discovered, mounted, and used. Additionally, the Orchestrator is automatically configured to forward all necessary authentication token headers.
Prerequisites
-
Each detector service you intend to use has an OpenShift label applied in the resource metadata. For example,
metadata.labels.<label_name>: 'true'. Choose a descriptive name for the label as it is required for auto-configuration. - You have set up the inference service to which you intend to apply Guardrails.
You have installed the OpenShift CLI (
oc) as described in the appropriate documentation for your cluster:- Installing the OpenShift CLI for OpenShift Container Platform
- Installing the OpenShift CLI for Red Hat OpenShift Service on AWS
Procedure
Create a
GuardrailsOrchestratorCR with theautoConfigconfiguration. For example, create a YAML file namedguardrails_orchestrator_auto_cr.yamlwith the following contents:Example
guardrails_orchestrator_auto_cr.yamlCRCopy to Clipboard Copied! Toggle word wrap Toggle overflow -
inferenceServiceToGuardrail: Specifies the name of the vLLM inference service to protect with Guardrails. detectorServiceLabelToMatch: Specifies the label that you applied to each of your detector servers in themetadata.labelsspecification for the detector. The Guardrails OrchestratorConfigMapautomatically updates to reflect detectors in your namespace that match the label set in thedetectorServiceLabelToMatchfield.If
enableGuardrailsGatewayis true, a template Guardrails gateway config called<ORCHESTRATOR_NAME>-gateway-auto-configis generated. You can modify this file to tailor your Guardrails Gateway setup as desired. The Guardrails Orchestrator automatically deploys when changes are detected. Once modified, the labeltrustyai/has-diverged-from-auto-configis applied. To revert the file back to the auto-generated starting point, simply delete it and the original auto-generated file is recreated.If
enableBuiltInDetectorsis true, the built-in detector server is automatically added to your Orchestrator configuration under the samebuilt-in-detector, and a sample configuration is included in the auto-generated Guardrails gateway config if desired.
-
Deploy the Orchestrator custom resource. This step creates a service account, deployment, service, and route object in your namespace.
oc apply -f guardrails_orchestrator_auto_cr.yaml -n <your_namespace>
oc apply -f guardrails_orchestrator_auto_cr.yaml -n <your_namespace>Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
You can verify that the GuardrailsOrchestrator CR and corresponding automatically-generated configuration objects were successfully created in your namespace by running the following commands:
Confirm that the
GuardrailsOrchestratorCR was created:oc get guardrailsorchestrator -n <your_namespace>
$ oc get guardrailsorchestrator -n <your_namespace>Copy to Clipboard Copied! Toggle word wrap Toggle overflow View the automatically generated Guardrails Orchestrator
ConfigMaps:oc get configmap -n <your_namespace> | grep auto-config
$ oc get configmap -n <your_namespace> | grep auto-configCopy to Clipboard Copied! Toggle word wrap Toggle overflow You can then view the automatically generated configmap:
oc get configmap/<auto-generated config map name> -n <your_namespace> -o yaml
$ oc get configmap/<auto-generated config map name> -n <your_namespace> -o yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow
1.6. Configuring the OpenTelemetry exporter Copy linkLink copied to clipboard!
You can configure the OpenTelemetry exporter to collect traces and metrics from the GuardrailsOrchestrator service. This enables you to monitor and observe the service behavior in your environment.
Prerequisites
- You have installed the Tempo Operator from the OperatorHub.
- You have installed the Red Hat build of OpenTelemetry from the OperatorHub.
Procedure
Enable user workload monitoring to observe telemetry data in OpenShift:
oc -n openshift-monitoring patch configmap cluster-monitoring-config --type merge -p '{"data":{"config.yaml":"enableUserWorkload: true\n"}}'$ oc -n openshift-monitoring patch configmap cluster-monitoring-config --type merge -p '{"data":{"config.yaml":"enableUserWorkload: true\n"}}'Copy to Clipboard Copied! Toggle word wrap Toggle overflow Deploy a MinIO instance to serve as the storage backend for Tempo:
Create a YAML file named
minio.yamlwith the following content:Example
minio.yamlconfigurationCopy to Clipboard Copied! Toggle word wrap Toggle overflow Apply the MinIO configuration:
oc apply -f minio.yaml
$ oc apply -f minio.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that the MinIO pod is running:
oc get pods -l app=minio
$ oc get pods -l app=minioCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
NAME READY STATUS RESTARTS AGE minio-5f8c9d7b6d-abc12 1/1 Running 0 30s
NAME READY STATUS RESTARTS AGE minio-5f8c9d7b6d-abc12 1/1 Running 0 30sCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Create a TempoStack instance:
Create a secret for MinIO credentials:
oc create secret generic tempo-s3-secret \ --from-literal=endpoint=http://minio:9000 \ --from-literal=bucket=tempo \ --from-literal=access_key_id=minio \ --from-literal=access_key_secret=minio123
$ oc create secret generic tempo-s3-secret \ --from-literal=endpoint=http://minio:9000 \ --from-literal=bucket=tempo \ --from-literal=access_key_id=minio \ --from-literal=access_key_secret=minio123Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create a bucket in MinIO for Tempo storage:
oc run -i --tty --rm minio-client --image=quay.io/minio/mc:latest --restart=Never -- \ sh -c "mc alias set minio http://minio:9000 minio minio123 && mc mb minio/tempo"
$ oc run -i --tty --rm minio-client --image=quay.io/minio/mc:latest --restart=Never -- \ sh -c "mc alias set minio http://minio:9000 minio minio123 && mc mb minio/tempo"Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create a YAML file named
tempo.yamlwith the following content:Example
tempo.yamlconfigurationCopy to Clipboard Copied! Toggle word wrap Toggle overflow Apply the Tempo configuration:
oc apply -f tempo.yaml
$ oc apply -f tempo.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that the TempoStack pods are running:
oc get pods -l app.kubernetes.io/instance=<tempo_stack_name>
$ oc get pods -l app.kubernetes.io/instance=<tempo_stack_name>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Configure the OpenTelemetry instance to send telemetry data to the Tempo distributor:
Create a YAML file named
opentelemetry.yamlwith the following content:Example
opentelemetry.yamlconfigurationCopy to Clipboard Copied! Toggle word wrap Toggle overflow The OpenTelemetry collector configuration defines the Tempo distributor and Prometheus services as exporters, which means that the OpenTelemetry collector sends telemetry data to these backends.
Apply the OpenTelemetry configuration:
oc apply -f opentelemetry.yaml
$ oc apply -f opentelemetry.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that the OpenTelemetry collector pod is running:
oc get pods -l app.kubernetes.io/name=<otelcol_name>-collector
$ oc get pods -l app.kubernetes.io/name=<otelcol_name>-collectorCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
NAME READY STATUS RESTARTS AGE <otelcol_name>-collector-7d9c8f5b6d-abc12 1/1 Running 0 45s
NAME READY STATUS RESTARTS AGE <otelcol_name>-collector-7d9c8f5b6d-abc12 1/1 Running 0 45sCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Define a
GuardrailsOrchestratorcustom resource object to specify theotelExporterconfigurations in a YAML file namedorchestrator_otel_cr.yaml:Example
orchestrator_otel_cr.yamlobject with OpenTelemetry configuredCopy to Clipboard Copied! Toggle word wrap Toggle overflow -
orchestratorConfig: This references the config map that you created when deploying the Guardrails Orchestrator service. -
otlpProtocol: The protocol for sending traces and metrics data. Valid values aregrpcorhttp. -
otlpTracesEndpoint: The hostname and port for exporting trace data to the OpenTelemetry collector. -
otlpMetricsEndpoint: The hostname and port for exporting metrics data to the OpenTelemetry collector. -
enableMetrics: Set totrueto enable exporting metrics data. -
enableTracing: Set totrueto enable exporting trace data.
-
Deploy the orchestrator custom resource:
oc apply -f orchestrator_otel_cr.yaml
$ oc apply -f orchestrator_otel_cr.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
Send a request to the guardrails service and verify your OpenTelemetry configuration.
Observe traces using the Jaeger UI:
Access the Jaeger UI by port-forwarding the Tempo traces service:
oc port-forward svc/tempo-<tempo_stack_name>-query-frontend 16686:16686
$ oc port-forward svc/tempo-<tempo_stack_name>-query-frontend 16686:16686Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
In a separate browser window, navigate to
http://localhost:16686. - Under Service, select fms_guardrails_orchestr8 and click Find Traces.
Observe metrics using the OpenShift Metrics UI:
In the Administrator perspective within the OpenShift web console, select Observe > Metrics and query one of the following metrics:
-
incoming_request_count -
success_request_count -
server_error_response_count -
client_response_count -
client_request_duration
-
1.7. Guardrails metrics Copy linkLink copied to clipboard!
Use Guardrails metrics to track functions and outputs of your Guardrails deployment and understand how your model is working.
Metrics are included as standard in your Guardrails deployment. They are sent to Prometheus in the form of outputs. They include features such as the number of requests for a particular guardrail function and the cumulative run time of a function.
| Metric | Labels | Description |
|---|---|---|
|
|
| Tracks the total number of guardrails orchestrators that have been deployed into the cluster, grouped by attributes of the orchestrator. |
|
|
| The total number of requests to a particular guardrail function that have resulted in a flagged detection. |
|
|
| The total number of requests to a particular guardrail function. |
|
|
| The total number of requests to a particular guardrail function that have been unable to produce a meaningful result due to an internal error of some kind. |
|
|
| The cumulative runtime in seconds of a particular guardrail function, as the total latency that the guardrail function has induced over its lifespan. |