To make any ADK 1.2+ or 2.0+ agent automatically discoverable by Agent Anomaly Detection, configure these exact environment variables from Google's November 16 deployment guide so OpenTelemetry captures structured prompt and response events into Cloud Logging and Cloud Trace:
# Required environment variables on Vertex AI Agent Runtime / Cloud Run / GKE
DEPLOY_ENV_VARS = {
"GOOGLE_CLOUD_AGENT_ENGINE_ENABLE_TELEMETRY": "true",
"OTEL_SEMCONV_STABILITY_OPT_IN": "gen_ai_latest_experimental",
"OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT": "EVENT_ONLY",
}
# Hardened tool implementation replacing over-permissive table lookups
ALLOWED_CUSTOMER_TABLES = frozenset({"orders", "invoices"})
def fetch_records(table: str, customer_id: str) -> dict:
"""Fetches scoped customer records only from explicitly allowlisted tables."""
if table not in ALLOWED_CUSTOMER_TABLES:
raise PermissionError(f"Access denied: table '{table}' is outside support scope.")
if not customer_id or not customer_id.startswith("cust_"):
raise ValueError("Valid customer_id is required.")
return _TABLES[table][customer_id]
Once your agent processes its initial 300+ benign baseline sessions, wire Cloud Monitoring and Security Command Center so anomalies trigger automated Slack, PagerDuty, or SOAR playbooks within 5 minutes:
Detected events metric in Cloud Monitoring → Alerting, configure a 5-minute rolling window with the delta aggregator, and trigger when value > 0 (filter by severity IN ("High", "Critical") in production).Monitored agents metric so SREs are notified immediately if OpenTelemetry export stops or a deployment drops required environment variables.AGENT_SESSION_ANOMALY finding in Security Command Center—allowing SOC analysts to attach security marks, correlate with Wiz cloud posture, and revoke compromised OAuth tokens.Support bots often share database helpers with finance or HR schemas. Combining strict table allowlists with AAD catches conversational probing sequences—such as multi-turn questions attempting to enumerate non-customer tables—escalating individual Medium turns into a High-severity Tool Misuse alert at 95% confidence.
Agents reading external emails, PDF attachments, or calendar invites face OWASP #1 Goal Hijack risks. Pairing Model Armor pre-screening on tool outputs with AAD's 87% external-benchmark detection rate catches stealthy exfiltration instructions embedded in vendor invoices or support tickets.
Following GTIG's Q4 2026 finding that attackers use LLMs to turn fresh patch diffs into exploits within hours, platform teams combine Google AI Threat Defense (CodeMender + Wiz + Gemini) with AAD monitoring on internal CI/CD and remediation agents to verify that automated patch runners never touch unauthorized secrets or prod buckets.
Because AAD retains full 3-pane session transcripts (Session severity, Conversation transcript, and Detector rationale with recommended fixes) inside US or EU multi-region buckets at 0 ms inference overhead, compliance teams gain verifiable post-execution audit trails for every autonomous agent action.
Explore all four attack and benign scenarios interactively in our Agent Anomaly Detection & Defense-in-Depth Studio [SIMULATED DEMO], toggle pre-execution vs. async controls, and copy your OTel deployment snippet.