Skip to content

[Entity Analytics] Check agent builder permissions when rendering entity summary highlight.#250093

Merged
ymao1 merged 2 commits intoelastic:mainfrom
ymao1:ea-15392-2
Jan 23, 2026
Merged

[Entity Analytics] Check agent builder permissions when rendering entity summary highlight.#250093
ymao1 merged 2 commits intoelastic:mainfrom
ymao1:ea-15392-2

Conversation

@ymao1
Copy link
Copy Markdown
Contributor

@ymao1 ymao1 commented Jan 22, 2026

Summary

The entity summary feature calls the inference plugin chat complete API which does not perform its own RBAC checks and instead relies on the calling feature to check permissions. Currently, it checks whether the user has permissions to access AI assistant. This PR expands the checks to also check whether the user has permissions to agent builder and whether the user has connector permissions (which is needed to invoke gen ai connectors).

Note: I did not replace the permissions check for AI Assistant with Agent Builder. Instead, I modified the check to ensure that a user has at least one of these permissions. This prevents users who only have AI Assistant permissions from suddenly not being able to see the entity summary highlight. In the future, when Assistant is removed, we can update the check to only check Agent Builder permissions.

To Verify

  1. Start ES and Kibana
  2. Generate some entity data
  3. Create a custom role with limited permissions, specifically, no agent builder or ai assistant permissions. Make sure you have permissions to Actions and Connectors under Stack Management
Screenshot 2026-01-22 at 12 19 46 PM
  1. Create a user test and assign it to the role you just created
  2. Log in as your new user (I do this in an incognito window)
  3. Verify that you cannot see the entity summary highlight section on an entity flyout
  4. As your admin user, modify the role to give permission to AI Assistant
  5. As the test user, reload the entity flyout. You should now see the entity summary highlight section
  6. As your admin user, modify the role to remove permission to AI Assistant and give permission for Agent Builder
  7. As the test user, reload the entity flyout. You should now see the entity summary highlight section
  8. As your admin user, modify the role to remove permissions to Actions and Connectors under Stack Management
  9. As the test user, reload the entity flyout. You should no longer see the entity summary highlight section.

@ymao1 ymao1 changed the title Checking agent builder privilege [Entity Analytics] Check agent builder permissions when rendering entity summary highlight. Jan 22, 2026
@ymao1 ymao1 self-assigned this Jan 22, 2026
if (!aiConnectors || !connectorId) return '';
return aiConnectors.find((c) => c.id === connectorId)?.name ?? '';
}, [aiConnectors, connectorId]);
const { hasAssistantPrivilege, isAssistantEnabled, isAssistantVisible } =
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Access to the inference API does not depend on whether the assistant is enabled so I removed this check.

@ymao1 ymao1 added release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting Team:Entity Analytics Security Entity Analytics Team v9.4.0 labels Jan 22, 2026
@ymao1 ymao1 marked this pull request as ready for review January 22, 2026 19:58
@ymao1 ymao1 requested a review from a team as a code owner January 22, 2026 19:58
@ymao1 ymao1 requested a review from CAWilson94 January 22, 2026 19:58
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/security-entity-analytics (Team:Entity Analytics)

Copy link
Copy Markdown
Contributor

@CAWilson94 CAWilson94 left a comment

Choose a reason for hiding this comment

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

LGTM!

Desk tested: works as described 🥳

For anyone else desk testing - make sure management perms are set to 'all' for connectors, for the first two cases. :D

@ymao1 ymao1 merged commit bf1ac09 into elastic:main Jan 23, 2026
15 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:Entity Analytics Security Entity Analytics Team v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants