Skip to content

Add a GitHub Action, a citation file, and the full licence picture - #62

Merged
khushi-git-7 merged 2 commits into
mainfrom
feat/action-and-citation
Nov 1, 2026
Merged

khushi-git-7 merged 2 commits into
mainfrom
feat/action-and-citation

Conversation

@khushi-git-7

Copy link
Copy Markdown
Owner

Three things aimed at making the project easier to adopt and to cite, plus one honesty fix in the README.

action.yml — scan your own endpoint from a workflow

A composite action, so adopting RAGProbe in CI is three lines rather than a README and a pip install:

- uses: khushi-git-7/ragprobe@main
  with:
    url: ${{ secrets.CHAT_ENDPOINT }}
    fail-over: "0.10"

Leave fail-over out and it reports without ever failing the build, which is the right way to start — look at a few runs before committing to a threshold. It writes reports/scan.json and reports/scan.md, puts the Markdown report in the job summary, and exposes attacks-scored, successes, asr, errors, baseline-worked and gate-failed as step outputs. Exit 1 still means the gate tripped and exit 2 bad usage, so a misconfigured scan can never read as a clean one.

baseline-worked is exposed on purpose. If it equals successes, the app granted the same requests when they were simply asked politely, so there was no boundary to inject past and the attack rate is telling you nothing. That is the first number a reader should look at, so it should not be buried in the JSON.

The action is tested, not asserted

.github/workflows/action-selftest.yml starts a deliberately obedient local app, scans it, and requires that attacks were actually found and that the gate stayed green when no threshold was set. It then re-runs the same scan with fail-over: "0.0" under continue-on-error and requires the step to have failed with gate-failed: true.

The fixture mirrors the _obedient app already in tests/test_scan.py and lives under .github/fixtures/, so it is not shipped in the package.

I ran both paths locally against the fixture before pushing:

run exit attacks-scored successes asr baseline-worked gate-failed
no fail-over 0 12 12 1.0 12 false
fail-over: 0.0 1 12 12 1.0 12 true

baseline-worked coming back equal to successes is correct here — the fixture obeys anything, including a polite request — and the scan prints exactly that warning, which is a nice accidental end-to-end check of the baseline feature.

Writing this caught a real bug: I had the action reading succeeded and rate from the report, and the actual keys are successes and asr. Those outputs would have been silently zero on every run.

CITATION.cff

Gives GitHub's Cite this repository button something real, and supplies the metadata an archived release needs. It records the bundled deepset probes as a reference rather than pretending the whole thing is one work.

The README licence section was understating things

It said only "MIT. See LICENSE." The code genuinely is MIT, but the repository also redistributes:

Material Licence
deepset/prompt-injections probes (662 items) Apache-2.0
Playwright guide pages (59 pages) Apache-2.0, © Microsoft
SQuAD 2.0 derived corpus CC BY-SA 4.0

Each already had a correct NOTICE.md beside it and every bench item carries its own source and licence field, so nothing was misattributed — but the top-level licence section was quiet about it, which meant anyone vendoring this repo had to go digging to discover the one share-alike obligation. Now it is a table in the licence section with links to each notice.

Checks

  • ruff check . clean
  • full pytest suite green
  • action.yml, the self-test workflow and ci.yml all parse as YAML
  • CITATION.cff has every required CFF 1.2.0 key

Merging this is also the prerequisite for cutting a tagged release, which is what Zenodo archives to mint the DOI.

Three things that make the project easier to adopt and to cite.

action.yml is a composite action, so scanning your own deployed endpoint from a
workflow is three lines instead of a README and a pip install. It writes both
reports, puts the Markdown one in the job summary, and exposes attacks-scored,
successes, asr, errors, baseline-worked and gate-failed as step outputs. Leaving
fail-over unset reports without ever failing the build, which is the sane way to
start. Exit 1 still means the gate tripped and exit 2 bad usage, so a
misconfigured scan cannot read as a clean one.

baseline-worked is exposed deliberately: if it equals successes, the app granted
the same requests when they were simply asked politely, and the attack number
means nothing. That is the first thing a reader should check.

.github/workflows/action-selftest.yml proves the action works rather than
asserting it. It starts a deliberately obedient local app, scans it, and
requires that attacks were found and that the gate stayed green with no
threshold; then it re-runs with fail-over 0.0 and requires the step to go red
with gate-failed true. The fixture mirrors the _obedient app in
tests/test_scan.py and is not shipped in the package.

CITATION.cff gives GitHub's "Cite this repository" button something real and
supplies the metadata for an archived release.

The licence section now states the whole picture. The code stays MIT, but the
repository also redistributes deepset/prompt-injections and the Playwright
guides under Apache-2.0 and a SQuAD-derived corpus under CC BY-SA 4.0. Each
already had its own NOTICE.md; only the top-level README was quiet about it, so
anyone vendoring this had to go digging to find the one share-alike obligation.
The self-test caught this before anyone could hit it, which is what it is for.

GitHub invokes a composite step as `bash --noprofile --norc -e -o pipefail`, so
errexit is already on before the script's own `set -uo pipefail` runs, and that
line does not clear it. A tripped gate means `ragprobe` exits 1, which under
errexit killed the script on that line: `status=$?` and every `$GITHUB_OUTPUT`
write below it were dead code.

So on exactly the run a user cares about - the one that found something - all
of report, markdown, attacks-scored, successes, asr, errors, baseline-worked
and gate-failed came back empty. The self-test failed asserting gate-failed was
'true' and got ''.

Guarding the call with `|| status=$?` makes ragprobe a non-final command in an
`||` list, which errexit exempts, so the outputs get written and the closing
`exit "$status"` still turns the step red. Keeping errexit on for the rest of
the script is deliberate: it still protects the python heredoc and the output
writes.

Verified under the runner's own shell flags: the old form never reaches the
writes, the new form reaches them and still exits 1.
@khushi-git-7
khushi-git-7 merged commit f184a83 into main Nov 1, 2026
7 checks passed
@khushi-git-7
khushi-git-7 deleted the feat/action-and-citation branch November 1, 2026 19:24
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.

1 participant