Enterprise AI Engineering

Snowflake AI Function Optimization Is GA. Your Evaluation Still Needs a Release Gate.

Snowflake's November 16 GA releases make prompt and model optimization a repeatable experiment. The hard part remains holdout evaluation, access control and cost per accepted outcome.

Cortex AI FunctionsSnowflakeModel OptimizationEvaluation
Article snapshotEnterprise AI Engineering
Article typeEnterprise AI Engineering
Reading time14 min read
PublishedNov 17, 2026
System diagram

Architecture map

A candidate cannot inherit production trust merely by winning an optimizer's validation metric.

4Domains
10Components
11Flows

Illustrative engineering architecture. Evaluation and optimization produce candidates; a separate acceptance gate and production release process decide whether any candidate can be used.

On 16 November 2026, Snowflake announced general availability for Cortex AI Function Optimization and Cortex AI Function Studio. The larger engineering change is not that a platform can suggest better prompts. It is that model choice, prompt variants, labeled test data and cost comparisons can now be organized as repeatable, inspectable Snowflake experiments, with the selected implementation exposed through a stable SQL function. That moves inference tuning closer to conventional data-product engineering: specify the contract, score behavior, compare alternatives, approve a revision, then monitor it in use. Optimization GA release · Studio GA release.

The relevant enterprise question is not "which model scored highest?" It is "which version meets a defined quality threshold for the lowest defensible cost per accepted outcome, while respecting privacy, latency and access constraints?" A redaction classifier that loses one critical identifier, or an invoice extractor that invents a tax number, can appear cheaper per call while being more expensive to operate. Automated optimization is useful only if its scoring dataset, deployment boundaries and release gates reflect those consequences.

What is GA, what is still qualified, and why it matters

Capability or claimEvidence as of 17 Nov 2026Engineering interpretation
AI Function Studio creation, evaluation and optimization workflowSnowflake announced GA on 16 NovTreat release announcement as current status, but verify account access and region
AI_FUNCTION_OPTIMIZATIONSnowflake announced GA on 16 NovExecutes experiment-based candidate search; original function is unchanged
CREATE/EXECUTE EXPERIMENTThe EXPERIMENT SQL reference still labels parts PreviewDocumentation labeling lags the GA release; obtain account-specific confirmation for governance review
Supported optimization formExactly one AI_COMPLETE call, one metric and a versioned datasetThis is narrower than arbitrary multi-step AI pipeline optimization
CoCoEvolve research prototypeSnowflake engineering blog dated 9 NovPublished research results are not an API SLA or proof all research capabilities ship in the GA interface

The distinction is intentional: release notes describe GA, while the SQL command documentation still carries a preview badge. The exact entitlement, regional model availability and commercial terms must be checked for the target account, especially for regulated workloads. Optimization guide · Experiments reference.

An automated optimizer can overfit as efficiently as a human

Consider an email-intake classifier that labels claims as routine, urgent, sensitive or unknown. A seed function calls AI_COMPLETE with a compact prompt. A tuning system tests alternate instructions and candidate models against a labeled set. The danger is not merely an occasionally wrong answer. If the examples overweight routine messages, optimization can maximize overall accuracy by being consistently wrong on the rare but costly sensitive cases. If the same cases guide both prompt changes and approval, the apparent quality lift may reflect memorization of validation examples rather than an improvement that survives production.

Before optimizing, define an evaluation contract: input schema, ground-truth source and reviewer, label taxonomy, policy exceptions, acceptable abstentions, minimum quality thresholds by failure class, latency objective, and a cost budget. Split examples into a tuning set and an untouched holdout set. Freeze the holdout until a candidate is ready to qualify. Track per-class precision/recall, not just aggregate accuracy, and reserve adversarial examples for identifiers, language variants, formatting tricks and instruction injection. A human adjudicator should review disagreements between automated judges and expected labels. The experiment's built-in test_score is useful, but it is not a substitute for a separate enterprise acceptance set.

Reference architecture: optimize in an isolated evaluation lane

What Snowflake's experiment actually does

