[security_ai_prompts] Sync prompt changes from elastic/kibana#271330 - #20880
[security_ai_prompts] Sync prompt changes from elastic/kibana#271330#20880NicholasPeretti wants to merge 3 commits into
Conversation
Updates ALERT_SUMMARY_500 (alertSummary) and ALERT_SUMMARY_SYSTEM_PROMPT (alertSummarySystemPrompt) prompt content for both aiForSoc and ease promptGroupIds. Bumps version to 1.0.14. UUID-named files are preserved; no file renaming. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
elastic#19388 was closed by the stale bot and cannot be reopened, so the changelog link now references the replacement PR. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
✅ Elastic Docs Style Checker (Vale)No issues found on modified lines! The Vale linter checks documentation changes against the Elastic Docs style guide. To use Vale locally or report issues, refer to Elastic style guide for Vale. |
There was a problem hiding this comment.
Pull request overview
Syncs the Security AI Prompts integration package with the updated alert summary prompt text from elastic/kibana#271330, reducing redundancy while preserving the existing output contracts (500/200 char limits for alertSummary, and the { summary, recommendedActions } JSON contract for alertSummarySystemPrompt).
Changes:
- Bump
security_ai_promptspackage version to1.0.14. - Update
alertSummaryprompt text for bothaiForSocandeaseprompt groups. - Update
alertSummarySystemPromptinstructions for bothaiForSocandeaseprompt groups, keeping the single-lineJSON.parse()-compatible output requirement.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/security_ai_prompts/manifest.yml | Version bump to 1.0.14. |
| packages/security_ai_prompts/changelog.yml | Add 1.0.14 changelog entry describing the trimmed alert summary prompts. |
| packages/security_ai_prompts/kibana/security_ai_prompt/security_ai_prompts-9da0cebb-f56b-4199-b4db-ef79b876d842.json | Update alertSummary default prompt for aiForSoc. |
| packages/security_ai_prompts/kibana/security_ai_prompt/security_ai_prompts-7d7cf0c3-7b8e-42a1-878d-668b282247eb.json | Update alertSummary default prompt for ease. |
| packages/security_ai_prompts/kibana/security_ai_prompt/security_ai_prompts-26eb85d3-c474-4e48-a918-68b93fa409bb.json | Update alertSummarySystemPrompt default prompt for aiForSoc (JSON contract guidance retained). |
| packages/security_ai_prompts/kibana/security_ai_prompt/security_ai_prompts-d8aebe8c-8541-4abf-90b9-7e100b606aec.json | Update alertSummarySystemPrompt default prompt for ease (JSON contract guidance retained). |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
✅ All changelog entries have the correct PR link. |
💚 Build Succeeded
|
|
Queued — the merge queue status continues in this comment ↓. |
Merge Queue Status
Required conditions to enter a queue
|
☑️ Command
|
## Summary
### 🛑 Problem
`ALERT_ATTACHMENT_PROMPT` and `ALERT_SUMMARY_SYSTEM_PROMPT` had grown
into long, step-by-step instruction lists that duplicated guidance
already encoded in registered skills like `alert-analysis`. Because
skill content is injected into the system context for every session,
these verbose prompts were pure overhead — wasted tokens and a second
source of truth that would drift out of sync as skills evolved. There
was also no eval coverage for either prompt path, so regressions would
be invisible.
### 💡 Solution
**Prompt changes:**
- `ALERT_ATTACHMENT_PROMPT` is now a single sentence that states the
user's intent and explicitly delegates the *how* to the `alert-analysis`
skill.
- `ATTACK_DISCOVERY_ATTACHMENT_PROMPT` is trimmed to the same shape in
anticipation of the planned `attack-analysis` skill.
- `ALERT_SUMMARY_SYSTEM_PROMPT` is tightened by collapsing redundant "no
code fences" rules and merging duplicate markdown-formatting bullets.
The `{ summary, recommendedActions }` JSON contract the EASE flyout's
`JSON.parse` depends on is preserved verbatim.
- `ALERT_SUMMARY_500` is reworded to be more direct while preserving the
500/200 character constraints.
**Eval coverage (new):**
- `evals/single_alert_triage.spec.ts` — exercises
`ALERT_ATTACHMENT_PROMPT` via the Agent Builder `/converse` endpoint
with a single alert fixture. Uses an LLM criteria evaluator (markdown
format, disposition recommendation, entity grounding) and
`createSkillInvocationEvaluator` to verify the `alert-analysis` skill is
actually invoked. A single alert does not trigger summary mode, so
`expectedAttachmentReads: 0`.
- `evals/ease_alert_summary.spec.ts` + `src/ease_summary_task.ts` —
exercises `ALERT_SUMMARY_SYSTEM_PROMPT` via the
`actions/connector/_execute` route (the path the EASE flyout uses, not
Agent Builder). Uses a CODE-only evaluator (`EaseJsonCompliance`) that
attempts `JSON.parse` on the raw response and checks that `summary` and
`recommendedActions` are non-empty strings. Directly catches the silent
fallback-to-raw-text failure mode in `use_alert_summary.tsx`.
**Integrations sync:** elastic/integrations#20880
### 🧠 Notes
- The EASE flyout silently falls back to raw text when `JSON.parse`
fails, dropping `recommendedActions` with no visible error. The
`EaseJsonCompliance` eval is the only gate catching this. Ran locally —
scored 1 with the trimmed prompt.
- `single_alert_triage` criteria eval also scored 1 locally.
- `ease_summary_task.ts` hardcodes the
`/internal/elastic_assistant/actions/connector/{id}/_execute` path
because `POST_ACTIONS_CONNECTOR_EXECUTE` is not importable from a shared
eval package. It explicitly sets `elastic-api-version: 1` as a header —
the eval framework's HTTP wrapper does not translate the `version`
option the way the browser `HttpHandler` does.
- The integrations PR updates only the 4 saved-object files whose
content changed. It does not include the UUID→descriptive filename
migration that the generator now produces by default; that is a separate
concern.
### ✅ How to verify
```bash
TRACING_ES_URL=http://localhost:9220 \
EVALUATION_CONNECTOR_ID=<your-connector-id> \
KBN_EVALS_EXECUTOR=phoenix \
KBN_EVALS_SKIP_CONNECTOR_SETUP=true \
node scripts/playwright test \
--config x-pack/solutions/security/packages/kbn-evals-suite-security-alert-triage/playwright.config.ts \
--project <your-connector-id> \
--grep "single_alert|ease"
```
Both new specs should pass with `EaseJsonCompliance: 1` and `criteria:
1`. Alternatively, add the label `evals:security-alert-triage` to
trigger the suite in Buildkite.
## Related
Integrations sync: elastic/integrations#20880
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
Syncs Security AI prompt saved objects from elastic/kibana#271330, which trims
ALERT_SUMMARY_500andALERT_SUMMARY_SYSTEM_PROMPTto remove redundant instructions while preserving their behavioural contracts.Replaces #19388, which was closed by the stale bot and cannot be reopened. This branch is the same change rebased onto current
main.Changes
Updates the
defaultprompt text of 4 existing saved objects — no files added, removed, or renamed:promptIdpromptGroupIdsecurity_ai_prompts-9da0cebb-…alertSummaryaiForSocsecurity_ai_prompts-7d7cf0c3-…alertSummaryeasesecurity_ai_prompts-26eb85d3-…alertSummarySystemPromptaiForSocsecurity_ai_prompts-d8aebe8c-…alertSummarySystemPrompteasePlus the package version bump
1.0.13→1.0.14and a changelog entry.alertSummarySystemPromptkeeps the{ summary, recommendedActions }JSON contract verbatim — the EASE alert summary flyout depends onJSON.parsesucceeding against it, and silently falls back to raw text (droppingrecommendedActions) if it fails.alertSummarykeeps the 500/200 character constraints.All 4 values were verified byte-for-byte against the Kibana PR head, so the two repos stay in sync.
Test plan
elastic-package lintpasses inpackages/security_ai_prompts/summaryandrecommendedActions(i.e.JSON.parsesucceeds)aiForSocalert summary respects the 500/200 character limits🤖 Generated with Claude Code