> ## Documentation Index
> Fetch the complete documentation index at: https://docs.omni.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Gate content creation with ai_context

> Use model-level ai_context to make blobby search for existing content, reuse skills, and pause for approval before it builds a new dashboard, app, or query.

[All guides](https://docs.omni.co/guides.md)

Progress

%

Category

patterns

Last updated

September 2026

# Gate content creation with ai\_context

Left on its own, blobby will happily generate a new query, tile, or dashboard for a question your organization has already answered. This guide walks through a pattern for model-level `ai_context` that puts checks in front of that behavior: look for existing content first, reuse a saved skill instead of writing raw fields, and pause for a person to approve a plan before anything gets built or run. It also covers where to set a rough AI-credit estimate on that approval step, and how to tell whether the gates are actually holding once they're live.

This is especially relevant if:

* Your organization is seeing AI credit costs climb because people are rebuilding dashboards and apps that already exist
* You want blobby to check saved content and skills before it generates a new query, on every request rather than only when someone happens to ask
* You want a plan-and-approve step in front of dashboard, app, or query creation, particularly for less experienced users

## Why gate before you build

blobby already does some of this by default. Before it generates a new query, [the Omni Agent searches dashboard names and tile titles](https://docs.omni.co/ai/chat.md#searching-existing-dashboards) for content that might already answer the question, and surfaces a highlighted card when it finds a direct match. That default search is a good baseline, but it only covers dashboards, and it's a suggestion blobby weighs alongside everything else in its context — not a rule it's forced to obey.

### What ai\_context adds on top

`ai_context` lets you turn that baseline behavior into an explicit, ordered sequence: check content, then check skills, then draft a plan and wait for approval before creating or modifying anything. None of the later steps — skill reuse, plan drafting, approval gates — exist as defaults. You have to ask for them.

### What ai\_context can't guarantee

`ai_context` from the model, topic, and view levels is all passed to the LLM together, and [the LLM decides how much weight to give each instruction](https://docs.omni.co/modeling/develop/ai-optimization.md#context-and-agent-behavior). It can partially follow a gate, fully follow it, or occasionally skip it — especially when instructions are long or contradictory. Treat the pattern in this guide as a strong nudge that holds up well in practice, not as an enforcement mechanism. The last section covers how to pair it with settings that actually enforce a boundary.

## Start with direct term-to-destination routing

The simplest version of this pattern doesn't search at all - it routes known terms straight to the content that already answers them. If your organization already knows that any question about QBRs, your CRM pipeline, or your executive numbers has one canonical answer, tell blobby to stop and point there instead of reasoning about it:

```yaml title="Direct routing for known terms" wrap theme={null} theme={null}
ai_context: |
  Anytime anyone asks about one of these terms, stop processing and direct them to the
  corresponding app or dashboard:
  QBRs: /apps/<qbr-app-id>
  CRM pipeline: /apps/<pipeline-app-id>
  Exec summary: /dashboards/<exec-dashboard-id>
```

This is a good starting point precisely because it's so constrained: there's no search step to skip and no plan for blobby to misjudge, just a short list of terms mapped to fixed destinations. The tradeoff is that it only covers the terms you list - anything outside that list falls through to blobby's normal behavior, including the search-and-plan pattern below if you've also added it. Treat direct routing as a fast lane for your highest-traffic, most duplicated questions, and the search-first pattern as the fallback for everything else.

> [!NOTE]
>
> This is still `ai_context`, so the same limitation from the previous section applies: it's a strong instruction, not a hard redirect. Confirm it's actually firing with the [workbook inspector](#debug-with-the-workbook-inspector) before relying on it for your highest-traffic terms.

## Write content-first gates in ai\_context

For questions that aren't on a fixed list, the next step up is asking blobby to search before it builds, rather than routing to a fixed destination. The instructions below come from testing this pattern against a live model. The first version described the checks in loose prose; the second tightened them into an ordered list and named the specific action to gate.

### Order the gates as steps, and give blobby an exit

A single paragraph of guidance competes with everything else in the context window for attention. Numbering the checks, and telling blobby explicitly not to skip ahead, keeps the sequence intact:

```yaml title="First pass: plain-language steps" wrap theme={null} theme={null}
ai_context: |-
  First, use content search to share any existing dashboards, saved workbooks or apps relevant to the user's question, ask or request. e.g. build a dashboard about events then return events content first and then follow the second step.
  Second, if a user asks the agent to build a dashboard or an app, make sure to use the plan tool and then use the user input tool to prompt the user to collaborate with the agent to build a plan for the content creation. give the user approximate credit costs in numbers to execute the plan and require approval before building.
  Third, if a user prompts the agent to generate a query, present the user with a plan for the query before actually running the query and give the user the approximate credit cost to run the query in numbers and require approval before running the query response.
  Fourth, if a user asks for trips over time, instead of generating a query, prompt the user to use the existing skill.
```

This version works, but it reads as a description of the desired outcome rather than a sequence blobby must follow in order. Numbering the steps and adding language like "do not skip ahead" and "only skip if" makes the sequence explicit and gives blobby a defined condition for leaving it:

```yaml title="Second pass: ordered gates with an exit condition" wrap theme={null} theme={null}
ai_context: |-
  Content-first discipline. Follow these gates in order; do not skip ahead.

  1. Before generating any query, or building a dashboard or app, search existing content
     with the user's ask. If it returns any results, present them first - lead with any
     item marked as directly answering the question - and ask the user whether that already
     covers their need. Only skip this step if the user explicitly asks for something new,
     ad-hoc, or different from what exists.

  2. Before writing a new query, search saved skills for the key nouns and metrics in the
     request (e.g. "trips over time" -> search "trips"). If a skill matches, run it instead
     of generating raw SQL or fields. Only generate a new query when no skill matches.

  3. Before creating or modifying any dashboard, app, or query (once steps 1-2 haven't already
     resolved the request), draft the concrete plan - which topics, fields, filters, and
     visualizations - and present it to the user with a single choice: approve, change the
     plan, or cancel. Wait for the response. Do not create or modify any content, and do not
     just describe what you would do in text - stop and wait for an answer.
```

### Name the exact action you want gated

Vague verbs like "check first" leave room for blobby to interpret what counts as checking. Naming the concrete action — content search, a specific tool, a specific setting — removes that ambiguity. Omni's own documentation uses this same technique: the chain-of-thought example in [Optimize models for Omni AI](https://docs.omni.co/modeling/develop/ai-optimization.md#implement-chain-of-thought-reasoning) explicitly references the `GenerateQuery` tool by name so blobby knows exactly which action to pause before.

If you want a gate to be unconditional rather than a strong suggestion, `ai_context` isn't the right layer for it. The [`ai_settings.disabled_tools`](https://docs.omni.co/modeling/models/parameters/ai-settings/disabled-tools) model parameter removes a tool entirely — for example, `create_dashboard_from_chat` turns off dashboard creation from chat outright, with no prompt-level workaround. Reach for `ai_context` when you want blobby to check first and ask; reach for `disabled_tools` when the answer needs to always be no.

## Add a rough AI-credit estimate to the approval step

Once blobby is pausing for approval, that's a natural place to also show a rough cost. One AI credit equals \$1, and [credit usage varies with task complexity, model tier, and how much context the model carries](https://docs.omni.co/ai/settings/usage.md#what-are-credits), so any number you generate before running the plan is necessarily an estimate.

> [!WARNING]
>
> Don't ask blobby to state a single precise dollar figure as if it were a bill. A false-precise number is worse than a clearly labeled range, and actual usage can vary between runs of the same prompt.

Extend the plan step with language like the following:

```yaml title="Adding a credit estimate to the approval step" wrap theme={null} theme={null}
ai_context: |-
  4. When presenting a plan or a query for approval, include a rough AI-credit cost range -
     not an exact figure; 1 AI credit = $1. Estimate from the plan's shape: each additional
     turn or tool call you expect (content search, plan drafting, one query generation and one
     visualization pass per tile) typically costs on the order of $0.05-$0.50 in credits,
     depending on model and context size. Scale roughly with the number of turns or tiles in
     the plan, and widen the range for larger builds. State it as an approximate range (e.g.
     "roughly $2-6 in AI credits"), label it as a rough estimate rather than a bill, and point
     the user to their AI credit usage settings for the actual total afterward.
```

The estimate in chat is meant to set expectations before a build runs, not to replace tracked usage. The [Credit Tracking dashboard](https://docs.omni.co/ai/settings/usage.md#detailed-usage) in AI Hub shows actual consumption by feature and by user, and it's the number to check after the fact rather than the range blobby quoted beforehand.

## Check whether the gates are actually holding

Because `ai_context` is guidance rather than a strict rule, it's worth confirming what blobby actually did with it before relying on the pattern in production.

### Debug with the workbook inspector

The [workbook inspector](https://docs.omni.co/analyze-explore/workbook-inspector.md) shows the context a given AI session actually received and the tool calls it made. Use it to confirm blobby is genuinely searching content and skills before generating a query, rather than skipping the check and generating anyway. If a gate isn't holding, it's usually because the model's other context — sample queries, topic descriptions, a long conversation history — is competing for attention; trimming that context can help the gate surface more consistently.

### Pair soft gates with hard controls

For anything that needs to hold every time, back the `ai_context` pattern with settings that don't depend on the LLM choosing to follow them:

* [`ai_settings.disabled_tools`](https://docs.omni.co/modeling/models/parameters/ai-settings/disabled-tools) removes a capability like dashboard creation or forecasting from a model entirely, regardless of what's asked in chat.
* [Per-user and organization-level AI credit limits](https://docs.omni.co/ai/settings/usage.md#user-level-credit-controls) cap total spend even if a gate is skipped on an individual request.
* [`ai_settings` tuning profiles](https://docs.omni.co/guides/ai/tuning-cost-quality) control model tier and reasoning depth, which drive per-turn cost independently of whether content-first gates are followed.

`ai_context` steers what blobby chooses to do; these settings limit what it's able to do at all. Use both together rather than treating one as a substitute for the other.

## Next steps

* [Optimize models for Omni AI](https://docs.omni.co/modeling/develop/ai-optimization.md) - Curate the broader context blobby uses across a model
* [Tuning Omni AI for cost and quality](https://docs.omni.co/guides/ai/tuning-cost-quality.md) - Combine `ai_settings` parameters into cost and quality profiles
* [disabled\_tools reference](https://docs.omni.co/modeling/models/parameters/ai-settings/disabled-tools.md) - Turn off specific AI capabilities at the model level
* [Managing AI credit usage](https://docs.omni.co/ai/settings/usage.md) - Set organization and user-level credit limits and monitor actual spend