A Snowflake EXPERIMENT is a schema-level object. The optimization specification names an AI function, scoring metric, versioned Snowflake ML dataset, candidate models, reflection model, optimization strategy and search budget. EXECUTE EXPERIMENT starts an asynchronous serverless run. The result contains a baseline SEED evaluation and ITER_<N> candidates. Each candidate can expose validation score, held-out test score (for frontier runs), cost relative to seed, its selected model and its implementation. A successful experiment does not replace the existing function. Promotion is a separate CREATE AI FUNCTION ... FROM EXPERIMENT action. Optimization SQL reference · Experiment lifecycle.

StageNative surfaceEnterprise control to add
Create seedCREATE AI FUNCTIONFunction signature, schema, allowed data fields
Assemble evidenceVersioned SNOWFLAKE.ML.DATASETConsent, labeling policy, difficult cases, immutable snapshot
Run comparisonAI_FUNCTION_OPTIMIZATION experimentEligible models, metric, budget, job owner, regional processing
Inspect candidatesSHOW RUNS, SHOW RUN METRICSTest score, class regressions, quality-cost frontier
QualifySeparate untouched acceptance testNegative authorization tests, blinded adjudication, latency
PromoteCREATE AI FUNCTION ... FROM EXPERIMENTNew versioned function; preserve previous version
MonitorProduction queries and Account UsageRejection/abstention rate, cost, drift and rollback

SQL pattern: start with a bounded classification experiment

The following is an illustrative adaptation of Snowflake's published examples. It assumes a valid CREATE AI FUNCTION object and a versioned labeled SNOWFLAKE.ML.DATASET; it does not create those prerequisites.

-- 1. A small, bounded search over two permitted models.
CREATE OR REPLACE EXPERIMENT ai_lab.eval.claims_opt_v1
  TYPE = 'AI_FUNCTION_OPTIMIZATION'
  FROM SPECIFICATION $$
function:
  function_name: "ai_lab.prod.classify_claim(VARCHAR)"
metrics:
  - name: exact_match
dataset:
  name: ai_lab.eval.claims_labels
  version: v1
  column_mapping:
    argument_mapping:
      body: claim_text
    ground_truth: expected_class
optimization:
  models:
    - claude-haiku-4-5
    - claude-sonnet-4-6
  reflection_model: claude-sonnet-4-5
  strategy: balanced
  budget: ultra-light
$$;

EXECUTE EXPERIMENT ai_lab.eval.claims_opt_v1;

-- 2. Check async status and compare candidates with seed.
SHOW RUNS IN EXPERIMENT ai_lab.eval.claims_opt_v1;
SHOW RUN METRICS IN EXPERIMENT ai_lab.eval.claims_opt_v1 RUN SEED;
SHOW RUN METRICS IN EXPERIMENT ai_lab.eval.claims_opt_v1 RUN ITER_1;

-- 3. After separate approval, publish a NEW function,
-- replacing the example run name with the selected winner.
CREATE AI FUNCTION ai_lab.prod.classify_claim_v2(body VARCHAR)
  RETURNS VARCHAR
  FROM EXPERIMENT ai_lab.eval.claims_opt_v1 RUN ITER_1;

The model IDs, dataset, roles and signature must be validated for the account. The example ITER_1 is not a recommended winner. Never promote until the actual run has finished and passed independent review. See SQL syntax and metric definitions and CREATE AI FUNCTION.

The labeled dataset is the most important engineering asset

Snowflake currently recommends roughly 50–200 labeled rows and permits a maximum of 1,000 for these experiments. That makes evaluation set design more consequential, not less. Do not fill 150 rows with near-duplicates of easy tickets. Stratify by source, document type, language, consequence, failure mechanism and low-frequency business rules. Include normal inputs, ambiguous inputs, adversarial text, missing data, malformed documents and examples expected to produce an abstention. If several rows derive from one customer case or document, split by case or entity rather than randomly by row, otherwise content leakage can make a holdout unrealistically easy.

