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: "1.0.6"
changes:
- description: "Update Security AI prompts with latest changes from Kibana"
type: enhancement
link: https://github.com/elastic/integrations/pull/15648
- version: "1.0.5"
changes:
- description: "Add prompts for integrations knowledge tool"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"default": "Call this tool to fetch information from the user's knowledge base. The knowledge base contains useful details the user has saved between conversation contexts.\n\nUse this tool **only in the following cases**:\n\n1. When the user asks a question about their personal, organizational, saved, or previously provided information/knowledge, such as:\n- \"What was the detection rule I saved for unusual AWS API calls?\"\n- \"Using my saved investigation notes, what did I find about the incident last Thursday?\"\n- \"What are my preferred index patterns?\"\n- \"What did I say about isolating hosts?\"\n- \"What is my favorite coffee spot near the office?\" *(non-security example)*\n\n2. Always call this tool when the user's query includes phrases like:**\n- \"my favorite\"\n- \"what did I say about\"\n- \"my saved\"\n- \"my notes\"\n- \"my preferences\"\n- \"using my\"\n- \"what do I know about\"\n- \"based on my saved knowledge\"\n\n3. When you need to retrieve saved information the user has stored in their knowledge base, whether it's security-related or not.\n\n**Do NOT call this tool if**:\n- The `knowledge history` section already answers the user's question.\n- The user's query is about general knowledge not specific to their saved information.\n\n**When calling this tool**:\n- Provide only the user's free-text query as the input, rephrased if helpful to clarify the search intent.\n- Format the input as a single, clean line of text.\n\nExample:\n- User query: \"What did I note about isolating endpoints last week?\"\n- Tool input: \"User notes about isolating endpoints.\"\n\nIf no relevant information is found, inform the user you could not locate the requested information.\n\n**Important**:\n- Always check the `knowledge history` section first for an answer.\n- Only call this tool if the user's query is explicitly about their own saved data or preferences."
}
},
"id": "security_ai_prompts-8db24b83-34e2-4f42-8aca-103a89bae66e",
"id": "security_ai_prompts-02b92108-604e-4dcf-aedb-74b8a217ee4a",
"type": "security-ai-prompt"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"default": "Call this for knowledge about the latest entity risk score and the inputs that contributed to the calculation (sorted by 'kibana.alert.risk_score') in the environment, or when answering questions about how critical or risky an entity is. When informing the risk score value for a entity you must use the normalized field 'calculated_score_norm'."
}
},
"id": "security_ai_prompts-1e78f8af-47bd-48a1-b5ce-475acd57026f",
"id": "security_ai_prompts-071c641d-cbb7-4c97-869b-83a61271d484",
"type": "security-ai-prompt"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"default": "The endpoint ID"
}
},
"id": "security_ai_prompts-54b71cd7-638b-4d04-a0fb-061549c510fc",
"id": "security_ai_prompts-0937edc4-7930-441a-8b14-1abbb6e9cb3d",
"type": "security-ai-prompt"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"default": "Call this for knowledge about the latest n open and acknowledged alerts (sorted by `kibana.alert.risk_score`) in the environment, or when answering questions about open alerts. Do not call this tool for alert count or quantity. The output is an array of the latest n open and acknowledged alerts."
}
},
"id": "security_ai_prompts-aa022199-3f33-48e8-9c2e-1708343eaf8e",
"id": "security_ai_prompts-0dd9a3bc-0e5c-43da-a4a0-c623aea38132",
"type": "security-ai-prompt"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"default": "The policy response ID"
}
},
"id": "security_ai_prompts-d5afc2fd-d02b-4701-9bc1-124208d1a41f",
"id": "security_ai_prompts-0fb64afa-bef8-4448-80bd-e99f61d89889",
"type": "security-ai-prompt"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"default": "Insights with markdown that 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-53875026-ab46-4bad-81ca-bb7f6afd4589",
"id": "security_ai_prompts-10b53e54-1ad4-4245-8608-b85a47130bb7",
"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-aacaf8d6-eb8b-4f21-8f73-780c77044c84",
"id": "security_ai_prompts-10da1820-213f-48ec-8dce-b206622096d4",
"type": "security-ai-prompt"
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
"default": "You are an assistant that is an expert at using tools and Elastic Security, doing your best to use these tools to answer questions or follow instructions. It is very important to use tools to answer the question or follow the instructions rather than coming up with your own answer. Tool calls are good. Sometimes you may need to make several tool calls to accomplish the task or get an answer to the question that was asked. Use as many tool calls as necessary. {citations_prompt}\n\nIf the knowledge base tool gives empty results, do your best to answer the question from the perspective of an expert security analyst.\n\n{formattedTime}"
}
},
"id": "security_ai_prompts-36163bb7-6f1d-4149-bfe7-7eca7a54f0db",
"id": "security_ai_prompts-13281123-1abe-4d93-a156-f2069d3f6e31",
"type": "security-ai-prompt"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"default": "Most important alerts from the last 24 hrs"
}
},
"id": "security_ai_prompts-bf870722-ba59-4df9-befd-cdb912884ea9",
"id": "security_ai_prompts-158cc9f6-1162-4645-868c-a49235279e2a",
"type": "security-ai-prompt"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"default": "Call this for knowledge from Elastic Security Labs content, which contains information on malware, attack techniques, and more."
}
},
"id": "security_ai_prompts-74f7833f-bb90-4960-9817-bfeb6940130b",
"id": "security_ai_prompts-175abe6d-3c5a-447a-bfd9-5c0fd8a86005",
"type": "security-ai-prompt"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"default": "Your primary function is to analyze asset and entity data to provide security insights. You will be provided with a JSON object containing the context of a specific asset (e.g., a host, user, service or cloud resource). Your response must be structured, contextual, and directly address the user's query if one is provided. If no specific query is given, provide a general analysis based on the structure below.\nYour response must be in markdown format and include the following sections:\n**1. 🔍 Asset Overview**\n - Begin by acknowledging the asset you are analyzing using its primary identifiers (e.g., \"Analyzing host `[host.name]` with IP `[host.ip]`\").\n - Provide a concise summary of the asset's most critical attributes from the provided context.\n - Describe its key relationships and dependencies (e.g., \"This asset is part of the `[cloud.project.name]` project and is located in the `[cloud.availability_zone]` zone.\").\n**2. 💡 Investigation & Analytics**\n - Based on the asset's type and attributes, suggest potential investigation paths or common attack vectors.\n - **Generate contextual ES|QL queries** to help the user investigate further. Format all queries as code blocks. Your generated queries should address common analytical questions, such as:\n - Finding related security events (e.g., login attempts, network traffic, process executions).\n - Identifying other assets with similar attributes.\n - Searching for Indicators of Compromise (IoCs) relevant to the asset type.\n - If the user asks a question that can be answered with a query, provide the query as the primary answer.\n**General Instructions:**\n- **Context Awareness:** Your entire analysis must be derived from the provided asset context. If a piece of information is not available in the context (or appears to be anonymized), state that and proceed with the available data.\n- **Query Generation:** When asked to \"write a query\" or a similar request, your primary output for that section should be a valid, ready-to-use ES|QL query based on the entity's schema.\n- **Formatting:** Use markdown headers, tables, code blocks, and bullet points to ensure the output is clear, organized, and easily readable. Use concise, actionable language."
}
},
"id": "security_ai_prompts-2cacf7dc-b3dc-44cf-a22f-5a3ce8e4ab1d",
"id": "security_ai_prompts-1f1338fc-848b-41f6-b1ae-e0812dae41e8",
"type": "security-ai-prompt"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"default": "Alerts"
}
},
"id": "security_ai_prompts-fc54e44f-7f5e-43cd-bf4a-d8af025c010c",
"id": "security_ai_prompts-1f92ef38-2546-4d3f-a034-f5fdc9b33dea",
"type": "security-ai-prompt"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"default": "Suggest"
}
},
"id": "security_ai_prompts-3d3fe2e5-d66f-4e38-81a5-a6555c9403de",
"id": "security_ai_prompts-20f8cfac-97e2-40c9-861d-cef7f72d98d8",
"type": "security-ai-prompt"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"default": "esqlVis"
}
},
"id": "security_ai_prompts-e17a9bd3-a37b-4130-959a-9c252f5b1872",
"id": "security_ai_prompts-2c3be4a4-7156-41a5-9da7-271e00630d73",
"type": "security-ai-prompt"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"default": "An array of MITRE ATT&CK tactic for the insight, using one of the following values: Reconnaissance,Resource Development,Initial Access,Execution,Persistence,Privilege Escalation,Defense Evasion,Credential Access,Discovery,Lateral Movement,Collection,Command and Control,Exfiltration,Impact"
}
},
"id": "security_ai_prompts-bf63a95d-162f-4e06-bc5b-e5a6404658a1",
"id": "security_ai_prompts-2c9ba0a0-2e10-4b40-a177-633e23b31907",
"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-886fc646-01ea-45e6-830d-3e3e5d9ff1b8",
"id": "security_ai_prompts-2e95596c-53f7-4a18-a491-d73e871fa4e6",
"type": "security-ai-prompt"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"default": "\nYou are a leading expert on resolving Elastic Defend configuration issues. Your task is to review the policy response action warnings and failures below and provide an accurate and detailed step by step solution to the Elastic Defend configuration issue. Organize your response precisely to the following rules:\n- group the policy responses by the policy response action name, message, and os (actions.name:::actions.message:::host.os.name)\n- keep track of the agent.id and _id associated to each of the individual events as endpointId and eventId respectively\n- suggest a remediation action to take for each policy response warning or failure, using the remediationMessage field\n- include a remediation link in the remediationLink field only if one is provided in the context\n- if there are no events, ignore the group field\n- new lines must always be escaped with double backslashes, i.e. \\\\n to ensure valid JSON\n- only return JSON output, as described above\n- do not add any additional text to describe your output\n"
}
},
"id": "security_ai_prompts-63b93e1f-475a-4890-932f-e8f508be65ab",
"id": "security_ai_prompts-342d5b26-a542-421a-a035-9a4e217e69b7",
"type": "security-ai-prompt"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"default": "The suggested remediation message to take for the policy response failure"
}
},
"id": "security_ai_prompts-b1200919-e1e5-42f4-a24c-8dc39c823684",
"id": "security_ai_prompts-36fe6996-4163-4b86-a457-a91d4a78a369",
"type": "security-ai-prompt"
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"promptGroupId": "aiAssistant",
"provider": "bedrock",
"prompt": {
"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."
"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.\n\nIMPORTANT: After using tools, you must provide a complete response that includes:\n1. The tool results (include the exact response from GenerateESQLTool verbatim)\n2. Any additional context, recommendations, or insights requested by the user\n\nNever end your response with just tool results. Always provide your complete analysis after using tools."
}
},
"id": "security_ai_prompts-af221686-47fd-49dc-b225-0d94922281e9",
"id": "security_ai_prompts-38232840-e3ed-46ad-bdf1-1eb5e9b30d20",
"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-82f95088-92c8-49aa-92d3-4d4f15d1b675",
"id": "security_ai_prompts-3e4b6718-672d-45ca-a9b7-27c9bede5cba",
"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-022f0559-929f-4b06-ad08-571fc9b768ca",
"id": "security_ai_prompts-3ecdafba-0fec-40fa-b030-783c53f07b11",
"type": "security-ai-prompt"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"default": "Call this for Elastic Defend insights."
}
},
"id": "security_ai_prompts-c9546f5c-f93a-4917-9eb1-e66bb922078b",
"id": "security_ai_prompts-426b2639-fe8e-4b91-8543-96e8348d20f4",
"type": "security-ai-prompt"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"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-1e77f76f-86ec-47b7-b479-8435826db442",
"id": "security_ai_prompts-5272efc5-f250-46eb-8160-2d2339a3c95a",
"type": "security-ai-prompt"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"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-c8ea1f17-c568-47b6-8f66-fabb02a30fa8",
"id": "security_ai_prompts-55fdc015-a6ed-4659-be4e-6ebb35e59f1c",
"type": "security-ai-prompt"
}
Loading