DataPrivacy & SecuritySoftware & SaaS

Okta moved its AI agents' context into dbt pull requests, and wrong answers became one-merge fixes

Okta's analytics engineers found that their AI agents failed on context they couldn't audit, even though the models themselves worked fine. Here is how they rebuilt that context as reviewed code in dbt, what it changed, and how a CDO can apply the same approach.

Okta's first AI analytics agents worked, and that was the problem. According to an account published by dbt Labs (a vendor whose tooling Okta chose, so treat this as a customer story rather than an audit), Okta's early AI experiments ran on semantic views built directly inside Snowflake's UI, wired straight to Snowflake Cortex agents. It worked, and it worked fast, but those semantic views were completely disconnected from the governed dbt models that actually defined the business logic. The team behind them is small. Crahen's team, about thirteen analytics engineers embedded across delivery, go-to-market, product, and finance, sits inside a broader technology, data, and intelligence org that runs on Tableau for reporting and Snowflake as the central warehouse.

Pooja Crahen, Okta's senior manager of analytics engineering, explained the problem at dbt Summit 2026: "A couple years in, the realization came in where building the agent was never really the hard part," Crahen said. "What it could see and trust was the hard part." Her team found three cracks in that foundation: context fragmentation between Snowflake and dbt, no auditability since everything lived in UI click history, and all of an agent's instructions flattened into one undifferentiated blob.

Okta's position is what makes this case useful. The company sells identity governance for AI agents. CEO Todd McKinnon told investors that among customers "over 90% of them have agents in production and only 22% of them are confident that they have them governed" (a vendor's own customer read, so not a neutral benchmark). Even so, Okta's internal data team didn't break down on access. It broke down on meaning. My thesis: an agent can hold exactly the right permissions and still give a confident wrong answer. For a CDO, governing AI risk means putting the context agents read under the same change control as the code that produces the numbers, keeping it in one repository, and publishing it where every agent can read it.

How Okta moved agent context out of the Snowflake UI and into dbt

The three cracks turned into concrete failures. Nobody could discover what existed, because semantic views had no catalog exposing them outside Snowflake; nobody could trust what they found, with no shared system of record confirming it was current; and every team ended up re-deriving its own definitions from scratch. That third failure is the one that should worry a CDO. When every team writes its own definitions, you end up with several versions of each KPI, and no one is responsible for any of them.

Three layers of context, one pull request workflow