The built-in metrics include exact, fuzzy and contains matching, redaction match, an LLM judge and a custom UDF metric. Choose by the nature of the output. Exact match is appropriate for a short enum, after deterministic normalization; it is a poor score for a long explanation where multiple phrasings are acceptable. A judge is more flexible but may reward style instead of correctness, may be sensitive to prompt wording and can itself fail. A custom metric should encode critical constraints, such as whether a redacted output still contains a phone number, or whether a signed amount agrees with a reference value. Independent tests must cover errors that the chosen single optimization metric ignores. Evaluation reference · Optimization metrics.

The frontier is not a savings guarantee

Snowflake reports candidate val_score, a held-out test_score on frontier candidates, cost_compared_to_seed and an is_frontier flag. The frontier is useful because a candidate that scores marginally better may cost several times as much per inference. But inference cost is only part of total cost. Experiments use serverless compute billed under SERVERLESS_EXPERIMENTS, while model calls are metered separately. Scoring with an LLM judge, additional candidate models and larger search budgets all create real spend before the first production call. The documentation notes that ultra-light roughly corresponds to 4–6 proposals per candidate model and heavy to about 27–40; budgets apply per model. Optimization guide · Billing reference.

A useful economic measure is:

total_cost_per_accepted_output = (experiment_amortization + production_inference + SQL_compute + retries + human_review + remediation) / independently_accepted_outputs

For illustration only, suppose Model A costs 1 unit per call and delivers 90 accepted cases out of 100; Model B costs 1.5 units per call and delivers 98. Ignoring all other costs, the model-only cost per accepted case is about 1.11 units for A and 1.53 for B. B may still be preferable if its avoided errors are high-risk or expensive. This is a constructed example, not a Snowflake benchmark or customer result.

Evaluation should report both the Pareto frontier and hard gates: minimum critical-case recall, zero policy violations, a bounded p95 latency and a maximum effective cost per accepted output. A frontier winner can still fail the business acceptance test.

Security boundaries the optimizer does not enforce for you

An optimization experiment needs access to labeled inputs and permission to call models. It must not automatically receive production customer data, unrestricted AI model access or deployment rights. Snowflake documents schema CREATE EXPERIMENT, experiment MODIFY to execute, referenced-object USAGE, and an appropriate Cortex database role. Separate these privileges from production CREATE FUNCTION and deployment authorization. For sensitive datasets, use minimized or synthetic inputs where meaningful, apply masking or role-scoped access, and verify model availability and processing geography. The AI Function Studio guide explicitly notes native availability in selected regions and cross-region inference for other accounts; regulated residency claims therefore need account- and model-specific proof. Experiment privileges · Regional availability.

Failure modeConsequenceTest and control
Labels are noisy or disputedOptimizer improves the wrong objectiveDual-review sampled gold set; disagreement register
Training/validation leakageInflated quality with poor real-world transferSplit by customer, case, time or document family
Critical errors hidden by average scoreUnsafe redaction or wrong account allocationRisk-weighted scorecard and hard negative tests
Prompt injection in test documentsCandidate learns to follow untrusted contentAdversarial corpus, schema validation, least-privilege outputs
Unapproved candidate modelResidency, privacy or policy breachAllowlisted models and account/region attestation
Automatic replacement of production logicRegression despite favorable validationNew versioned function, canary, explicit release approval
One metric disguises other regressionsBetter score but worse latency, fairness or costIndependent multi-metric acceptance
Evaluation budget overrunsUnexpected serverless and inference spendStart ultra-light, cap candidates, monitor credit usage
Experiment or dataset dropped mid-runJob failure or loss of evidenceRetain versioned inputs and runs until signed off
Drift after deploymentInitial winner stops meeting requirementsScheduled quality checks, rollback to last accepted function

CoCoEvolve's research results are not production SLAs

