Skip to content

Add server setting ai_function_allow_sql_named_collections - #124999

Merged
george-larionov merged 3 commits into
masterfrom
ai-functions-config-named-collections
Oct 14, 2026
Merged

george-larionov merged 3 commits into
masterfrom
ai-functions-config-named-collections

Conversation

@george-larionov

@george-larionov george-larionov commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Closes: https://github.com/ClickHouse/clickhouse-private/issues/77887

Adds the server setting ai_function_allow_sql_named_collections (default true). When disabled, AI functions (aiGenerate, aiEmbed, aiSimilarity, etc.) accept only named collections defined in the server configuration file; collections created with CREATE NAMED COLLECTION throw ACCESS_DENIED. This applies to both the credentials parameter and the ai_function_*_default_credentials settings. It lets an administrator restrict AI functions to provider credentials and endpoints configured by the administrator.

Changelog category (leave one):

  • New Feature

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

Added server setting ai_function_allow_sql_named_collections. When disabled, AI functions accept only named collections defined in the server configuration file.


Workflow [PR]
Sync PR [sync-upstream/pr/124999]

Version info

  • Merged into: 26.10.1.2421-master (included in 26.10 and later)
  • Backported to: 26.9.26.30, 26.8.35.27

When disabled, AI functions accept only named collections defined in the server configuration file.

Related: ClickHouse/clickhouse-private#77887

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@clickhouse-gh

clickhouse-gh Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [a14df58]

Summary: ✅


AI Review

Summary

Adds ai_function_allow_sql_named_collections, allowing administrators to restrict AI functions to named collections defined in server configuration while preserving the existing behavior by default. No actionable findings at PR head a14df58e4acd1c9d526d575947eddf5fc52f0bc6.

Missing context / blind spots
  • ⚠️ The linked private issue returned HTTP 404, so any additional acceptance criteria remain unavailable. Its contents would close this gap; the public PR description provides a clear reviewable contract.
Final Verdict

Status: ✅ Approve.

@clickhouse-gh clickhouse-gh Bot added the pr-feature Pull request with new product feature label Oct 9, 2026
@clickhouse-gh clickhouse-gh Bot added the comp-regular-function Regular scalar functions: string processing, data conversion, arithmetic, math, comparison, condi... label Oct 9, 2026
@rschu1ze rschu1ze self-assigned this Oct 13, 2026
Comment thread src/Core/ServerSettings.cpp Resolved
DECLARE(Bool, ai_function_allow_sql_named_collections, true, R"(
Allows AI functions (such as `aiGenerate`, `aiEmbed`, `aiSimilarity`) to use named collections created with `CREATE NAMED COLLECTION`.
When disabled, AI functions accept only named collections defined in the server configuration file, and using any other collection throws an exception.
This applies both to the `credentials` parameter and to the `ai_function_text_default_credentials` and `ai_function_embedding_default_credentials` settings.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The setting is about named collections. L. 981 mentions other settings, that's a bit confusing.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure how else to write it, it does apply to these default credential settings...

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, okay then.

@mintlify

mintlify Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
ClickHouse-docs 🟢 Ready View Preview Oct 14, 2026, 7:10 PM

@george-larionov
george-larionov added this pull request to the merge queue Oct 14, 2026
Merged via the queue into master with commit 6caeb45 Oct 14, 2026
178 checks passed
@george-larionov
george-larionov deleted the ai-functions-config-named-collections branch October 14, 2026 23:27
@robot-ch-test-poll3 robot-ch-test-poll3 added the pr-synced-to-cloud The PR is synced to the cloud repo label Oct 14, 2026
@ayakovlev-clickhouse

Copy link
Copy Markdown
Contributor

@george-larionov

Ask from AI team to backport this to 26.8, this will be main release for Beta.
Thanks.

@robot-clickhouse robot-clickhouse added the pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore label Oct 28, 2026
@robot-ch-test-poll4 robot-ch-test-poll4 added the pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR label Oct 28, 2026
PedroTadim added a commit that referenced this pull request Oct 29, 2026
Backport #124999 to 26.8: Add server setting `ai_function_allow_sql_named_collections`
PedroTadim added a commit that referenced this pull request Oct 29, 2026
Backport #124999 to 26.9: Add server setting `ai_function_allow_sql_named_collections`
leshikus pushed a commit that referenced this pull request Nov 13, 2026
leshikus pushed a commit that referenced this pull request Nov 13, 2026

This branch was successfully deployed

1 active deployment
staging - docs — a14df58e Deployed Oct 14, 2026 by mintlify[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp-regular-function Regular scalar functions: string processing, data conversion, arithmetic, math, comparison, condi... pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore pr-feature Pull request with new product feature pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR pr-synced-to-cloud The PR is synced to the cloud repo v26.8-must-backport

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants