Always configure the supported alerting policies for the target agent:
- For Reliability Monitoring: You MUST configure exactly five alerting
policies:
- Latency (anomaly monitoring)
- Error Rate - Fast Burn SLO (1-Hour Window)
- Error Rate - Slow Burn SLO (3-Day Window)
- Model Call Error Rate (SQL-based Observability Analytics
Alerting)
- Tool Call Error Rate (SQL-based Observability Analytics
Alerting)
- For Quality Monitoring: You MUST configure exactly three alerting
policies (Requires Vertex AI Online Monitors):
- Final Response Quality
- Tool Use Quality
- Hallucination
- For Cost Monitoring: You MUST configure exactly one cost alerting
policy:
- Rapid Token Burn Rate (anomaly monitoring)
- For Safety Monitoring: You MUST configure exactly one safety
alerting policy:
- High Model Armor Safety Policy Trigger Rate (SQL-based
Observability Analytics Alerting)
- For Security Monitoring: You MUST configure exactly one security
alerting policy:
- High IAM Permission Denied Trigger Rate (SQL-based Observability
Analytics Alerting)
Terraform Only: Write the generated observability configuration ONLY as
Terraform (.tf) files (such as alerts.tf, variables.tf).
- You ONLY need to install Terraform if you're asked to deploy the
alerts AND there is no valid Terraform install. SQL-based alerting using
condition_sql requires the provider version >= 6.0.0 (or late 5.x
versions supporting the feature).
- If you are NOT asked to deploy the alerts you do not need to install
terraform.
Dynamic Multi-Resource Alerting (No Single-Resource Pinning): You MUST
NOT hardcode specific agent IDs or resource name filters (for example,
{gen_ai_agent_name="{agent_name}"} or
metric.labels.agent_resource_name="{agent_name}") in alerting conditions
unless explicitly requested (for example, "ONLY for this agent"). Merely mentioning
a specific agent name or ID in the request does NOT constitute an explicit
request to pin/filter; you MUST still default to dynamic grouping to cover
all agents. To cover all active agents in the project dynamically:
Good Example (PromQL Grouping):
sum(rate(workload_googleapis_com:gen_ai_invoke_agent_duration_count{monitored_resource="generic_node"}[5m])) by (gen_ai_agent_name)
Bad Example (PromQL Hardcoded Filter):
sum(rate(workload_googleapis_com:gen_ai_invoke_agent_duration_count{monitored_resource="generic_node", gen_ai_agent_name="support-bot"}[5m]))
- For Reliability Metrics using PromQL: ALWAYS use grouping
aggregations. Group by
gen_ai_agent_name (for example, by (gen_ai_agent_name)). Avoid filtering to a single ID/Name unless
requested.
- For Quality Metrics using Standard Threshold Filters: Omit the
agent_resource_name filter entirely. Configure the condition filter to
only target the monitored resource type
(aiplatform.googleapis.com/OnlineEvaluator) and metric type
(aiplatform.googleapis.com/online_evaluator/scores) globally for the
project.
Good Example (SQL Grouping):
SELECT
JSON_VALUE(resource.attributes, '$."cloud.resource_id"') as agent_id,
...
FROM ...
GROUP BY agent_id
Bad Example (SQL Hardcoded Filter):
SELECT ...
FROM ...
WHERE JSON_VALUE(resource.attributes, '$."cloud.resource_id"') = 'support-bot'
- For Downstream Calls using SQL: Omit the
ENDS_WITH filter
targeting a specific agent name. Instead, extract the agent identifier
(for example, JSON_VALUE(resource.attributes, '$."cloud.resource_id"')) and
add it to the GROUP BY clause alongside the model or tool name.
Directory Inference: Prefer the path explicitly provided by the user (if
any). Otherwise, deploy configuration files to target Terraform or SRE
folders (such as monitoring/, ops/, sre/). Use tools to locate where
alert policies or state pointers exist in the project, rather than blindly
writing to the root.
Notification Channels: By default, never configure any notification
channels without user input. If the user explicitly provides a notification
channel in their prompt, configure the alerts to use it. If no notification
channel is provided, you MUST explicitly ask the user in your final response
if they would like to configure notification channels. This is a mandatory
question and you MUST NOT omit it from your response. IMPORTANT Do NOT
make assumptions about notification channels. If you search the codebase for
a notification channel you must ALWAYS confirm with the user before using
it.
Plain English Response: You MUST include a plain English explanation for
what the alerts do in your response. This must explain in plain English what
the alert measures, how the algorithm works, and what a trigger indicates.