Repository navigation
Add a GitHub Action, a citation file, and the full licence picture - #62
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 workflowA composite action, so adopting RAGProbe in CI is three lines rather than a README and a pip install:
Leave
fail-overout 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 writesreports/scan.jsonandreports/scan.md, puts the Markdown report in the job summary, and exposesattacks-scored,successes,asr,errors,baseline-workedandgate-failedas 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-workedis exposed on purpose. If it equalssuccesses, 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.ymlstarts 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 withfail-over: "0.0"undercontinue-on-errorand requires the step to have failed withgate-failed: true.The fixture mirrors the
_obedientapp already intests/test_scan.pyand lives under.github/fixtures/, so it is not shipped in the package.I ran both paths locally against the fixture before pushing:
fail-overfail-over: 0.0baseline-workedcoming back equal tosuccessesis 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
succeededandratefrom the report, and the actual keys aresuccessesandasr. Those outputs would have been silently zero on every run.CITATION.cffGives 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:
deepset/prompt-injectionsprobes (662 items)Each already had a correct
NOTICE.mdbeside it and every bench item carries its ownsourceandlicencefield, 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 .cleanaction.yml, the self-test workflow andci.ymlall parse as YAMLCITATION.cffhas every required CFF 1.2.0 keyMerging this is also the prerequisite for cutting a tagged release, which is what Zenodo archives to mint the DOI.