Skip to content

Commit 44d78cb

Browse files
authored
[Security Solution] AT skill get_endpoint_artifacts tool (#270607)
Adds an inline tool for the Agent Builder Automatic Troubleshooting skill `get_endpoint_artifacts`. This tool allows the agent to retrieve endpoint specific exception list items such as endpoint exceptions, trusted apps, blocklists, etc. The tool has a summary and detail mode to help prevent context explosion from artifacts. In order to support user scoped artifact fetching, a new `getScopedEndpointArtifactClient` was also added to the endpoint app context service as the existing `getExceptionListsClient` is not user scoped. Also includes some minor skill instructions tweaking to better handle endpoint artifacts.
1 parent 350a2c3 commit 44d78cb

10 files changed

Lines changed: 1348 additions & 5 deletions

File tree

x-pack/solutions/security/plugins/security_solution/server/agent_builder/skills/automatic_troubleshooting/index.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,13 @@ describe('createAutomaticTroubleshootingSkill', () => {
6969
});
7070

7171
describe('getInlineTools', () => {
72-
it('returns three inline tools', () => {
72+
it('returns four inline tools', () => {
7373
const skill = createAutomaticTroubleshootingSkill(mockEndpointAppContextService);
7474

7575
const inlineTools = skill.getInlineTools?.();
7676

7777
expect(inlineTools).toBeDefined();
78-
expect(inlineTools).toHaveLength(3);
78+
expect(inlineTools).toHaveLength(4);
7979
});
8080

8181
it('includes get_package_configurations tool', async () => {

x-pack/solutions/security/plugins/security_solution/server/agent_builder/skills/automatic_troubleshooting/index.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {
1414
getPackageConfigurationsTool,
1515
generateInsightTool,
1616
checkEndpointPackageFreshnessTool,
17+
getEndpointArtifactsTool,
1718
} from './tools';
1819
import { AVAILABLE_INDICES } from './data_sources';
1920
import { STALE_ENDPOINT_PACKAGE_MESSAGE } from '../../../../common/endpoint/utils/is_endpoint_package_stale';
@@ -29,6 +30,7 @@ export const GENERATE_INSIGHT_TOOL_ID = toolName('generate_insight');
2930
export const CHECK_ENDPOINT_PACKAGE_FRESHNESS_TOOL_ID = toolName(
3031
'check_endpoint_package_freshness'
3132
);
33+
export const GET_ENDPOINT_ARTIFACTS_TOOL_ID = toolName('get_endpoint_artifacts');
3234

3335
export const createAutomaticTroubleshootingSkill = (
3436
endpointAppContextService: EndpointAppContextService
@@ -50,6 +52,9 @@ You MUST use this skill when the user mentions ANY of these:
5052
- Endpoint protection not applying or not updating
5153
- Elastic Defend package configuration questions
5254
- Endpoint isolation, response action, or policy sync issues
55+
- Endpoint exceptions, trusted apps, trusted devices, event filters, blocklists, or host isolation exceptions not working as expected
56+
- Security alerts or events still appearing despite a configured endpoint exception or allowlist
57+
- Unexpected allow or block behavior on endpoints
5358
5459
## Available Indices
5560
@@ -62,13 +67,14 @@ Reference './available_indices' for the list of indices available for troublesho
6267
- **${platformCoreTools.search}** - Query raw data from available indices for troubleshooting evidence
6368
- **${platformCoreTools.getDocumentById}** - Retrieve full document content by ID from query results
6469
- **${GET_PACKAGE_CONFIGURATIONS_TOOL_ID}** - Inspect Elastic Defend package configuration details
70+
- **${GET_ENDPOINT_ARTIFACTS_TOOL_ID}** - Query endpoint artifacts (endpoint exceptions, trusted apps, trusted devices, event filters, host isolation exceptions, blocklists)
6571
- **${GENERATE_INSIGHT_TOOL_ID}** - Persist structured troubleshooting findings (mandatory final step)
6672
6773
## Troubleshooting Approach
6874
6975
1. **Check package freshness** - Call ${CHECK_ENDPOINT_PACKAGE_FRESHNESS_TOOL_ID} first. If \`stale: true\`, output this exact line before anything else, substituting the version values: "⚠️ ${STALE_ENDPOINT_PACKAGE_MESSAGE}" Do not add to or rephrase this line. Then continue the investigation. If the check fails or the package is fresh, proceed without comment.
7076
2. **Gather context** - Use ${platformCoreTools.integrationKnowledge} to retrieve relevant Elastic Defend knowledge that informs the analysis approach.
71-
3. **Investigate data** - Use ${platformCoreTools.search} to query relevant indices for evidence of errors, warnings, misconfigurations, or incompatibilities. Use ${platformCoreTools.getDocumentById} to retrieve full documents when needed. Use ${GET_PACKAGE_CONFIGURATIONS_TOOL_ID} to inspect Elastic Defend package configuration if relevant.
77+
3. **Investigate data** - Use ${platformCoreTools.search} to query relevant indices for evidence of errors, warnings, misconfigurations, or incompatibilities. Use ${platformCoreTools.getDocumentById} to retrieve full documents when needed. Use ${GET_PACKAGE_CONFIGURATIONS_TOOL_ID} to inspect Elastic Defend package configuration if relevant. When the issue involves unexpected allow/block/filtering behavior, isolation failures, or missing alerts, use ${GET_ENDPOINT_ARTIFACTS_TOOL_ID} to check if endpoint artifacts could be the cause. Call without artifactType first to see what artifact types exist, then query specific types for details. Use the policyId filter to narrow results to the affected endpoint's policy. Note: endpoint_exceptions can affect both the endpoint agent AND detection engine alerts depending on per-policy opt-in configuration — consider this when investigating missing alerts.
7278
4. **Iterate** - Continue querying and gathering context until the root cause or relevant findings are understood.
7379
5. **Persist findings** - Call ${GENERATE_INSIGHT_TOOL_ID} with a clear problem description, actionable remediation steps, affected endpoint IDs, and relevant raw documents.
7480
@@ -101,7 +107,8 @@ Reference './available_indices' for the list of indices available for troublesho
101107
id: ID,
102108
name: NAME,
103109
basePath: BASE_PATH,
104-
description: 'Troubleshoot Elastic Defend endpoint configuration issues',
110+
description:
111+
'Troubleshoot Elastic Defend endpoint configuration issues — policies, endpoint exceptions, trusted apps, blocklists, etc.',
105112
content: systemInstructions,
106113
referencedContent: [
107114
{
@@ -119,6 +126,7 @@ Reference './available_indices' for the list of indices available for troublesho
119126
return [
120127
checkEndpointPackageFreshnessTool(endpointAppContextService),
121128
getPackageConfigurationsTool(endpointAppContextService),
129+
getEndpointArtifactsTool(endpointAppContextService),
122130
generateInsightTool(),
123131
];
124132
},

0 commit comments

Comments
 (0)