The optimization release follows Snowflake's 9 November 2026 engineering article on CoCoEvolve, an evolutionary optimizer that uses a coding agent to inspect historical candidate strategies and test changes. Snowflake reports leading GEPA, AdaEvolve and OpenEvolve on six AI Function tasks; on its HotpotQA prompt-only test, the company reports held-out accuracy of 0.793, versus 0.683 for GEPA and 0.363 for the seed. It also reports gains on an agent benchmark. These results are vendor-run experiments on specific splits, model backbones, scoring rules and budgets, not an independent guarantee for enterprise data. Critically, the research prototype could evolve multi-stage SQL and tool-use programs, while the released AI function optimizer is documented as tuning one AI_COMPLETE call. Treat the prototype's gains as a research direction, not as promised behavior of the production interface. Snowflake engineering article, 9 Nov.

A four-gate production adoption plan

Gate 1: Capability and data access. Confirm exact account and region availability, role privileges, approved candidate models, valid labeled dataset and separate experiment/production schemas. Stop on unresolved processing geography or model entitlement.

Gate 2: Offline optimization. Run the seed and a small ultra-light comparison; confirm the metric and async lifecycle work and inspect candidate implementation differences. Stop on invalid labels, unstable scoring, timeouts or unexplained expense.

Gate 3: Independent acceptance. On a holdout no optimizer has seen, run matched repeated trials, stratify critical errors, test adversarial inputs, and compare cost and p95 latency. If no candidate clears minimum risk thresholds, retain the seed. A new release is not mandatory.

Gate 4: Controlled promotion. Create a new versioned AI function; canary it against a small permitted population; record the data-version, experiment run, model and acceptance sign-off; monitor outcomes and cost. Revert callers to the prior function on quality, security or spend regression.

The exit evidence should be reproducible: frozen dataset versions, experiment specification, candidate SQL, scores, rejected cases, reviewer decisions, model pricing assumption and rollback instructions.

A scorecard that survives procurement review

MeasureWhy it belongs in the release decision
Critical-class recall and precisionPrevent common-case accuracy from hiding expensive misses
Blinded human-adjudicated acceptanceCheck correctness independently of an LLM judge
Unsupported-output and abstention rateDetect fabricated or unjustifiably confident outputs
Security-negative testsDemonstrate that permissions and redaction rules hold
Stability across repeated runsMeasure variance for nondeterministic models
p50/p95 completion latencyConfirm that better quality still meets user workload requirements
Inference tokens and credits per accepted outputCompare actual model economics
Serverless experiment spendInclude optimization and evaluation overhead
Failed-candidate and timeout rateQuantify wasted search effort
Drift and rollback successDemonstrate maintainability after model, data or prompt changes

When a simpler approach is better

Use deterministic SQL or rules for exact calculations, joins, reconciliations and straightforward validation. For a tiny stable classification domain, manual prompt tests with fixed golden cases may be cheaper and more transparent than an evolutionary search. Where a workflow requires retrieval, multiple model calls, reasoning over tools, or approvals, the one-AI_COMPLETE optimization surface is not the complete solution; evaluate that larger pipeline separately. The value of Snowflake's new workflow is strongest when a repeated unstructured-data task already has clear labels, significant run volume, an agreed loss function and a safe way to release versions of the AI logic.

The engineering conclusion

The 16 November GA announcements make repeatable AI-function experimentation easier to integrate with Snowflake-native engineering. They do not eliminate the fundamental evaluation problem: an optimizer can only improve the behavior represented by its examples, objective and accessible models. The production discipline remains the same: design a representative gold set, prefer held-out measurements over attractive validation charts, count full operating cost, enforce data and model boundaries, and promote only candidates that survive independent checks. That is how model optimization becomes a reliable data product rather than a succession of prompt experiments.

Primary sources and dates

Evidence boundaries: All product states and research outcomes above are Snowflake's own published statements. Risk controls, illustrative economics, reference architecture, SQL adaptation and acceptance gates are independent engineering recommendations. No customer improvements or AgentFaktory delivery results are claimed.

ENGINEER THE RELEASE, NOT JUST THE PROMPT

Are your AI functions improving on real business cases?

Model selection is only useful when labeled data, risk thresholds and deployment controls agree. AgentFaktory helps teams build governed Snowflake AI workflows, independent evaluation harnesses and measurable cost-quality release gates for production use.

Start with the data, evaluation criteria and operating constraints.