Skip to content

WKS-2791 - Add AI download risk advisor AFTER_DOWNLOAD sample - #77

Merged
ehl-jf merged 1 commit into
mainfrom
feature/WKS-2791-claude-after-download-sample
Oct 1, 2026
Merged

ehl-jf merged 1 commit into
mainfrom
feature/WKS-2791-claude-after-download-sample

Conversation

@ehl-jf

@ehl-jf ehl-jf commented Sep 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • New sample under samples/artifactory/AFTER_DOWNLOAD/ai-download-risk-advisor/: on AFTER_DOWNLOAD, looks up the downloaded artifact's existing Xray scan result (security issues + policy violations).
  • If the artifact is clean, the worker stops there — no AI call, no Slack message.
  • If issues are found, it asks Claude (Anthropic Messages API) to turn the raw counts into a short, plain-English risk summary and recommendation, then posts it to a Slack channel via incoming webhook.
  • Falls back to posting raw Xray stats instead of an AI summary if the AnthropicApiKey secret isn't configured or the Claude call fails, so the advisory never silently disappears.
  • minIssuesForAiSummary, claudeModel, and claudeMaxTokens are configurable via the worker's properties (declared with defaults in manifest.json), not hardcoded.
  • README covers required secrets, configurable properties, a worked Claude prompt/response walkthrough, and a full end-to-end run guide (prerequisites, secrets, deploy, test download, expected log messages, how to exercise the fallback path).

Test plan

  • npx tsc --noEmit — clean
  • npm test — 5/5 passing (Xray unavailable, no scan match, clean artifact skips AI call, full Claude+Slack success path, missing-API-key fallback)

Jira: WKS-2791

@ehl-jf
ehl-jf force-pushed the feature/WKS-2791-claude-after-download-sample branch from edef1ae to aa93701 Compare September 28, 2026 06:58
Looks up an artifact's existing Xray scan result on AFTER_DOWNLOAD and,
if issues or violations are found, asks Claude to turn the raw counts
into a short risk summary posted to Slack. Falls back to raw stats if
the AnthropicApiKey secret is missing or the Claude call fails.
@ehl-jf
ehl-jf force-pushed the feature/WKS-2791-claude-after-download-sample branch from aa93701 to a19f4b5 Compare September 28, 2026 07:48
@ehl-jf
ehl-jf merged commit 914ba8a into main Oct 1, 2026
1 check passed
@ehl-jf
ehl-jf deleted the feature/WKS-2791-claude-after-download-sample branch October 1, 2026 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants