<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Karthigayan Devan</title>
    <description>The latest articles on Forem by Karthigayan Devan (@karthidec).</description>
    <link>https://forem.com/karthidec</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3519305%2F935f2435-d048-4185-8806-300f7e170082.png</url>
      <title>Forem: Karthigayan Devan</title>
      <link>https://forem.com/karthidec</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/karthidec"/>
    <language>en</language>
    <item>
      <title>Building Aura: A Multimodal Smart Home Operated by Gemini Live 🌌</title>
      <dc:creator>Karthigayan Devan</dc:creator>
      <pubDate>Mon, 16 Mar 2026 01:42:26 +0000</pubDate>
      <link>https://forem.com/gde/building-aura-a-multimodal-smart-home-operated-by-gemini-live-2m31</link>
      <guid>https://forem.com/gde/building-aura-a-multimodal-smart-home-operated-by-gemini-live-2m31</guid>
      <description>&lt;h2&gt;
  
  
  💡 The Problem with Smart Homes
&lt;/h2&gt;

&lt;p&gt;Smart homes today are often fragmented and reactive. You speak into a puck on the wall, and it toggles a light on a screen. There is no continuous awareness. &lt;/p&gt;

&lt;p&gt;For the &lt;strong&gt;Gemini Live Agent Challenge 2026&lt;/strong&gt;, I wanted to build something that feels &lt;strong&gt;alive&lt;/strong&gt;. Inspired by futuristic sci-fi interfaces, I built &lt;strong&gt;Aura&lt;/strong&gt; — a central AI operating pilot that doesn't just hear you, but &lt;strong&gt;sees your environment concurrently&lt;/strong&gt; and translates that intelligence into a living, responsive Ambient Dashboard layout natively.&lt;/p&gt;




&lt;h2&gt;
  
  
  🚀 What is Aura?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Aura&lt;/strong&gt; is a fully multimodal smart home operating system utilizing &lt;strong&gt;bidirectional WebSockets&lt;/strong&gt; over continuous, low-latency backpressure limits. &lt;/p&gt;

&lt;p&gt;Unlike previous generations of voice assistants that rely on turn-taking (Speech-to-Text ➔ LLM ➔ Text-to-Speech), Aura streams &lt;strong&gt;continuous raw audio and webcam frames&lt;/strong&gt; concurrently using the &lt;code&gt;google/genai&lt;/code&gt; Node SDK. &lt;/p&gt;




&lt;h2&gt;
  
  
  🛠️ The Architecture
&lt;/h2&gt;

&lt;p&gt;I engineered a decoupled &lt;strong&gt;reactive container pipeline&lt;/strong&gt; deployed on &lt;strong&gt;Google Cloud Run&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm1kifhxh682a8iszbdy9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm1kifhxh682a8iszbdy9.png" alt=" " width="800" height="258"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  ⚡ Secret Sauce: Native Visual Concurrency
&lt;/h2&gt;

&lt;p&gt;The biggest challenge I ran into was translating standard 16:9 webcam buffers onto square visual grids without distorting the frame aspect ratio. AI can hallucinate if you squash the context!&lt;/p&gt;

&lt;p&gt;I fixed this by injecting a continuous Canvas Context buffer scaling calculation on every local-exec push:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Quick glimpse at the frontend scaling preserving 1:1 ratios&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;scale&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;min&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;600&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nx"&gt;video&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;videoWidth&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;600&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nx"&gt;video&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;videoHeight&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;600&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;video&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;videoWidth&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;scale&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;600&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;video&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;videoHeight&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;scale&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;drawImage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;video&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;y&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;video&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;videoWidth&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;scale&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;video&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;videoHeight&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;scale&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  🚨 Visual Ambient States (The "Wow" Factor)
&lt;/h2&gt;

&lt;p&gt;Dashboard views shouldn't just list data. When Aura triggers a smart decision, the full Chrome viewport adapts natively using CSS Variable Overrides:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;💡 .lights-off (Ambient Dimming): Absolute viewport drop-shadow shading to deep #06080E with neon frame glowing edges securely.&lt;/li&gt;
&lt;li&gt;🚨 .emergency-global (Strobe Alerting): Repeating red and white absolute background flashes demanded continuous viewer security attention.&lt;/li&gt;
&lt;li&gt;🌡️ Thermal Card Shadings: Thermostats pulse with continuous Amber shadings overlays strictly enforcing accurate contextual reading gradients safely.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;🎥 Check out the Demo Video!&lt;br&gt;
&lt;a href="https://www.youtube.com/watch?v=Vm2iGpAuexQ" rel="noopener noreferrer"&gt;https://www.youtube.com/watch?v=Vm2iGpAuexQ&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  📂 Source Code
&lt;/h2&gt;

&lt;p&gt;The code is 100% open-weight and available on GitHub: 👉 &lt;a href="https://github.com/karthidec/gemini-agent-challenge.git" rel="noopener noreferrer"&gt;https://github.com/karthidec/gemini-agent-challenge.git&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  ⚠️ Contest Disclaimer
&lt;/h2&gt;

&lt;p&gt;This project is an entry for the Google Gemini Live Agent Challenge 2026. Explicitly leveraging @google/genai continuous WebSocket routing modules.&lt;/p&gt;

&lt;p&gt;What do you think of this continuous audio/vision ambient approach for smart environments? Let me know in the comments below! 🌌✨&lt;/p&gt;

