Add indices:admin/mappings/get to ml_full_access role for Agentic Search#6076
Draft
owaiskazi19 wants to merge 3 commits intoopensearch-project:mainfrom
Draft
Add indices:admin/mappings/get to ml_full_access role for Agentic Search#6076owaiskazi19 wants to merge 3 commits intoopensearch-project:mainfrom
owaiskazi19 wants to merge 3 commits intoopensearch-project:mainfrom
Conversation
Member
|
TY @owaiskazi19 . The changes LGTM but the build on main is broken atm due to Jackson 3.x upgrade in core. I will have a PR raised mometarily for that. |
Member
|
@owaiskazi19 it may be good to take this opportunity to extract the ml roles from this repo and provide them as classpath resources from within the ml repo instead. See #6038 |
| - index_patterns: | ||
| - '*' | ||
| allowed_actions: | ||
| - 'indices:admin/mappings/get' |
Contributor
There was a problem hiding this comment.
we also need indices:data/read/search* because agentic search also samples documents from the index, should we add that too?
Member
Author
There was a problem hiding this comment.
Good call. QPT's async chain has two steps: (1) getMappings for index structure, and (2) a search to sample a document. indices:data/read/search* would be needed for it
Signed-off-by: Owais Kazi <owaiskazi19@gmail.com>
Signed-off-by: Owais Kazi <owaiskazi19@gmail.com>
QueryPlanningTool samples documents from the target index using a matchAllQuery search. This requires indices:data/read/search* permission which is consistent with other full_access roles (anomaly_full_access, ppl_full_access, asynchronous_search_full_access, forecast_full_access). Signed-off-by: Owais Kazi <owaiskazi19@gmail.com>
4eae239 to
75b48d7
Compare
rithinpullela
approved these changes
Apr 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds
indices:admin/mappings/getto theml_full_accessrole to support Agentic Search (QueryPlanningTool). QPT needs to retrieve index mappings to generate accurate OpenSearch DSL queries from natural language input.Dependency
This PR depends on opensearch-project/ml-commons#4785, which changes
QueryPlanningToolto useGetMappingsRequestinstead ofGetIndexRequest. Without that ml-commons change, QPT would require the broaderindices:admin/getpermission. With it, onlyindices:admin/mappings/getis needed.Security implications
This permission does not expose system index mappings. System indices are protected by multiple layers:
plugins.security.system_indices.permissions.enabledistrue(default), accessing system indices requires thesystem:admin/system_indexpermission, whichml_full_accessdoes not have..opendistro_securityindex has additional hardcoded protection that filters it from wildcard requests whenplugins.security.filter_securityindex_from_all_requestsis enabled.getMappingswith a specific user-provided index name, not*.This is a read-only metadata permission — it only exposes field names and types, not document data.
Consistent with existing roles —
indices:admin/mappings/getis already used byknn_full_access,query_assistant_access, andreports_read_accesswith the sameindex_patterns: ['*']scope.Related Issue
opensearch-project/ml-commons#4775
Check List
--signoff