You are a junior developer at a fintech startup building an AI-powered wealth management platform. The compliance team has flagged a critical requirement: any AI advisor making investment recommendations must have multiple layers of safety guardrails to comply with financial regulations. Your task is to build a financial advisor agent that can analyze portfolios, recommend investments, and check market data, but every interaction must pass through compliance checks that prevent unauthorized advice, block restricted securities, and maintain a complete audit trail.
In this lab, you will use Google's Agent Development Kit (ADK) to create a compliance checker agent and wrap it as an AgentTool so the main advisor can call it like a regular function. You will implement all four ADK callback types to intercept agent behavior at every stage: injecting compliance context before LLM calls, scanning responses for unauthorized advice, blocking blacklisted tickers before tool execution, and logging every action for regulatory audits. By the end, you will know how to add production-grade safety guardrails to any ADK agent using AgentTool for agent composition and callbacks for behavior interception.