<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Protecting Your Company Data When Integrating Coding Agents through Unity AI Gateway in Generative AI</title>
    <link>https://community.databricks.com/t5/generative-ai/protecting-your-company-data-when-integrating-coding-agents/m-p/176397#M2271</link>
    <description>&lt;P&gt;Coding agents like Claude Code, Codex, OpenCode, or PI, started through the ug launcher, and integrated with foundation models through Unity AI Gateway can run with whatever Databricks permissions the developer already has through MCPs that is native on Databricks such as AI Search MCP(s), or Genie MCP(s).&lt;/P&gt;&lt;P&gt;Basically this introduce risk to the company if you are trying to protect the data before the model for whatever the reason is AI governance, law, etc, ...&lt;/P&gt;&lt;P&gt;We have been adopting protective mechanism in layers, where each one catches what the one above it misses.&lt;/P&gt;&lt;P&gt;- The first layer is what you already have. Since the agent acts as the user, Unity Catalog row filters, column masks, ABAC tag policies and plain least-privilege grants still apply to whatever it reads. But usually, people have multiple permissions and we want to protect the coding agent from reading the PII from those who have such permissions.&lt;/P&gt;&lt;P&gt;- The second layer is Sensitive Data Detection policy on the model service, you can turn this on on the UI and set it at rank 1, with tags email_address and credit_card. The model gets a token such as [US_SSN] instead of the value. Everything else just allows or denies. Some limitations that we have experience, the REDACT mechanism can be sometime to strict and remove important information from the coding agent such as AWS account number, Databricks workspace id when it is trying to perform task on such environment and break the workflow.&lt;/P&gt;&lt;P&gt;- The third layer is for what the built-ins miss or you can replace it completely to match some of your workflow. A custom SQL policy is a function that takes the event and returns a decision. The body is converted to a small SQL subset, so no regexp, just things like CONTAINS, LIKE and STARTSWITH.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;CREATE OR REPLACE FUNCTION main.governance.block_private_keys(
  event VARIANT
)
RETURNS VARIANT
LANGUAGE SQL
RETURN
  CASE
    WHEN event:type::string = 'request'
      AND CONTAINS(event:context.message::string, 'PRIVATE KEY-----')
    THEN to_variant_object(named_struct('result', 'DENY', 'reason', 'Prompt contains a private key.'))
    ELSE to_variant_object(named_struct('result', 'ALLOW', 'reason', ''))
  END;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 14 Nov 2026 10:30:49 GMT</pubDate>
    <dc:creator>DoTA</dc:creator>
    <dc:date>2026-11-14T10:30:49Z</dc:date>
    <item>
      <title>Protecting Your Company Data When Integrating Coding Agents through Unity AI Gateway</title>
      <link>https://community.databricks.com/t5/generative-ai/protecting-your-company-data-when-integrating-coding-agents/m-p/176397#M2271</link>
      <description>&lt;P&gt;Coding agents like Claude Code, Codex, OpenCode, or PI, started through the ug launcher, and integrated with foundation models through Unity AI Gateway can run with whatever Databricks permissions the developer already has through MCPs that is native on Databricks such as AI Search MCP(s), or Genie MCP(s).&lt;/P&gt;&lt;P&gt;Basically this introduce risk to the company if you are trying to protect the data before the model for whatever the reason is AI governance, law, etc, ...&lt;/P&gt;&lt;P&gt;We have been adopting protective mechanism in layers, where each one catches what the one above it misses.&lt;/P&gt;&lt;P&gt;- The first layer is what you already have. Since the agent acts as the user, Unity Catalog row filters, column masks, ABAC tag policies and plain least-privilege grants still apply to whatever it reads. But usually, people have multiple permissions and we want to protect the coding agent from reading the PII from those who have such permissions.&lt;/P&gt;&lt;P&gt;- The second layer is Sensitive Data Detection policy on the model service, you can turn this on on the UI and set it at rank 1, with tags email_address and credit_card. The model gets a token such as [US_SSN] instead of the value. Everything else just allows or denies. Some limitations that we have experience, the REDACT mechanism can be sometime to strict and remove important information from the coding agent such as AWS account number, Databricks workspace id when it is trying to perform task on such environment and break the workflow.&lt;/P&gt;&lt;P&gt;- The third layer is for what the built-ins miss or you can replace it completely to match some of your workflow. A custom SQL policy is a function that takes the event and returns a decision. The body is converted to a small SQL subset, so no regexp, just things like CONTAINS, LIKE and STARTSWITH.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;CREATE OR REPLACE FUNCTION main.governance.block_private_keys(
  event VARIANT
)
RETURNS VARIANT
LANGUAGE SQL
RETURN
  CASE
    WHEN event:type::string = 'request'
      AND CONTAINS(event:context.message::string, 'PRIVATE KEY-----')
    THEN to_variant_object(named_struct('result', 'DENY', 'reason', 'Prompt contains a private key.'))
    ELSE to_variant_object(named_struct('result', 'ALLOW', 'reason', ''))
  END;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 14 Nov 2026 10:30:49 GMT</pubDate>
      <guid>https://community.databricks.com/t5/generative-ai/protecting-your-company-data-when-integrating-coding-agents/m-p/176397#M2271</guid>
      <dc:creator>DoTA</dc:creator>
      <dc:date>2026-11-14T10:30:49Z</dc:date>
    </item>
    <item>
      <title>Re: Protecting Your Company Data When Integrating Coding Agents through Unity AI Gateway</title>
      <link>https://community.databricks.com/t5/generative-ai/protecting-your-company-data-when-integrating-coding-agents/m-p/176570#M2272</link>
      <description>&lt;DIV class=""&gt;&lt;P class=""&gt;The SQL policy for blocking private keys is a strong starting point. To make these rules easier to manage, it helps to clarify ownership: defining what counts as an unapproved credential or sensitive token often involves both security and platform engineering.&lt;/P&gt;&lt;P class=""&gt;For a scalable approach, I’d recommend addressing this from two angles. First, complement runtime gateway controls with automated scans across codebases and environments. This can help identify and resolve risky secret handling at the source, before an agent encounters it.&lt;/P&gt;&lt;P class=""&gt;Second, custom SQL policies at the gateway benefit from a reliable testing process. Historical gateway run data can serve as an offline evaluation suite. Before updating a policy, such as adding a pattern to block, you can test it against past runs to assess whether it would interfere with valid developer tasks or fail to detect sensitive data. This makes policy updates more predictable and helps teams improve protections with confidence.&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 16 Nov 2026 16:00:30 GMT</pubDate>
      <guid>https://community.databricks.com/t5/generative-ai/protecting-your-company-data-when-integrating-coding-agents/m-p/176570#M2272</guid>
      <dc:creator>slowder</dc:creator>
      <dc:date>2026-11-16T16:00:30Z</dc:date>
    </item>
  </channel>
</rss>

