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
2 changes: 1 addition & 1 deletion ai/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ <h3>Promptbook</h3>
<h2 class="section-title">Where content goes</h2>
<div class="card">
<ul>
<li><strong>Copilot</strong> — <code>.github/copilot-instructions.md</code> and path-scoped <code>*.instructions.md</code></li>
<li><strong>Copilot</strong> — <code>.github/copilot-instructions.md</code> and path-scoped <code>.github/instructions/*.instructions.md</code></li>
<li><strong>Claude Code</strong> — short facts in <code>CLAUDE.md</code>; procedures in <code>.claude/skills/&lt;name&gt;/SKILL.md</code></li>
<li><strong>Codex</strong> — <code>AGENTS.md</code> (and nested / override files); link out when the main file grows</li>
</ul>
Expand Down
21 changes: 21 additions & 0 deletions promptbook/prompts.json
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,27 @@
],
"formatNotes": "All three. Point the tool at `evals/`, `prompts/`, the LLM client package, model config, and `.github/workflows/` (or the Jenkinsfile). Copilot: llm-eval path instructions plus those files in agent mode. Claude Code: the llm-eval-ci-regression-gate skill plus the eval folder. Codex: AGENTS.md LLM evals section, then the diff.",
"body": "Task: Add (or tighten) an LLM eval regression gate in this repo's CI so prompt, model, retrieval, and tool-schema changes are scored on every PR and fail only on real regressions. Produce a small diff plus a short verification note.\n\nContext placeholders (fill from the repo or ask only if missing):\n- Eval entrypoint: {{EVAL_CMD}} (e.g. python -m evals.run --tier pr)\n- Golden set path: {{GOLDEN}} (e.g. evals/golden/core.jsonl)\n- Paths that change behaviour: {{WATCH_PATHS}} (e.g. prompts/**, src/app/llm/**, evals/**)\n- Model / deployment under test: {{MODEL}} (pinned version, not an alias)\n- Judge model (if any): {{JUDGE}} (pinned version, or none)\n- CI system: {{CI}} (github-actions | jenkins)\n- Provider auth in CI: {{AUTH}} (azure-oidc | env-secret)\n- Metrics and policy: {{METRICS}} (e.g. json_valid floor 1.0; label_accuracy floor 0.85 tol 0.03; safety_refusal floor 1.0)\n\nRequirements:\n1. Inventory: find the current eval code, golden data, model config, and CI workflows. Report what exists, what is unpinned, and whether any golden case contains real customer data or PII.\n2. Golden set: make sure {{GOLDEN}} has stable case ids and tags (happy-path, edge, safety, past-incident). Do not rewrite or delete existing cases; flag questionable ones in the report instead.\n3. Config pins: put {{MODEL}}, {{JUDGE}}, temperature, seed (where supported), samples per case (3 on PRs), and per-metric floor/tolerance/blocking flags in one config file. The runner must write these pins into its results file.\n4. Gate script: add `evals/gate.py` (Python, standard library plus what the repo already uses) that reads the results file and `evals/baseline.json`, computes per-metric aggregates across samples, and exits 1 when a blocking metric falls below its floor or drops more than its tolerance below baseline. For pass-rate metrics on fewer than ~200 cases, report a Wilson 95% interval next to the delta. Non-blocking (judge) metrics print a warning only.\n5. Baseline: if `evals/baseline.json` is missing, generate it from a run on the default branch and commit it separately with the config pins it came from. Never adjust the baseline in the same commit as a prompt or model change.\n6. Unit tests: pytest cases for gate.py covering pass, tolerance breach, floor breach, missing metric, and warn-only metric.\n7. CI wiring for {{CI}}:\n - GitHub Actions: workflow `.github/workflows/llm-eval.yml` on `pull_request` with `paths:` = {{WATCH_PATHS}}, plus a nightly `schedule` for the full tier. Top-level `permissions: contents: read` (add `id-token: write` only for azure-oidc, `pull-requests: write` only if it comments). Pin third-party actions to full commit SHAs. Skip secret-bearing steps when the PR comes from a fork. Set `timeout-minutes`, run {{EVAL_CMD}} then `python evals/gate.py`, upload the results file as an artifact, and append a Markdown table (metric, baseline, candidate, delta, verdict, worst failing ids) to `$GITHUB_STEP_SUMMARY`.\n - Jenkins: an equivalent stage with credentials bound only for that stage, `timeout`, archived results, and a failing build on gate exit 1.\n8. Agent instruction files: add Copilot `.github/instructions/llm-eval.instructions.md` with applyTo {{WATCH_PATHS}}; Claude `.claude/skills/llm-eval-ci-regression-gate/SKILL.md` (or a one-line CLAUDE.md rule); and an LLM evals section in `AGENTS.md` (or `evals/AGENTS.md`). Each one says: run the PR tier before claiming done, never edit the golden set or baseline alongside a prompt/model change, report the delta table.\n9. Docs: a short README section on running the eval locally, reading the summary, and the reviewed-PR process for updating the baseline.\n\nOutput format:\n- Summary of changes (bullets)\n- Unified diff\n- Verification: commands to run gate tests and a local PR-tier eval, plus a sample summary table\n- Risks / follow-ups (judge calibration still pending, cost per run, cases that need relabelling)\n\nConstraints: Python and the existing CI system only; no new eval SaaS or paid service without asking; no real secrets, tenant ids, or customer data in code, fixtures, or logs; keep the diff reviewable and do not change application behaviour.\n"
},
{
"id": "harden-maven-dependency-cves",
"title": "Harden Maven Dependencies Against CVEs",
"whenToUse": "Take a reactor or module with CVE / SCA findings and produce BOM or dependencyManagement fixes, enforcer tightening, a CI scan gate, and only justified suppressions.",
"tools": [
"copilot",
"claude-code",
"codex"
],
"tags": [
"java",
"maven",
"devsecops",
"cve",
"supply-chain",
"github-actions",
"owasp"
],
"formatNotes": "All three. Point the tool at the root/module `pom.xml`, enforcer config, suppressions file, and the CI workflow (or Jenkinsfile) that should fail on CVSS policy. Copilot: maven-dependency-cve path instructions plus those files in agent mode. Claude Code: the maven-dependency-cve-hygiene-guardrails skill plus the POM. Codex: AGENTS.md Maven supply-chain section, then the diff.",
"body": "Task: Review and harden Maven dependency CVE hygiene for the reactor or module I specify. Produce a small, reviewable diff: BOM/override fixes, enforcer rules, CI scan gate, and only justified suppressions.\n\nContext placeholders (fill from the repo or ask only if missing):\n- Reactor / module path: {{MODULE_PATH}} (root pom or -pl module)\n- CVE or finding ids: {{CVE_IDS}} (comma-separated, or \"scan-first\")\n- Scanner: {{SCANNER}} (owasp-dependency-check | dependabot-only | org-sca | trivy-fs)\n- Fail threshold: {{FAIL_CVSS}} (e.g. 7.0)\n- BOM in use: {{BOM}} (spring-boot | custom-parent | none | unknown)\n- CI entrypoint: {{CI}} (path to workflow or Jenkinsfile)\n- Suppressions file: {{SUPPRESSIONS}} (path or \"create\")\n- Allowed fix style: {{FIX_STYLE}} (bom-bump | dependencyManagement-override | exclusion-last-resort | mixed)\n\nRequirements:\n\n1. Inventory\n - Parent/BOM imports and `dependencyManagement` order under {{MODULE_PATH}}\n - Existing `maven-enforcer-plugin` rules (convergence, upper-bound, release deps)\n - Current {{SCANNER}} config, plugin/action pins, and fail thresholds\n - {{SUPPRESSIONS}} contents: owners, dates, broad wildcards\n - Dependabot/Renovate Maven entries if present\n - For each id in {{CVE_IDS}} (or after a local scan): `mvn -q -pl … dependency:tree` path to the vulnerable GAV\n\n2. Design\n - Prefer {{FIX_STYLE}} with this order unless blocked: bump {{BOM}} / parent → post-BOM `dependencyManagement` override → exclusion only if unused and documented\n - Ensure overrides appear **after** BOM import so they win\n - Enable or tighten enforcer: `dependencyConvergence`, `requireUpperBoundDeps`, and release-profile `requireReleaseDeps` when missing\n - {{SCANNER}}=owasp-dependency-check: pin plugin version; set `failBuildOnCVSS` to {{FAIL_CVSS}}; wire into {{CI}}; note NVD/data-feed cache or mirror if the repo already has one — do not invent corporate URLs\n - {{SCANNER}}=dependabot-only: ensure Maven ecosystem + PR CI must pass; do not claim transitive CVEs are covered if only manifests are updated\n - Suppressions: add or keep only entries that cite {{CVE_IDS}}, specific GAV, justification, and a review-by date; remove eternal wildcards\n\n3. Author artifacts (prefer concrete diffs)\n - `pom.xml` / parent changes for versions and enforcer\n - {{CI}} job/steps for the scan (fail the PR on policy breach)\n - {{SUPPRESSIONS}} updates when unavoidable\n - Short note in existing AGENTS.md / copilot-instructions / CLAUDE.md only if those files already exist — one line on BOM + scan gate\n\n4. Verification\n - Re-run tree for {{CVE_IDS}} and show fixed version on the path\n - Run the module test command already used in-repo\n - Confirm scanner would fail on a known High finding (or document how to dry-run)\n - Grep for version ranges, `LATEST`, and duplicate managed versions\n\nConstraints:\n- Minimal diff; match existing POM style (properties vs direct versions).\n- Do not invent Nexus/Artifactory URLs, company BOM coordinates, or NVD mirror hosts — use placeholders if absent.\n- Do not disable enforcer or the scan gate to \"get green\".\n- Do not confuse container base-image CVEs with Maven artifact CVEs.\n- Optimize for GitHub Copilot, Claude Code, and Codex — concrete POM/XML and checklist output.\n\nOutput format:\n1. Plan (fix per CVE + gate changes)\n2. Diffs (pom, enforcer, CI, suppressions)\n3. Tree snippets before/after for {{CVE_IDS}}\n4. Verification checklist + residual risk\n\nStart from {{MODULE_PATH}}. Prefer BOM bumps and post-BOM overrides over exclusions.\n"
}
]
}
Loading
Loading