CLI + GitHub Action gate
Shift LLM-security testing left. The `doesitdefend` CLI and the matching GitHub Action authenticate with a didk_ API key, scope the run to the diff (system_prompt / tools / watch list from .doesitdefend.yml), and post a verdict back as a PR check + comment within minutes.
The CI integration moves LLM security testing to where code changes are reviewed. The CLI authenticates with a didk_ key, scopes the run to the diff, and the GitHub Action posts the verdict where reviewers already look.
This page covers the tooling. The pull-request workflow — what the App does with a webhook from end to end — is the PR Diff Red-Team Gate concept.
Key points
- didk_ API keys are tenant-scoped and revocable from /settings/api-keys.
- Diff-aware probe selection — only the OWASP categories the change touches run, keeping CI minutes low.
- Verdict modes: regression (default — fails the build only on a real posture drop), findings (any new finding fails), never (advisory only).
- PR comment is idempotent — re-runs replace the previous comment instead of stacking.
Setup (5 minutes)
- Create a didk_ key in /settings/api-keys, store as DOESITDEFEND_API_KEY repo secret.
- Drop a .doesitdefend.yml at the repo root declaring target.endpoint + watched prompt files.
- Add the GitHub Action to .github/workflows/ — or run doesitdefend scan from any CI.
Setup is deliberately short: install the CLI, export a key, and add the Action to a workflow, or run the scan from any CI step. The manifest (.doesitdefend.yml) declares what to watch, so the scope lives in the repository rather than in a dashboard.
What lands on the PR
- GitHub check run with title (Baseline scan recorded / Regression detected / Improvement).
- Idempotent PR comment with the diff-selected category and per-finding evidence.
- Baseline auto-selected from the most recent same-target run within 30 days (BASELINE_MAX_AGE_DAYS).
A pull request receives a check run and an idempotent comment. Baseline selection picks the most recent comparable same-target run within a 30-day window, so the verdict describes a change relative to what was already tested — not an absolute judgement of the branch.
Related resources