</description>
      <category>geminiliveagentchallenge</category>
      <category>googlecloud</category>
      <category>gemini</category>
      <category>discuss</category>
    </item>
    <item>
      <title>Beyond Dashboards: Architecting a GenAI FinOps Analyst using BigQuery Native MCP</title>
      <dc:creator>Karthigayan Devan</dc:creator>
      <pubDate>Sat, 21 Feb 2026 15:55:36 +0000</pubDate>
      <link>https://forem.com/gde/beyond-dashboards-architecting-a-genai-finops-analyst-using-bigquery-native-mcp-48jc</link>
      <guid>https://forem.com/gde/beyond-dashboards-architecting-a-genai-finops-analyst-using-bigquery-native-mcp-48jc</guid>
      <description>&lt;p&gt;Google Cloud bills are larger and more complex to understand. You get a PDF summary that says "Compute Engine: $5,000", but when you ask &lt;em&gt;why&lt;/em&gt;, you're tasked with downloading a massive CSV or wrestling with the Google Cloud Billing Console's filters (at SKU's level).&lt;/p&gt;

&lt;p&gt;For true FinOps visibility, most engineering teams turn to the &lt;strong&gt;Cloud Billing Export&lt;/strong&gt;. This feature dumps every line item of your usage down to the SKU and timestamp into a BigQuery dataset. It is the single source of truth.&lt;/p&gt;

&lt;p&gt;But here is the catch: querying that data requires complex SQL. You need to know that &lt;code&gt;cost&lt;/code&gt; is in one column, &lt;code&gt;credits&lt;/code&gt; are nested in a JSON array, and &lt;code&gt;project.labels&lt;/code&gt; requires unnesting.&lt;/p&gt;

&lt;p&gt;We need a better way. A user can just ask: &lt;em&gt;"Why is the dev environment costing 20% more this week?"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;To build this, we do not write 1,000 lines of SQL-generation code. Instead, we can use &lt;strong&gt;Google's Native BigQuery MCP Server&lt;/strong&gt; with Gemini. Here is how I built a "FinOps for Everyone" agent (architecture design) that lets you chat directly with your raw billing data.&lt;/p&gt;

&lt;h2&gt;
  
  
  Native MCP:
&lt;/h2&gt;

&lt;p&gt;The Model Context Protocol (MCP) is becoming the standard for connecting LLMs to data. Usually, you have to build an "MCP Server", a small app that sits between the LLM and your database.&lt;/p&gt;

&lt;p&gt;But Google has done something different. They published a &lt;strong&gt;Native BigQuery MCP Server&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;You don't deploy this server. You don't manage it. It is a public endpoint (&lt;code&gt;https://bigquery.googleapis.com/mcp&lt;/code&gt;) that your agent connects to. It exposes BigQuery's capabilities (schema inspection, querying, job management) directly to the LLM as tools.&lt;/p&gt;

&lt;p&gt;This changes everything. It means our FinOps agent is just a lightweight Python script. The heavy lifting of understanding the database structure is handled by the native protocol.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Architecture:
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcrvkk8fz0b8yzi4hig3e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcrvkk8fz0b8yzi4hig3e.png" alt=" " width="409" height="551"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: The Data Foundation (Billing Export)
&lt;/h2&gt;

&lt;p&gt;Before writing code, you need the data.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Go to the &lt;strong&gt;Google Cloud Console &amp;gt; Billing &amp;gt; Billing Export&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt; Enable &lt;strong&gt;BigQuery Export&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt; This creates a dataset (e.g., &lt;code&gt;billing_export_v1_XXXX&lt;/code&gt;) that fills with raw usage data every few hours.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;em&gt;This is your gold mine. It contains every CPU cycle and storage byte you are paying for.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: The Agent Code
&lt;/h2&gt;

&lt;p&gt;I used the Google Gen AI Agent Development Kit (&lt;code&gt;google-adk&lt;/code&gt;). The critical piece is connecting to the native MCP URL.&lt;/p&gt;

&lt;h3&gt;
  
  
  Connecting to the Native Server
&lt;/h3&gt;

&lt;p&gt;We don't need to define tools like &lt;code&gt;execute_sql&lt;/code&gt;. We just tell the ADK to talk to the BigQuery MCP URL.&lt;/p&gt;

&lt;h3&gt;
  
  
  The "Anti-Hallucination" Prompt
&lt;/h3&gt;

&lt;p&gt;The Billing Export schema is huge. If you ask Gemini to "show me costs," it might guess a column name like &lt;code&gt;total_cost&lt;/code&gt; when the actual column is &lt;code&gt;cost&lt;/code&gt; or &lt;code&gt;usage.amount_in_pricing_units&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;To fix this, I set strict instructions in the agent's system prompt:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;System Instruction:&lt;/strong&gt;&lt;br&gt;
You are a FinOps Analyst. You have access to the BigQuery MCP tools.&lt;br&gt;
&lt;strong&gt;Rule 1:&lt;/strong&gt; Never guess column names.&lt;br&gt;
&lt;strong&gt;Rule 2:&lt;/strong&gt; Before answering a question, use &lt;code&gt;list_tables&lt;/code&gt; to find the billing table, then use &lt;code&gt;get_table_schema&lt;/code&gt; to see the actual columns.&lt;br&gt;
&lt;strong&gt;Rule 3:&lt;/strong&gt; Only then, write and execute the SQL query.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This "Look before you Leap" pattern makes the agent incredibly robust. If Google updates the export schema tomorrow, my agent adapts instantly because it reads the schema at runtime.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Deployment (Local &amp;amp; Prod)
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Running Locally (The "Analyst" Mode)
&lt;/h3&gt;

&lt;p&gt;For ad-hoc analysis, I run this script on my laptop.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; &lt;code&gt;gcloud auth application-default login&lt;/code&gt; (This gives the script my user permissions).&lt;/li&gt;
&lt;li&gt; &lt;code&gt;python agent.py&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt; I chat with it: &lt;em&gt;"Break down the cost of our AI/ML projects for the last 10 days by SKU."&lt;/em&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Deploying to Prod (The "Team" Mode)
&lt;/h3&gt;

&lt;p&gt;To let the whole team use it:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Wrap the script in a Docker container.&lt;/li&gt;
&lt;li&gt; Deploy to &lt;strong&gt;Cloud Run&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt; Use the cloud run endpoint as an endpoint MCP server (also, we can leverage Agent Engine pattern for this deployment)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now, anyone in the internal slack/chat portal can ask cost questions without needing BigQuery IAM access—the agent acts as the secure gateway.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why This is the Future of FinOps
&lt;/h2&gt;

&lt;p&gt;We are moving past static dashboards. Dashboards answer questions you asked &lt;em&gt;yesterday&lt;/em&gt;. Agents answer the questions you have &lt;em&gt;today&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;By using the &lt;strong&gt;Native BigQuery MCP Server&lt;/strong&gt;, we get:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; &lt;strong&gt;Security:&lt;/strong&gt; No database credentials stored in the app. It uses standard OAuth/IAM.&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Maintainability:&lt;/strong&gt; Zero SQL parsing code. The MCP protocol handles the tool definitions.&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Depth:&lt;/strong&gt; You aren't limited to pre-aggregated views. You are querying the raw export. If you want to know how much you spent on "Network Egress to Australia" at 2 AM on a Sunday, the data is there, and the agent can write the SQL to find it.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This is FinOps for everyone—democratizing cost data so engineers can own their cloud spend.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tech Stack:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Google Cloud Platform (GCP)&lt;/li&gt;
&lt;li&gt;BigQuery (BQ): Data warehouse for billing exports.&lt;/li&gt;
&lt;li&gt;Google Cloud Billing Export: Source of raw financial data.&lt;/li&gt;
&lt;li&gt;Model Context Protocol (MCP): Standard for LLM-tool interaction.&lt;/li&gt;
&lt;li&gt;Native BigQuery MCP Server: Google-managed endpoint exposing BigQuery capabilities.&lt;/li&gt;
&lt;li&gt;Gemini (e.g., Gemini 2.5 Flash): The Large Language Model powering the agent.&lt;/li&gt;
&lt;li&gt;Google ADK (Agent Development Kit): Python library for building agents and MCP client interactions.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  References:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.cloud.google.com/bigquery/docs/use-bigquery-mcp" rel="noopener noreferrer"&gt;https://docs.cloud.google.com/bigquery/docs/use-bigquery-mcp&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>discuss</category>
      <category>mcp</category>
      <category>devops</category>
      <category>ai</category>
    </item>
    <item>
      <title>Building a “Local-First” AI FinOps Agent with Gemini CLI &amp; MCP: Ending the Google Cloud Cost Puzzle</title>
      <dc:creator>Karthigayan Devan</dc:creator>
      <pubDate>Sun, 25 Jan 2026 19:23:25 +0000</pubDate>
      <link>https://forem.com/gde/building-a-local-first-ai-finops-agent-with-gemini-cli-mcp-ending-the-google-cloud-cost-puzzle-5863</link>
      <guid>https://forem.com/gde/building-a-local-first-ai-finops-agent-with-gemini-cli-mcp-ending-the-google-cloud-cost-puzzle-5863</guid>
      <description>&lt;p&gt;If you’ve ever tried to get a quick answer on &lt;strong&gt;“Why did our cloud spend spike yesterday?”&lt;/strong&gt; and found yourself tangled in slow dashboards, expensive queries, or pricey SaaS licenses, welcome to the club. FinOps is hard, but ironically, &lt;code&gt;analyzing&lt;/code&gt; cloud costs often feels more expensive and cumbersome than the costs themselves.&lt;/p&gt;

&lt;p&gt;In this article, I want to share a fresh architectural approach that flips the script entirely, a &lt;strong&gt;“Local-First” AI FinOps Agent&lt;/strong&gt; that lives right on your laptop, powered by Google’s Gemini CLI and the Model Context Protocol (MCP). The result? Instant, natural-language answers about your cloud billing data, zero cloud query charges, and absolutely no dashboard lag. Here’s how.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Problem: Paying to Understand What We Pay For
&lt;/h2&gt;

&lt;p&gt;When monitoring Google Cloud costs, we face a strange paradox, a classic &lt;code&gt;“Cost of Cost Analysis”&lt;/code&gt;. Let’s break down the pain points I see every day:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. The BigQuery Scan Tax 💸
&lt;/h3&gt;

&lt;p&gt;Your billing data lives in BigQuery, which charges based on data scanned, about &lt;code&gt;$6.25 per terabyte&lt;/code&gt;. &lt;br&gt;
That means one careless query by someone who just wants to “see all logs from last week” can cost you &lt;code&gt;tens of dollars&lt;/code&gt;, and that’s before the productivity cost of waiting for results. Ouch.&lt;/p&gt;
&lt;h3&gt;
  
  
  2. The Licensing Barrier 🚪
&lt;/h3&gt;

&lt;p&gt;Natural language querying tools like Gemini for Google Cloud can automatically turn a casual question into an SQL query. Sounds perfect, right? Except they come at a per-seat price (~$19/user/month), which quickly balloons the cost when you try to roll them out organization-wide (a few are free to start with and later changed to a charging model)&lt;/p&gt;
&lt;h3&gt;
  
  
  3. Dashboard Latency and Rigidity 🕰️
&lt;/h3&gt;

&lt;p&gt;BI dashboards hide complexity behind clicks and charts, but often feel clunky for deep-dive or ad-hoc questions. They force you to navigate predefined views, not exactly conversational or fast when you’re racing a fire drill.&lt;/p&gt;


&lt;h2&gt;
  
  
  Our Solution: The Local-First Architecture 🏠✨
&lt;/h2&gt;

&lt;p&gt;What if the “heavy lifting” didn’t happen in the cloud? What if every engineer had &lt;strong&gt;instant access&lt;/strong&gt; to their project’s billing data, answering natural questions &lt;code&gt;locally&lt;/code&gt; without costing a dime more?&lt;/p&gt;

&lt;p&gt;Here’s the core idea:&lt;/p&gt;
&lt;h3&gt;
  
  
  Shift the query compute from the cloud to your laptop.
&lt;/h3&gt;

&lt;p&gt;We leverage three ingredients to pull this off:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Gemini CLI&lt;/strong&gt;: Our natural language interface that transforms plain English into SQL queries.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Model Context Protocol (MCP)&lt;/strong&gt;: A lightweight local server running on the user's machine that orchestrates and executes SQL queries against local databases.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Decentralized data sync&lt;/strong&gt;: Syncing compact, optimized billing datasets to engineers’ devices using existing corporate storage tools (OneDrive / SharePoint).&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Core Design Principles:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Query Once, Distribute Many:&lt;/strong&gt; Execute one optimized aggregation query per day in the cloud.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Zero-Cost Local Queries:&lt;/strong&gt; All ad-hoc analysis happens on the user's laptop using local storage.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Natural Language Interface:&lt;/strong&gt; Use Generative AI (Gemini) to translate user intent into database queries locally.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxbihf3z9b6v3gbbauzi2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxbihf3z9b6v3gbbauzi2.png" alt="Building a “Local-First” AI FinOps Agent with Gemini CLI &amp;amp; MCP" width="800" height="645"&gt;&lt;/a&gt;&lt;/p&gt;


&lt;h2&gt;
  
  
  How It Works: A Day in the Life of Your Local-First FinOps Agent
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Step 1: Ingest &amp;amp; Optimize
&lt;/h3&gt;

&lt;p&gt;Instead of running thousands of raw billing queries, a single &lt;em&gt;optimized aggregation&lt;/em&gt; runs once a day in the cloud. This job:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Summarizes raw billing logs into &lt;strong&gt;partitioned, compressed SQLite databases&lt;/strong&gt; for efficient local querying.&lt;/li&gt;
&lt;li&gt;Data is partitioned by dimensions like &lt;code&gt;Project&lt;/code&gt;, &lt;code&gt;Service&lt;/code&gt;, and &lt;code&gt;Date&lt;/code&gt; for quick filtering.&lt;/li&gt;
&lt;li&gt;Scans only a fraction of the data compared to raw logs.
This yields &lt;strong&gt;1 query/day instead of 1,000 queries/day&lt;/strong&gt;, dramatically cutting costs.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Step 2: Sync
&lt;/h3&gt;

&lt;p&gt;The aggregated SQLite database files are synced to every engineer’s laptop through &lt;strong&gt;OneDrive or SharePoint sync clients&lt;/strong&gt; — no new infrastructure, no added cloud storage cost.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sync happens incrementally.&lt;/li&gt;
&lt;li&gt;Files remain small (a few hundred MB, optimized by partitioning and compression).&lt;/li&gt;
&lt;li&gt;Data privacy is controlled by existing SharePoint permissions.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Step 3: Query Locally with MCP &amp;amp; Gemini
&lt;/h3&gt;

&lt;p&gt;Here’s where the magic happens:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A &lt;strong&gt;local MCP agent&lt;/strong&gt; runs as a lightweight server on your machine.&lt;/li&gt;
&lt;li&gt;Gemini CLI takes your natural language query and passes an SQL prompt to MCP.&lt;/li&gt;
&lt;li&gt;MCP uses a &lt;strong&gt;SQLite engine&lt;/strong&gt; locally to run queries &lt;em&gt;within milliseconds&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;Results are returned to Gemini to synthesize human-readable answers by leveraging large language model reasoning on local computation context.&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  Example User Interaction
&lt;/h2&gt;

&lt;p&gt;Open your gemini cli terminal and enter:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;why is the checkout service 20% over budget this month?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Under the hood:
&lt;/h2&gt;

&lt;p&gt;Gemini translates this to something like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT service, project, SUM(cost) as total_cost
FROM billing_summary
WHERE service = 'Checkout Service' AND usage_date BETWEEN '2024-12-01' AND '2024-12-31'
GROUP BY service, project;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;The MCP agent runs this query locally on the SQLite file synced to the laptop.&lt;/li&gt;
&lt;li&gt;Raw costs for this service are fetched instantly.&lt;/li&gt;
&lt;li&gt;Gemini’s natural language model synthesizes the insight:
“The increase is driven by a new Spanner instance checkout-db-prod provisioned on the 15th."&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;No cloud queries. No expensive SaaS fees. Instant answers.&lt;/p&gt;




&lt;h2&gt;
  
  
  Security &amp;amp; Governance: Keeping Data Safe &amp;amp; Relevant
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Data Residency: All billing data resides only on the local machines of authorized users. No outbound data is sent to 3rd-party AI API endpoints, preserving confidentiality.&lt;/li&gt;
&lt;li&gt;Role-Based Access: The local MCP agent can implement filters based on user role or project membership, ensuring users only query relevant data.&lt;/li&gt;
&lt;li&gt;Auditability: Query logs remain local, avoiding centralized data exposure while enabling traceability on the user’s machine.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Comparative Analysis
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;| Feature        | Direct BigQuery           | BI Dashboards              | Proposed Local Agent                |
|----------------|---------------------------|----------------------------|-----------------------------------|
| Cost Per Query | High ($5+ / TB)           | Med (Hidden Refresh Costs) | Zero ($0.00)                      |
| Speed          | Variable (Queue times)    | Slow (Load times)          | Instant                          |
| Flexibility    | High (Full SQL)           | Low (Fixed Views)          | High (Natural Language)           |
| Accessibility  | Low (Requires SQL skills) | Med (Requires Access)      | High (Chat Interface)             |
| Data Freshness | Real-time                 | Delayed                   | Daily Sync (Sufficient for FinOps) |

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Combining Gemini CLI, MCP, and a smart decentralized sync strategy unlocks a new kind of FinOps, one where cost visibility is effortless, inexpensive, and immediate.&lt;/p&gt;

&lt;p&gt;The cloud should never charge you for asking about your bills. By shifting the compute closer to users and blending in natural language AI, we finally solve the paradox of cloud cost analysis.&lt;/p&gt;

</description>
      <category>googlecloud</category>
      <category>mcp</category>
      <category>ai</category>
      <category>cli</category>
    </item>
    <item>
      <title>Building an AI-Native Data Interface with Google ADK, MCP, and BigQuery</title>
      <dc:creator>Karthigayan Devan</dc:creator>
      <pubDate>Sat, 17 Jan 2026 12:39:09 +0000</pubDate>
      <link>https://forem.com/gde/building-an-ai-native-data-interface-with-google-adk-mcp-and-bigquery-4704</link>
      <guid>https://forem.com/gde/building-an-ai-native-data-interface-with-google-adk-mcp-and-bigquery-4704</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;For many years, enterprise data interaction has followed a predictable pattern. Engineers write SQL, teams build dashboards, and organizations rely on BI tools to understand system behavior, business performance, and costs. While these approaches remain useful, they are increasingly insufficient in modern cloud environments where scale, velocity, and operational complexity demand faster, more intelligent decision-making.&lt;/p&gt;

&lt;p&gt;From an &lt;strong&gt;SRE, platform engineering, and FinOps&lt;/strong&gt; perspective, the challenge is no longer just accessing data. The challenge is enabling safe, governed, and intelligent interaction with data that supports reliability, cost optimization, and continuous cloud transformation.&lt;/p&gt;

&lt;p&gt;To address this, I tried a &lt;strong&gt;fully working proof of concept (PoC) using Google ADK, Model Context Protocol (MCP), and BigQuery&lt;/strong&gt;, strictly based on Google’s official documentation and extended with production-grade engineering considerations. This was not a conceptual exercise or a demo-only prototype. The system runs end-to-end and reflects architectural patterns suitable for real enterprise platforms.&lt;/p&gt;

&lt;p&gt;In this article, I describe what I built, why this architecture matters for modern cloud organizations, and how Google ADK and MCP fundamentally change how AI systems can support SRE, platform, and FinOps workflows at scale.&lt;/p&gt;

&lt;h2&gt;
  
  
  What This PoC Is Really About
&lt;/h2&gt;

&lt;p&gt;At its core, this PoC explores a simple but powerful idea:&lt;br&gt;
    &lt;em&gt;What if AI agents interacted with enterprise data the same way production-grade cloud systems are expected to?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Rather than embedding SQL logic into prompts or granting broad database access, this PoC demonstrates how an AI agent can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Reason about operational, financial, or analytical questions&lt;/li&gt;
&lt;li&gt;Discover approved tools dynamically&lt;/li&gt;
&lt;li&gt;Access BigQuery through a governed, auditable interface&lt;/li&gt;
&lt;li&gt;Receive structured results suitable for reliable downstream reasoning&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The agent never improvises data access. Every interaction is explicit, policy-aligned, and traceable, which is essential in SRE- and FinOps-driven environments.&lt;/p&gt;
&lt;h2&gt;
  
  
  Why This Problem Is Worth Solving
&lt;/h2&gt;

&lt;p&gt;Many AI + data examples appear impressive but fail under real operational constraints. Common issues include hardcoded SQL in prompts, excessive permissions, and no separation between reasoning logic and execution logic.&lt;/p&gt;

&lt;p&gt;From an SRE and platform engineering standpoint, these patterns introduce unacceptable risk. From a FinOps standpoint, they obscure cost attribution, accountability, and governance.&lt;/p&gt;

&lt;p&gt;This PoC takes a different approach. Data access is treated as a platform capability, not a prompt-level shortcut. This distinction is critical for organizations focused on reliability, security, cost efficiency, and sustainable cloud transformation.&lt;/p&gt;
&lt;h2&gt;
  
  
  A Quick Introduction to Google ADK
&lt;/h2&gt;

&lt;p&gt;Google ADK (Agent Development Kit) provides a structured framework for building agentic systems that align well with cloud-native engineering principles. Instead of focusing solely on prompts, ADK formalizes agents, tools, reasoning loops, and context boundaries.&lt;/p&gt;

&lt;p&gt;For senior engineers and platform architects, ADK feels intuitive. It mirrors how reliable systems are designed: with explicit contracts, modular components, and controlled execution paths. You are not instructing a model to respond once; you are defining how it reasons, when it acts, and what platform capabilities it may invoke.&lt;/p&gt;

&lt;p&gt;This makes ADK particularly relevant for production systems supporting SRE automation, FinOps analysis, and large-scale cloud operations.&lt;/p&gt;
&lt;h2&gt;
  
  
  Understanding MCP (Model Context Protocol)
&lt;/h2&gt;

&lt;p&gt;MCP is a critical architectural component of this solution.&lt;/p&gt;

&lt;p&gt;Rather than allowing AI models to directly manipulate external systems, MCP introduces a formal protocol for tool-based interaction. Tools expose schemas, models discover capabilities, and all inputs and outputs are structured and validated.&lt;/p&gt;

&lt;p&gt;In practice, the model does not need to understand BigQuery's internals. It only needs to understand the operational contract defined by the MCP tool.&lt;/p&gt;

&lt;p&gt;This design closely aligns with platform engineering best practices and enables AI systems to operate within the same governance boundaries as other production services.&lt;/p&gt;
&lt;h2&gt;
  
  
  MCP and BigQuery: Why This Combination Matters
&lt;/h2&gt;

&lt;p&gt;Google’s official MCP support for BigQuery is especially impactful because BigQuery is often the system of record for analytics, operational metrics, and cost data.&lt;/p&gt;

&lt;p&gt;By exposing BigQuery through MCP:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Access can be tightly scoped and governed&lt;/li&gt;
&lt;li&gt;Queries are executed only through approved interfaces&lt;/li&gt;
&lt;li&gt;Permissions remain centralized and auditable&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The AI agent never becomes a privileged database user. Instead, it behaves as a controlled platform consumer, consistent with how SRE and FinOps systems are expected to operate.&lt;/p&gt;
&lt;h2&gt;
  
  
  High-Level Architecture
&lt;/h2&gt;

&lt;p&gt;At a high level, the PoC architecture looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;AI Agent (Google ADK)
        |
        |  Structured MCP tool calls
        v
MCP Server (BigQuery)
        |
        v
BigQuery datasets
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The most important takeaway here is the separation of concerns.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Reasoning happens in the agent.&lt;/li&gt;
&lt;li&gt;Execution happens in BigQuery.&lt;/li&gt;
&lt;li&gt;MCP sits cleanly in between.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How you can try this PoC in your local env
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Local Config Setup&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#clone my github repo:
git clone https://github.com/karthidec/google-adk-mcp-bigquery.git

#authenticate with google cloud
gcloud config set project [YOUR-PROJECT-ID]
gcloud auth application-default login

#enable bigquery mcp server in your google project
gcloud beta services mcp enable bigquery.googleapis.com --project=PROJECT_ID

# Create virtual environment
python3 -m venv .venv

# Activate virtual environment
source .venv/bin/activate

# Install ADK
pip install google-adk

# Navigate to the app directory
cd bq_mcp/

# Run the ADK web interface
adk web
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Defining the Agent&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The agent is created using Google ADK primitives. It includes a reasoning loop and the ability to discover and invoke MCP tools.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import os
import dotenv
from pathlib import Path
from . import tools
from google.adk.agents import Agent

# Load environment variables relative to this file
dotenv.load_dotenv(Path(__file__).parent / ".env")

PROJECT_ID = os.getenv('GOOGLE_CLOUD_PROJECT', 'project_not_set')

# Initialize the toolset
bigquery_toolset = tools.get_bigquery_mcp_toolset()

# Define the Agent
root_agent = Agent(
    model='gemini-2.5-flash', # Leveraging a fast, reasoning-capable model
    name='root_agent',
    instruction=f"""
                Help the user answer questions by strategically combining insights from two sources:

                1.  **BigQuery toolset:** Access demographic (inc. foot traffic index), 
                    product pricing, and historical sales data in the mcp_bakery dataset. 
                    Do not use any other dataset.

                Run all query jobs from project id: {PROJECT_ID}. 
                Give list of zipcodes or any general query user wants to know. 
            """,
    tools=[bigquery_toolset]
)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This structure makes the agent predictable and easier to extend over time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Registering BigQuery as an MCP Tool&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Next, BigQuery is exposed through an MCP server. The server defines exactly what operations are available and how requests should be shaped.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;dotenv&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;google.auth&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;google.auth.transport.requests&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;pathlib&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Path&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;typing&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Dict&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Optional&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Any&lt;/span&gt;

&lt;span class="c1"&gt;# We use Any here to avoid strict dependency issues if ADK isn't fully typed in your env
&lt;/span&gt;&lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;google.adk.agents.readonly_context&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;ReadonlyContext&lt;/span&gt;
&lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="nb"&gt;ImportError&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;ReadonlyContext&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Any&lt;/span&gt;

&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;google.adk.tools.mcp_tool.mcp_toolset&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;MCPToolset&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;google.adk.tools.mcp_tool.mcp_session_manager&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;StreamableHTTPConnectionParams&lt;/span&gt;

&lt;span class="c1"&gt;# Robustly load .env from the script's directory
&lt;/span&gt;&lt;span class="n"&gt;dotenv&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;load_dotenv&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Path&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;__file__&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="n"&gt;parent&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;.env&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;BIGQUERY_MCP_URL&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;https://bigquery.googleapis.com/mcp&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;get_auth_headers&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;Dict&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt;
    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;
    Generates fresh authentication headers. 
    Crucial for long-running agents where tokens might expire.
    &lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
    &lt;span class="n"&gt;credentials&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;project_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;google&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;auth&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;default&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;scopes&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;https://www.googleapis.com/auth/bigquery&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# Fallback if default auth doesn't pick up the project ID
&lt;/span&gt;    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;project_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;project_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getenv&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;GOOGLE_CLOUD_PROJECT&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# Force a token refresh to ensure validity
&lt;/span&gt;    &lt;span class="n"&gt;auth_req&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;google&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;auth&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;transport&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Request&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="n"&gt;credentials&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;refresh&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;auth_req&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;oauth_token&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;credentials&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;token&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Authorization&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Bearer &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;oauth_token&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;x-goog-user-project&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;project_id&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;project_id&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="sh"&gt;""&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Content-Type&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;application/json&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;auth_header_provider&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Optional&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;ReadonlyContext&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;Dict&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt;
    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;Callback function used by the MCP Client to inject headers.&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;get_auth_headers&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;get_bigquery_mcp_toolset&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="c1"&gt;# Initial headers for the handshake
&lt;/span&gt;    &lt;span class="n"&gt;initial_headers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;get_auth_headers&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

    &lt;span class="c1"&gt;# We use StreamableHTTPConnectionParams for efficient data transfer
&lt;/span&gt;    &lt;span class="n"&gt;tools&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;MCPToolset&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;connection_params&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nc"&gt;StreamableHTTPConnectionParams&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;BIGQUERY_MCP_URL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;initial_headers&lt;/span&gt;
        &lt;span class="p"&gt;),&lt;/span&gt;
        &lt;span class="c1"&gt;# This provider is the secret sauce for handling token expiry
&lt;/span&gt;        &lt;span class="n"&gt;header_provider&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;auth_header_provider&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;tools&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This step is where governance really comes into play. The tool definition becomes the contract.&lt;/p&gt;

&lt;p&gt;The response is structured, predictable, and easy for the agent to interpret.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why This PoC Goes Beyond a Demo
&lt;/h2&gt;

&lt;p&gt;The value of this PoC lies not only in functionality, but in architectural discipline.&lt;/p&gt;

&lt;p&gt;It demonstrates:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Agentic reasoning aligned with SRE decision workflows&lt;/li&gt;
&lt;li&gt;Tool-based execution instead of brittle SQL-in-prompt patterns&lt;/li&gt;
&lt;li&gt;Enterprise-grade governance and security&lt;/li&gt;
&lt;li&gt;A realistic path from PoC to production&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For SRE, platform engineering, and FinOps leaders, these characteristics are essential.&lt;/p&gt;

&lt;h2&gt;
  
  
  Practical Use Cases
&lt;/h2&gt;

&lt;p&gt;This architectural pattern supports multiple high-impact use cases:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;FinOps assistants for cost visibility and optimization&lt;/li&gt;
&lt;li&gt;SRE copilots for reliability, incident analysis, and capacity planning&lt;/li&gt;
&lt;li&gt;Platform analytics agents with strict access controls&lt;/li&gt;
&lt;li&gt;Executive decision systems grounded in governed cloud data&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The same design scales naturally as organizational maturity grows.&lt;/p&gt;

&lt;h2&gt;
  
  
  Key Takeaways
&lt;/h2&gt;

&lt;p&gt;Building this PoC reinforced several core principles:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;MCP is foundational for governed, enterprise AI&lt;/li&gt;
&lt;li&gt;Google ADK aligns well with platform engineering practices&lt;/li&gt;
&lt;li&gt;BigQuery is a natural backend for SRE and FinOps intelligence&lt;/li&gt;
&lt;li&gt;Separation of reasoning and execution is non-negotiable&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;This PoC demonstrates that &lt;strong&gt;AI-native cloud platforms have moved beyond experimentation&lt;/strong&gt;. With Google ADK and MCP, it is now possible to build intelligent agents that support &lt;strong&gt;reliability engineering, platform operations, and financial governance&lt;/strong&gt; in a secure and scalable way.&lt;/p&gt;

&lt;p&gt;For organizations undergoing cloud digital transformation, this approach provides a disciplined foundation for integrating AI into core operational workflows rather than treating it as an isolated experiment.&lt;/p&gt;

&lt;p&gt;Happy building 🚀&lt;/p&gt;

&lt;h2&gt;
  
  
  PoC Shot
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb6x72zi9427dpaov8ims.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb6x72zi9427dpaov8ims.png" alt=" " width="800" height="397"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://google.github.io/adk-docs/" rel="noopener noreferrer"&gt;Google Agent Development Kit (ADK)&lt;/a&gt;:&lt;/strong&gt; A robust framework for building, testing, and deploying AI agents.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://docs.cloud.google.com/bigquery/docs/use-bigquery-mcp" rel="noopener noreferrer"&gt;Google Big Query Model Context Protocol (MCP)&lt;/a&gt;:&lt;/strong&gt; An open standard that acts like a "USB port" for AI. We specifically use the &lt;strong&gt;BigQuery MCP Server&lt;/strong&gt; to connect our model to data without custom, brittle integrations.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Key Challenge Faced: Authentication &amp;amp; Session Management
&lt;/h2&gt;

&lt;p&gt;During this PoC, the biggest technical hurdle was &lt;strong&gt;authentication&lt;/strong&gt;. Standard HTTP connections often use static headers. However, Google Cloud OAuth tokens are short-lived (usually 1 hour). If your agent runs longer than that, a static token results in a &lt;code&gt;403 Forbidden&lt;/code&gt; error.&lt;/p&gt;

&lt;p&gt;To solve this, I implemented a &lt;strong&gt;Dynamic Header Provider&lt;/strong&gt;. Instead of passing a fixed string, I pass a function that regenerates the OAuth token whenever the MCP session establishes a connection or refreshes its token.&lt;/p&gt;

</description>
      <category>cloud</category>
      <category>ai</category>
      <category>architecture</category>
      <category>googlecloud</category>
    </item>
    <item>
      <title>Google Cloud Model Armor - LLMs Protection</title>
      <dc:creator>Karthigayan Devan</dc:creator>
      <pubDate>Sun, 21 Sep 2025 14:14:32 +0000</pubDate>
      <link>https://forem.com/karthidec/google-cloud-model-armor-llms-protection-3mh1</link>
      <guid>https://forem.com/karthidec/google-cloud-model-armor-llms-protection-3mh1</guid>
      <description>&lt;h2&gt;
  
  
  Cloud Armor:
&lt;/h2&gt;

&lt;p&gt;Google Cloud Armor helps protect your infrastructure and applications from Layer 3/Layer 4 network or protocol-based volumetric distributed denial-of-service (DDoS) attacks, volumetric Layer 7 attacks, and other targeted application attacks. It leverages Google's global network and distributed infrastructure to detect and absorb attacks and filter traffic through user-configurable security policies at the edge of Google's network, far upstream of your workloads.&lt;/p&gt;

&lt;p&gt;Model Armor takes care of a few significant threats as covered in the OWASP top 10 LLM vulnerabilities list. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Malicious files and unsafe URLs&lt;/li&gt;
&lt;li&gt;Prompt injection and jailbreaks&lt;/li&gt;
&lt;li&gt;Sensitive data&lt;/li&gt;
&lt;li&gt;Offensive material&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Core Features:
&lt;/h2&gt;

&lt;p&gt;Floor settings establish the bare minimum security requirements that all your custom configurations within the template must meet. It's the security bedrock.&lt;/p&gt;

&lt;h4&gt;
  
  
  Organization level:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;A floor setting at this level adds minimum requirements to all templates associated with any project and any folder inside the organization&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Folder level:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;A floor setting at this level adds a minimum requirement to all templates associated with any project inside the folder.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Project level:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;A floor setting at this level adds a minimum requirement to all templates associated with a project.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Template:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;A template is your control panel, letting you dial in exactly how Model Armor examines prompts and responses.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Confidence level:
&lt;/h2&gt;

&lt;h4&gt;
  
  
  Low and above:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Model Armor screens almost everything. At this level, it's going to identify issues with the smallest hint of alignment to the detection criteria.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Medium and above:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Model Armor is a bit more discerning. It flags things that are moderate matches to the detection criteria.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  High and above:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Model Armor is pretty darn confident that the information is a strong match to the detection criteria.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How to enable Model Armor in Google Cloud?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Navigate to Security Command Center -&amp;gt; Model Armor -&amp;gt; Enable API&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Configure floor settings:
&lt;/h2&gt;

&lt;h4&gt;
  
  
  Detections:
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3cptd9c1sj7m5g9s1vl9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3cptd9c1sj7m5g9s1vl9.png" alt=" " width="576" height="602"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Responsible AI:
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5pjotl8gzmtfpayti7uh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5pjotl8gzmtfpayti7uh.png" alt=" " width="800" height="447"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Saved Floor settings:
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3iown0crje1eriz08g6i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3iown0crje1eriz08g6i.png" alt=" " width="694" height="624"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Configure template settings:
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo3syosq1t427vgtyxgsw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo3syosq1t427vgtyxgsw.png" alt=" " width="524" height="729"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F24jwzjjm572odpp33mnk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F24jwzjjm572odpp33mnk.png" alt=" " width="445" height="502"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After you create the template, it will be saved as follows. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx5nvqo9x0iort6b8t8fr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx5nvqo9x0iort6b8t8fr.png" alt=" " width="800" height="69"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Logs:
&lt;/h2&gt;

&lt;p&gt;Model Armor is a multi-tasker. It's screening the text going in and out of the LLM, and it's also taking notes on the activities. These notes are surfaced to you in the form of logs.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Admin Activity audit logs&lt;/strong&gt; capture details about templates, floor settings, and basic computing (CRUD) operations.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Data access audit logs&lt;/strong&gt; capture details about screening operations. For example, what template was used to screen a prompt or response, what was the text, and what was the result?&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Logs Explorer:
&lt;/h4&gt;

&lt;p&gt;Below are a few filters:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;protoPayload.serviceName="modelarmor.googleapis.com"

&lt;ul&gt;
&lt;li&gt;This filer shows you audit logs that track template actions like create or update.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;protopayload.methodName="google.cloud.modelarmor.v1.ModelArmor.SanitizeUserPrompt"

&lt;ul&gt;
&lt;li&gt;This filter shows you the Data Access audit logs that capture prompt and response screening.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h2&gt;
  
  
  Sample Python code:
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# pip install google-cloud-modelarmor
from google.cloud import modelarmor_v1
import sys

# Create a client
client = modelarmor_v1.ModelArmorClient(transport="rest", client_options = {"api_endpoint" : "modelarmor.us-central1.rep.googleapis.com"})

# Initialize request argument(s)
user_prompt_data = modelarmor_v1.DataItem()

# Get the prompt from command line argument
if len(sys.argv) &amp;gt; 1: # Check if an argument is provided
    prompt = sys.argv[1] # Take the first argument as the prompt
else:
    # Fallback to a default prompt if no argument is provided
    prompt = "Placeholder prompt."

# Set prompt data for model armor call
user_prompt_data.text = prompt
ma_request = modelarmor_v1.SanitizeUserPromptRequest(
    name="projects/xxx-armor-demo-012346/locations/us-central1/templates/pijb-only", # name contains the project and template
    user_prompt_data=user_prompt_data,
)

# Make the MA request
ma_response = client.sanitize_user_prompt(request=ma_request)

# Take action based on Model Armor's result
if ma_response.sanitization_result.filter_results["pi_and_jailbreak"].pi_and_jailbreak_filter_result.match_state == modelarmor_v1.FilterMatchState.MATCH_FOUND: # A PIJB match was found
    print("Query failed security check. Error.")
else:
    print("Query passed security check. Sending prompt to LLM.")

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Pricing model:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://cloud.google.com/armor/pricing" rel="noopener noreferrer"&gt;https://cloud.google.com/armor/pricing&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  References:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://cloud.google.com/armor/docs/" rel="noopener noreferrer"&gt;https://cloud.google.com/armor/docs/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://cloud.google.com/security-command-center/docs/reference/model-armor/rest" rel="noopener noreferrer"&gt;https://cloud.google.com/security-command-center/docs/reference/model-armor/rest&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/watch?v=fH62NUGwsyo" rel="noopener noreferrer"&gt;https://www.youtube.com/watch?v=fH62NUGwsyo&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>cloudarmor</category>
      <category>llm</category>
      <category>gcp</category>
      <category>security</category>
    </item>
  </channel>
</rss>
