Meter Definitions

The AI Guard service registers four meters under the instrument name ai-guard-server. Three are submitted by clients via POST /metric, and one is generated automatically from classification responses.

Required Attributes

All meters require the following attributes:

AttributeDescriptionExample
agent_idUnique identifier for the calling AI agent"my-agent"
platformAI platform originating the request"AMAZON_BEDROCK"

Supported Platform Values

PlatformValue
Amazon BedrockAMAZON_BEDROCK
Amazon SageMakerAMAZON_SAGEMAKER
Azure AI FoundryAZURE_FOUNDRY
DatabricksDATABRICKS
Google Cloud Vertex AIGCP_VERTEX

Meter Reference

ai_guard.agent β€” Agent Response Time

PropertyValue
TypeHistogram (u64)
SourcePOST /metric (SDK)
ValueResponse time in milliseconds (integer string)
Required Attributesagent_id, platform

Records the response time of the LLM agent. Used to track agent performance and latency trends.

SDK Example:

client.metric(MetricsEvent(
    attributes={},
    meter=MetricsEventMeter(name="ai_guard.agent", value="1234"),
))

Export Statistics (OneTrust exporter):

StatisticDescription
AVGAverage response time (sum / count)
MINMinimum response time in the interval
MAXMaximum response time in the interval
P9999th percentile, interpolated from histogram bucket boundaries

ai_guard.user β€” User Session

PropertyValue
TypeCounter (u64)
SourcePOST /metric (SDK)
Value"1"
Required Attributesagent_id, platform, new_session

Records user interactions and session starts. Used to track engagement metrics.

Additional AttributeValuesDescription
new_session"true" / "false"Whether this interaction starts a new session

SDK Example:

client.metric(MetricsEvent(
    attributes={"new_session": "true"},
    meter=MetricsEventMeter(name="ai_guard.user", value="1"),
))

ai_guard.redact β€” Redaction Event

PropertyValue
TypeCounter (u64)
SourcePOST /metric (SDK)
Value"1"
Required Attributesagent_id, platform, action, actor

Records redaction and block events. Used to track how often sensitive data is detected and acted upon.

Additional AttributeValuesDescription
action"redact" / "block"The type of action taken
actor"user" / "agent"Source of the classified text

SDK Example:

client.metric(MetricsEvent(
    attributes={"action": "redact", "actor": "user"},
    meter=MetricsEventMeter(name="ai_guard.redact", value="1"),
))

ai_guard.classification β€” Classification Count

PropertyValue
TypeCounter (u64)
SourceAuto-generated (per match in classification response)
Value"1" (per match)
Required Attributesagent_id, platform, actor, classifier

Automatically incremented once per classifier match in a classification response. Tracks which types of sensitive data are being detected most frequently.

AttributeSourceDescription
agent_idFrom request contextUnique agent identifier
platformFrom request contextAI platform identifier
actorFrom request context"user" or "agent"
classifierAuto-set by serviceThe classifier code that matched (e.g., US_PHONE_NUMBER)
⚠️

Not Submittable

This meter is generated automatically by the service. It cannot be submitted via POST /metric or client.metric().

Custom Attributes

The service supports optional additional attribute keys beyond the built-in required keys. These are configured in the metrics.allowed-attributes section of the service configuration:

metrics:
  allowed-attributes:
    - custom_key
    - environment

Attributes not in the allowed set or the required set (agent_id, platform) are rejected with a 400 Bad Request.

What's Next?