The fix was a three-layer agent context framework, built entirely inside dbt and shipped through normal pull requests.

  • At the asset level, model and column-level metadata gets a new "agent" sub-block in the YAML, flagging what a model is safe to use for, what to avoid it for, and any filters that need to apply automatically.
  • At the company level, context docs, in markdown, capture company-wide facts (Okta's fiscal year starts February 1) and domain-specific routing rules.
  • At the metric level, semantic views, migrated out of the Snowflake UI into dbt's own semantic layer spec, become the governed, PR-reviewed source of facts, dimensions, and metrics.

The migration was automated too. Getting semantic views into dbt took a custom skill wired to a slash command that pulls the DDL off an existing Snowflake semantic view and converts it into a dbt semantic view spec automatically. If you want to see how metric definitions turn into a single contract that every consumer queries, our lesson ondbt's semantic layer spec and governed metrics goes deeper.

Publishing context through Agents Schema

Keeping context in one repository only matters if agents actually read from it. At Okta, all three sync automatically into Agents Schema, an open, warehouse-native metadata standard, so any agent with SQL access, whether it's Cortex or Claude, reads the same definitions. In the open-source repository maintained by dbt Labs, after the first run, your warehouse has queryable metadata tables such as AGENTS.DBT_MODEL, AGENTS.LOOKML_VIEW, AGENTS.OMNI_VIEW, or AGENTS.OSI_DATASET. Agents can use those tables to understand which models and semantic objects exist. The standard is commercially backed: Fivetran and dbt Labs, now one company, announced that their new Context Layer uses Agents Schema, an open source standard, that centralizes context in a structured, extensible format directly in the data warehouse.

Okta also took the design question to the dbt community. It opened a public GitHub discussion on dbt Core asking whether something like a Cortex agent should just be a normal dbt model materialization, or deserves to be a first-class node type of its own, the way an exposure is. That question is worth watching. If agents become nodes in the DAG, lineage tools could show which agents a schema change would break.

Did governing context in dbt make Okta's agents more accurate?

Okta hasn't published an accuracy figure, so the honest answer is that we don't know by how much. What the company reports is consistency and faster fixes. According to Crahen, fixing a wrong answer no longer means editing an opaque agent config and redeploying through multiple cycles. An analytics engineer merges a change to the context layer in dbt, and every agent that reads from it gets smarter immediately. Her summary: "The result is the 100th question gets the same quality answer as the first," and "It's not about the agent. It's more about the context as infrastructure."

The roadmap shows what's still missing. Next up for the team: automated regression tests that run verified queries against the agents every time context changes, extending context beyond a single domain, and eventually checking agent answers against ground truth. So today, a context merge reaches every agent at once, but no automated test yet confirms that the merge improved anything. That gap is the next thing to close, because the same mechanism that spreads a fix instantly will spread a mistake just as fast.

Data Culture, a consultancy, measured what Okta hasn't yet. Its results also come through dbt Labs and its own blog, so they're vendor-adjacent. Data Culture started with a set of 13 golden questions, real business questions that stakeholders would ask, each with a verified correct answer, then added context one layer at a time. With the agent pointed at raw tables, the result was SQL generation: 0% | Accuracy: 0%. Later, their evaluation turned out to be the problem. Answers were marked wrong because the agent named a column TOTAL_APPOINTMENTS when we expected APPOINTMENT_COUNT. Or it returned 33.30% when we had written 33.3%. Once they fixed the comparison logic, accuracy jumped into the low 90s. We hadn't touched the agent at all. The figure dbt Labs reports for that deployment is 94.7%.

For a neutral baseline, Gartner predicts that through 2026, organizations will abandon 60% of AI projects unsupported by AI-ready data, and advises organizations to ensure continued investment and ongoing maturity in metadata management, data observability, and D&A and AI governance. Okta's setup is one concrete version of that advice.

What CDOs can copy from Okta's context-as-code model

A sorting rule for agent context

Okta's three layers give you a simple rule for deciding where each piece of context belongs. Put it on the whiteboard:

If it's true for the whole company, it's a context doc. If it computes a number, it's a semantic definition. If it limits how a table may be used, it's a model-level guardrail. If it lives anywhere else, it's a risk.

Then check each item with four questions. Where does it live? Who approved it? When did it last change? Can every agent read it? Answers like "in a UI", "nobody", "not sure" or "only one agent" point to the cracks Okta found.

A worked example: Okta's fiscal calendar

Okta's fiscal year starts on February 1, and the company reports on that calendar. Its most recent results were for the second quarter fiscal year 2027, which reported total revenue of $805 million. Here's the arithmetic. If Q1 runs February to April, Q2 runs May to July 2026. An agent that doesn't know this and is asked for "Q2 revenue" will pull April to June. Only two of the three months overlap, so one-third of the period is wrong, and the agent will still return a precise-looking number. With a single line in a reviewed context doc, every agent gets the quarter right. Without it, each team has to remember to tell its own agent, and Okta found that teams don't reliably do that.

Where your situation differs from Okta's

Okta runs on one warehouse and has a mature dbt practice. If your metrics are spread across Snowflake, Databricks and a BI tool's own semantic layer, the value of an open standard goes up. Agents Schema already lists dbt, Looker, Omni, OSI, Sigma, Markdown skills as sources. If you don't have dbt in production, start by getting your definitions version-controlled before you build agents on top of them.

The security point CDOs tend to skip is that a YAML "avoid" flag is guidance for the agent. It doesn't enforce anything. An agent that ignores its context can still query any table its role can reach. The real control is a warehouse grant, a row policy or an identity layer, and that's where Okta's commercial products come in: the company says each agent is treated as a "unique first-class identity" in Okta's Universal Directory, rather than as a user or service account. So pair every "avoid" flag with an enforced rule, followinga zero-trust approach to classification and access. Context governance decides whether an answer is right. Access control decides whether the agent was allowed to look in the first place.

This becomes more pressing as agents start writing transformation code. In news items dbt Labs published from its 2026 summit (vendor sources), Careem's agent writes and validates dbt models before a human reviews the PR, and DocuSign reported a 50% productivity gain from pairing Claude Code with dbt MCP. Once agents can edit the context layer, review of context pull requests is a security control.

What to do on Monday about AI agent context

  • List every place agent instructions live today: warehouse UIs, system prompts, copilot configs, notebooks. Count them. Okta's problem started with that number being greater than one.
  • Write a single markdown context doc for one domain. Include the fiscal calendar, customer definitions and routing rules, commit it to the repo, and assign a code owner.
  • Add an agent metadata block to your ten most-queried models, stating what each is safe for, what to avoid, and which filters are mandatory.
  • Write 13 golden questions with domain experts (the number Data Culture used) and run them by hand after every context change until you can automate the run.
  • Map each "avoid" flag to a real warehouse grant or row policy. Wherever no such rule exists, open a ticket with your security team.

Okta didn't solve agent trust with a better model or a new access tool. It made the definitions agents rely on reviewable, versioned and shared, so that one merge corrects every agent at once. The next step, which Okta hasn't built yet, is a regression test that proves each merge made answers better.

Frequently asked questions

How does Okta use dbt to govern context for AI agents?

Okta built a three-layer context framework inside dbt and ships changes through normal pull requests. Model YAML gets an agent block with safe uses, things to avoid and mandatory filters, markdown docs hold company-wide facts like the February 1 fiscal year start, and semantic views moved into dbt's semantic layer spec.

What is Agents Schema and why did Okta use it?

Agents Schema is an open, warehouse-native metadata standard that publishes context as queryable tables in the warehouse, such as AGENTS.DBT_MODEL. Okta syncs its dbt context into it so that any agent with SQL access, whether Snowflake Cortex or Claude, reads the same governed definitions and doesn't keep its own copy.

Is a semantic layer enough to secure AI agents' access to data?

No. A semantic layer and agent metadata tell an agent what data means and which tables to avoid, but they don't enforce anything. An agent can still query whatever its role permits, so every "avoid" flag needs a matching warehouse grant, row policy or agent identity control, like the first-class agent identities Okta registers in Universal Directory.

How do you measure whether better context improves an AI analytics agent?

Start with golden questions that domain experts have verified, then rerun them after each context change. Data Culture used 13 golden questions and found that cosmetic mismatches, such as 33.30% versus 33.3%, were being scored as errors. Once it fixed the comparison logic, measured accuracy rose into the low 90s without any change to the agent.

Go deeper

The lessons that take this article further, free to read.

  1. 1dbt (data build tool): industrialized SQL transformationModern data architecture
  2. 2The metrics & semantic layerAnalytics, BI & decision intelligence
  3. 3Generative AI in the enterprise: RAG, risks & governanceAI & machine learning strategy
  4. 4Data lineage & metadata management: knowing where your data was bornData governance & compliance
  5. 5Data classification & access control: the zero-trust data approachData governance & compliance

Sources

Finished reading?

Validate your read to earn XP and feed your radar.