Skip to content

[9.1] [Security Solution] [Ai Assistant] Enable the Global Security AI assistant (#226556)#227772

Merged
KDKHD merged 3 commits intoelastic:9.1from
KDKHD:backport/9.1/pr-226556
Jul 14, 2025
Merged

[9.1] [Security Solution] [Ai Assistant] Enable the Global Security AI assistant (#226556)#227772
KDKHD merged 3 commits intoelastic:9.1from
KDKHD:backport/9.1/pr-226556

Conversation

@KDKHD
Copy link
Member

@KDKHD KDKHD commented Jul 14, 2025

Backport

This will backport the following commits from main to 9.1:

Questions ?

Please refer to the Backport tool documentation

…stant (elastic#226556)

## Summary

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

Modify AI assistant visibility settings to allow for the Security AI
assistant to be global.

This fixes an issue in the product that several users have raised. It is
very unintuitive for them that when in the Security Solution view, they
can not open the AI assistant when in the Discover page.

> Users couldn’t add the AI Assistant to the Discover flyout and hadn’t
been able to resolve it for weeks

Changes:
- Add "Security" as an option in the
`aiAssistant:preferredAIAssistantType` setting (this is the setting used
in stateful Kibana to determine assistant visibility).
- Modify setting labels and options inside of serverless oblt and
serverless security to be relevant to the project type.

### Screenshots

<details>

<summary>Stateful</summary>

The same setting is used across all solution views in stateful Kibana.
This is not a perfect solution, as when a user is in the Security
solution, they can technically still select the Oblt assistant (in this
case no assistant will be shown). In the next minor release, this will
be fixed with a new AI assistant settings page.

### Classic

<img width="1840" alt="image"
src="https://github.com/user-attachments/assets/d601eb42-60a9-40ff-922c-0369249f2b70"
/>

### Oblt

<img width="1840" alt="image"
src="https://github.com/user-attachments/assets/04a167f3-d55a-4ff7-bdfe-10cc21b0a9cf"
/>

### Security

<img width="1840" alt="image"
src="https://github.com/user-attachments/assets/23d055e6-c1dc-4335-8e9e-0d805215cadf"
/>

<img width="1840" alt="image"
src="https://github.com/user-attachments/assets/20d37509-73da-4f23-9020-b089ee249af9"
/>

### ES

<img width="1840" alt="image"
src="https://github.com/user-attachments/assets/21b34bb7-d540-4411-84f8-7e2f95942378"
/>

</details>

<details>

<summary>Serverless Security</summary>

![image](https://github.com/user-attachments/assets/45111617-ddcc-4b77-93f5-47131175c530)

![image](https://github.com/user-attachments/assets/85dcc3dd-30d2-4c3f-b624-f57032f532ae)

</details>

<details>

<summary>Serverless Oblt</summary>

<img width="1840" alt="image"
src="https://github.com/user-attachments/assets/53c14d2c-3f78-430b-8198-139f59c3a268"
/>

</details>

<details>

<summary>Serverless ES</summary>

In serverless ES there is no ability to change the visibility of the AI
assistant. This is the current behaviour and this has not changed in
this PR.

![image](https://github.com/user-attachments/assets/6f79a349-9530-4278-821d-38240c001b2a)

</details>

### How to test:

#### Stateful
- Start Kibana (in classic/traditional flavour)
```
// Start ES
yarn es snapshot --license trial -E xpack.security.authc.api_key.enabled=true
// Start Kibana
yarn start --no-base-path
```
- Create spaces for Classic, Security, Oblt and Search
- In Classic, go to Stack Management > Advanced Settings and search for
AI Assistant visibility
- Verify that when selecting:
- Only in their solutions -> only displays the Search/Oblt and Security
Assistants in their respective solutions.
- Observability and Search AI Assistants in other apps -> Shows the Oblt
and Search assistant on the Discover page.
- Security AI Assistants in other apps -> Shows the Security assistant
on the Discover page.
  - Hide all assistants -> Does not show assistants anywhere

#### Stateless
- Start Kibana (in serverless)
```
// Start ES
node scripts/es serverless --projectType security
// Start Kibana
node --no-experimental-require-module scripts/kibana --dev --serverless=security --no-base-path
```
(please try try different project types too. Instead of security you can
use `oblt` or `es` )
- Go to stack management > advanced settings and search for AI Assistant
visibility
- Check that the options you have available look like this:

![image](https://github.com/user-attachments/assets/85dcc3dd-30d2-4c3f-b624-f57032f532ae)

- Verify that when you select security, the Security assistant appears
everywhere (including Discover)

### 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>
Co-authored-by: Ievgen Sorokopud <e40pud@gmail.com>
Co-authored-by: Dario Gieselaar <dario.gieselaar@elastic.co>
(cherry picked from commit 6536c76)

# Conflicts:
#	src/platform/plugins/shared/ai_assistant_management/selection/server/plugin.ts
@KDKHD KDKHD added the backport This PR is a backport of another PR label Jul 14, 2025
@KDKHD KDKHD requested a review from kibanamachine as a code owner July 14, 2025 09:36
@KDKHD KDKHD enabled auto-merge (squash) July 14, 2025 09:36
@botelastic botelastic bot added the ci:project-deploy-observability Create an Observability project label Jul 14, 2025
@github-actions
Copy link
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@elasticmachine
Copy link
Contributor

elasticmachine commented Jul 14, 2025

💚 Build Succeeded

  • Buildkite Build
  • Commit: 2372cf5
  • Kibana Serverless Image: docker.elastic.co/kibana-ci/kibana-serverless:pr-227772-2372cf53ba1f

Metrics [docs]

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/management-settings-ids 126 127 +1

Async chunks

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

id before after diff
securitySolution 9.8MB 9.8MB -635.0B

Page load bundle

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

id before after diff
aiAssistantManagementSelection 5.4KB 5.4KB +22.0B
elasticAssistant 262.7KB 263.1KB +369.0B
observabilityAIAssistantApp 16.5KB 16.5KB +21.0B
securitySolution 94.4KB 94.3KB -42.0B
total +370.0B
Unknown metric groups

API count

id before after diff
@kbn/management-settings-ids 127 128 +1

History

@KDKHD KDKHD merged commit b3723f7 into elastic:9.1 Jul 14, 2025
11 of 12 checks passed
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 ci:project-deploy-observability Create an Observability project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants