fix(list_runtime_events): enable ML event discovery#67
Merged
tembleking merged 3 commits intosysdiglabs:mainfrom Feb 27, 2026
Merged
fix(list_runtime_events): enable ML event discovery#67tembleking merged 3 commits intosysdiglabs:mainfrom
tembleking merged 3 commits intosysdiglabs:mainfrom
Conversation
…ilter casing The list_runtime_events tool description and filter_expr docs did not mention engine, source, or category attributes, causing AI agents to query ML detections (e.g. crypto mining, anomalous logins) using ruleName which returns no results. ML events use a separate content structure and must be queried via engine="machineLearning" or source="agentless-aws-ml"/"agentless-okta-ml". Also fix baseFilter casing: "audittrail" -> "auditTrail" to match the actual stored value. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a critical bug preventing AI agents from discovering ML-based security detections (crypto mining, anomalous logins) via the list_runtime_events tool, and corrects a filter casing issue that could have caused incorrect event filtering.
Changes:
- Fixed
baseFiltercasing from"audittrail"to"auditTrail"to match actual stored values - Enhanced tool documentation to include
engine,source, andcategoryas queryable attributes for ML event discovery - Added explicit ML detection query examples and guidance
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| internal/infra/mcp/tools/tool_list_runtime_events.go | Updated baseFilter casing, enhanced tool description with ML detection support, added ML-specific attributes and filter examples |
| internal/infra/mcp/tools/tool_list_runtime_events_test.go | Updated test expectation to match corrected auditTrail casing |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…d ML events The `source != "auditTrail"` clause in the MCP baseFilter duplicated a filter already applied server-side, causing ML detections (e.g. Crypto Mining Detection) to be silently excluded from results.
Member
|
Tests do not pass because this is a fork and the secrets are not passed to the CI, but I can confirm that they are passing locally, so we can merge. |
tembleking
approved these changes
Feb 27, 2026
Merged
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.
Problem
The
list_runtime_eventstool returned zero results when querying for ML-based detections (e.g. "Crypto Mining Detection" withengine = "machineLearning"), even though these events were visible in the Sysdig Secure UI.The root cause was a
source != "auditTrail"clause in the MCP baseFilter that duplicated a filter already applied by the events API. This duplication caused an OpenSearch query interaction that silently excluded ML events from theevents_profiling_detection_v1index.Changes
source != "auditTrail"from the MCP baseFilter — the API already enforces this, so no audit trail events leak throughengine,source, andcategoryas filterable attributes for ML detectionsengine = "machineLearning",source = "agentless-aws-ml", etc.)baseFiltercasing:"audittrail"→"auditTrail"Verification
Tested on both us2 and eu1 environments:
engine = "machineLearning"now returns ML events (Crypto Mining Detection confirmed)source = "auditTrail"returns 0 events (API-side filter works correctly)