Fix/ai auto path hardening#1056
Merged
Merged
Conversation
The background insight path ran with a nil ToolContext, which passes every role/namespace check, while offering the model the full tool set including cluster mutations and external MCP tools. It now gets the read-only viewer allowlist, tool execution is additionally gated at dispatch time, and every executed tool call is written to the audit log (attributed to "AI Insights"). Also guards the transient error/warning status fields with a mutex; they were written by the ticker goroutine and read by status requests concurrently.
InjectAiPromptConfig (ConfigMap watch) replaced the config pointer while the queue ticker read it without synchronization. Reads now go through a locked snapshot and tolerate a nil config. getAiFilters additionally returns UserFilters: filters created via the UI were stored and toggleable but never evaluated, so they silently never produced a task. Existing dormant user filters will start creating tasks (bounded by the daily token limit).
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.
No description provided.