Skip to content

[8.19] Feature/default llm setting ai settings (#233874)#234391

Merged
KDKHD merged 2 commits intoelastic:8.19from
KDKHD:backport/8.19/pr-233874
Sep 10, 2025
Merged

[8.19] Feature/default llm setting ai settings (#233874)#234391
KDKHD merged 2 commits intoelastic:8.19from
KDKHD:backport/8.19/pr-233874

Conversation

@KDKHD
Copy link
Member

@KDKHD KDKHD commented Sep 9, 2025

Backport

This will backport the following commits from 9.1 to 8.19:

Questions ?

Please refer to the Backport tool documentation

## Summary

Summarize your PR. If it involves visual changes include a screenshot or
gif.

Follow-up to this change: elastic#231940

The PR linked above could not be backported to 8.18, 9.19, 9.1 because
the GenAi settings page where the setting was added to does not exist in
the versions just listed. As this setting is needed on these version,
this PR is required. This PR adds the Default LLM setting to the
Security, Obs & ES AI settings pages.

<img width="1855" height="1171" alt="image"
src="https://github.com/user-attachments/assets/ab09be60-97b6-40d4-bcfc-5e9859360502"
/>

<img width="1855" height="1171" alt="image"
src="https://github.com/user-attachments/assets/b8c1ae43-e1ee-4f42-bbcb-d7f67be6a598"
/>

<img width="1855" height="1171" alt="image"
src="https://github.com/user-attachments/assets/5647de7f-d1de-4e46-9940-f165b1ef8b7b"
/>

<img width="1855" height="1171" alt="image"
src="https://github.com/user-attachments/assets/791c953e-a321-419c-a121-66974a6f8b34"
/>

### How to test:
- Enable the feature flag. Add
`feature_flags.overrides.aiAssistant.defaultLlmSettingEnabled: true` to
kibana.dev.yml
- Start Kibana and go to
http://localhost:5601/app/management/kibana/securityAiAssistantManagement?tab=connectors
or
http://localhost:5601/app/management/kibana/observabilityAiAssistantManagement
- You should see the `genAiSettings:defaultAIConnector` setting.
Changing the setting won't do anything just yet as changes within the
assistants still need to be configured.

TODO:
When the feature flag is lifted, we should remove the following Kibana
advanced setting as this one will rpelace it:
<img width="2412" height="198" alt="image"
src="https://github.com/user-attachments/assets/f3d1c421-f7c5-42b9-b5dc-85c29b8ef3eb"
/>

### Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

- [X] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [X]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [X] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [X] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [X] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [X] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [X] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [X] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

### Identify risks

Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.

- [ ] [See some risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
- [ ] ...

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
(cherry picked from commit 6141299)

# Conflicts:
#	package.json
#	tsconfig.base.json
#	x-pack/platform/packages/shared/kbn-elastic-assistant/tsconfig.json
#	x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/routes/components/settings_tab/ui_settings.tsx
#	yarn.lock
@KDKHD KDKHD requested a review from kibanamachine as a code owner September 9, 2025 08:30
@KDKHD KDKHD added the backport This PR is a backport of another PR label Sep 9, 2025
@KDKHD KDKHD enabled auto-merge (squash) September 9, 2025 08:30
@KDKHD
Copy link
Member Author

KDKHD commented Sep 9, 2025

/ci

@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
elasticAssistant 463 494 +31
integrationAssistant 581 612 +31
observabilityAiAssistantManagement 416 421 +5
securitySolution 7513 7544 +31
total +98

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/ai-assistant-default-llm-setting - 10 +10
@kbn/management-settings-ids 129 131 +2
total +12

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
observabilityAiAssistantManagement 122.2KB 129.0KB +6.8KB
securitySolution 9.4MB 9.5MB +17.0KB
total +23.8KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
kbnUiSharedDeps-srcJs 3.7MB 3.7MB -129.0B
Unknown metric groups

API count

id before after diff
@kbn/ai-assistant-default-llm-setting - 10 +10
@kbn/management-settings-ids 130 132 +2
total +12

ESLint disabled line counts

id before after diff
@kbn/ai-assistant-default-llm-setting - 4 +4

Total ESLint disabled count

id before after diff
@kbn/ai-assistant-default-llm-setting - 4 +4

History

@KDKHD KDKHD merged commit f245fff into elastic:8.19 Sep 10, 2025
8 checks passed
KDKHD added a commit that referenced this pull request Sep 26, 2025
# Backport

This will backport the following commits from `9.1` to `9.0`:
- [Feature/default llm setting ai settings
(#233874)](#233874)

<!--- Backport version: 10.0.2 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Kenneth
Kreindler","email":"42113355+KDKHD@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-09-09T08:09:02Z","message":"Feature/default
llm setting ai settings (#233874)\n\n## Summary\n\nSummarize your PR. If
it involves visual changes include a screenshot or\ngif.\n\nFollow-up to
this change: https://github.com/elastic/kibana/pull/231940\n\nThe PR
linked above could not be backported to 8.18, 9.19, 9.1 because\nthe
GenAi settings page where the setting was added to does not exist
in\nthe versions just listed. As this setting is needed on these
version,\nthis PR is required. This PR adds the Default LLM setting to
the\nSecurity, Obs & ES AI settings pages.\n\n<img width=\"1855\"
height=\"1171\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/ab09be60-97b6-40d4-bcfc-5e9859360502\"\n/>\n\n<img
width=\"1855\" height=\"1171\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/b8c1ae43-e1ee-4f42-bbcb-d7f67be6a598\"\n/>\n\n<img
width=\"1855\" height=\"1171\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/5647de7f-d1de-4e46-9940-f165b1ef8b7b\"\n/>\n\n<img
width=\"1855\" height=\"1171\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/791c953e-a321-419c-a121-66974a6f8b34\"\n/>\n\n###
How to test:\n- Enable the feature flag.
Add\n`feature_flags.overrides.aiAssistant.defaultLlmSettingEnabled:
true` to\nkibana.dev.yml\n- Start Kibana and go
to\nhttp://localhost:5601/app/management/kibana/securityAiAssistantManagement?tab=connectors\nor\nhttp://localhost:5601/app/management/kibana/observabilityAiAssistantManagement\n-
You should see the `genAiSettings:defaultAIConnector` setting.\nChanging
the setting won't do anything just yet as changes within the\nassistants
still need to be configured.\n\nTODO:\nWhen the feature flag is lifted,
we should remove the following Kibana\nadvanced setting as this one will
rpelace it:\n<img width=\"2412\" height=\"198\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/f3d1c421-f7c5-42b9-b5dc-85c29b8ef3eb\"\n/>\n\n\n###
Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers
should verify this PR satisfies this list as well.\n\n- [X] Any text
added follows [EUI's
writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\nsentence case text and includes
[i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n-
[X]\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\nwas
added for features that require explanation or tutorials\n- [X] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [X] If a plugin
configuration key changed, check if it needs to be\nallowlisted in the
cloud and added to the
[docker\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\n-
[X] This was checked for breaking HTTP API changes, and any
breaking\nchanges have been approved by the breaking-change committee.
The\n`release_note:breaking` label should be applied in these
situations.\n- [X] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\n- [X] The PR description includes the
appropriate Release Notes section,\nand the correct `release_note:*`
label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n-
[X] Review the
[backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand
apply applicable `backport:*` labels.\n\n### Identify risks\n\nDoes this
PR introduce any risks? For example, consider risks like hard\nto test
bugs, performance regression, potential of data loss.\n\nDescribe the
risk, its severity, and mitigation for each identified\nrisk. Invite
stakeholders and evaluate how to proceed before merging.\n\n- [ ] [See
some
risk\nexamples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)\n-
[ ] ...\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"6141299372af19ca322fb9d90c05d8b775954e48","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","ci:project-deploy-observability","Team:Security
Generative
AI","backport:version","v8.18.0","v9.1.0","v8.19.0","v8.18.7","v8.19.4"],"title":"Feature/default
llm setting ai
settings","number":233874,"url":"https://github.com/elastic/kibana/pull/233874","mergeCommit":{"message":"Feature/default
llm setting ai settings (#233874)\n\n## Summary\n\nSummarize your PR. If
it involves visual changes include a screenshot or\ngif.\n\nFollow-up to
this change: https://github.com/elastic/kibana/pull/231940\n\nThe PR
linked above could not be backported to 8.18, 9.19, 9.1 because\nthe
GenAi settings page where the setting was added to does not exist
in\nthe versions just listed. As this setting is needed on these
version,\nthis PR is required. This PR adds the Default LLM setting to
the\nSecurity, Obs & ES AI settings pages.\n\n<img width=\"1855\"
height=\"1171\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/ab09be60-97b6-40d4-bcfc-5e9859360502\"\n/>\n\n<img
width=\"1855\" height=\"1171\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/b8c1ae43-e1ee-4f42-bbcb-d7f67be6a598\"\n/>\n\n<img
width=\"1855\" height=\"1171\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/5647de7f-d1de-4e46-9940-f165b1ef8b7b\"\n/>\n\n<img
width=\"1855\" height=\"1171\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/791c953e-a321-419c-a121-66974a6f8b34\"\n/>\n\n###
How to test:\n- Enable the feature flag.
Add\n`feature_flags.overrides.aiAssistant.defaultLlmSettingEnabled:
true` to\nkibana.dev.yml\n- Start Kibana and go
to\nhttp://localhost:5601/app/management/kibana/securityAiAssistantManagement?tab=connectors\nor\nhttp://localhost:5601/app/management/kibana/observabilityAiAssistantManagement\n-
You should see the `genAiSettings:defaultAIConnector` setting.\nChanging
the setting won't do anything just yet as changes within the\nassistants
still need to be configured.\n\nTODO:\nWhen the feature flag is lifted,
we should remove the following Kibana\nadvanced setting as this one will
rpelace it:\n<img width=\"2412\" height=\"198\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/f3d1c421-f7c5-42b9-b5dc-85c29b8ef3eb\"\n/>\n\n\n###
Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers
should verify this PR satisfies this list as well.\n\n- [X] Any text
added follows [EUI's
writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\nsentence case text and includes
[i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n-
[X]\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\nwas
added for features that require explanation or tutorials\n- [X] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [X] If a plugin
configuration key changed, check if it needs to be\nallowlisted in the
cloud and added to the
[docker\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\n-
[X] This was checked for breaking HTTP API changes, and any
breaking\nchanges have been approved by the breaking-change committee.
The\n`release_note:breaking` label should be applied in these
situations.\n- [X] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\n- [X] The PR description includes the
appropriate Release Notes section,\nand the correct `release_note:*`
label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n-
[X] Review the
[backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand
apply applicable `backport:*` labels.\n\n### Identify risks\n\nDoes this
PR introduce any risks? For example, consider risks like hard\nto test
bugs, performance regression, potential of data loss.\n\nDescribe the
risk, its severity, and mitigation for each identified\nrisk. Invite
stakeholders and evaluate how to proceed before merging.\n\n- [ ] [See
some
risk\nexamples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)\n-
[ ] ...\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"6141299372af19ca322fb9d90c05d8b775954e48"}},"sourceBranch":"9.1","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/234393","number":234393,"state":"MERGED","mergeCommit":{"sha":"d4d07104bb5214d5c71636faa60868b7c360907e","message":"[8.18]
Feature/default llm setting ai settings (#233874) (#234393)\n\n#
Backport\n\nThis will backport the following commits from `9.1` to
`8.18`:\n- [Feature/default llm setting ai
settings\n(#233874)](https://github.com/elastic/kibana/pull/233874)\n\n\n\n###
Questions ?\nPlease refer to the [Backport
tool\ndocumentation](https://github.com/sorenlouv/backport)\n\n\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>"}},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/234391","number":234391,"state":"MERGED","mergeCommit":{"sha":"f245fff3b218ef395cb1105f74cf04134b1cfe87","message":"[8.19]
Feature/default llm setting ai settings (#233874) (#234391)\n\n#
Backport\n\nThis will backport the following commits from `9.1` to
`8.19`:\n- [Feature/default llm setting ai
settings\n(#233874)](https://github.com/elastic/kibana/pull/233874)\n\n\n\n###
Questions ?\nPlease refer to the [Backport
tool\ndocumentation](https://github.com/sorenlouv/backport)\n\n\n\n---------\n\nCo-authored-by:
kibanamachine <42973632+kibanamachine@users.noreply.github.com>"}}]}]
BACKPORT-->

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants