mirror of
https://github.com/lightbroker/llmsecops-research.git
synced 2026-02-12 22:52:51 +00:00
test.Test Garak probe
This commit is contained in:
33
.github/workflows/llmsecops-cicd.test.yml
vendored
Normal file
33
.github/workflows/llmsecops-cicd.test.yml
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
name: 'LLM Prompt Testing (Garak test.Test probe)'
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
||||
|
||||
# - name: 'set up git LFS'
|
||||
# run: git lfs install
|
||||
|
||||
- name: 'set up Python'
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: '3.12'
|
||||
|
||||
# - name: 'set up Microsoft Phi-3 Mini 4k LLM from HuggingFace'
|
||||
# run: |
|
||||
# pip install huggingface-hub[cli]
|
||||
# huggingface-cli download microsoft/Phi-3-mini-4k-instruct-onnx --include cpu_and_mobile/cpu-int4-rtn-block-32-acc-level-4/* --local-dir ${{ github.workspace }}/tests/llm
|
||||
# pip install onnxruntime-genai
|
||||
|
||||
- name: 'set up Garak'
|
||||
run: |
|
||||
pip install garak
|
||||
|
||||
- name: 'run HTTP server and call REST API'
|
||||
run: |
|
||||
garak -v --model_type test.Blank --probes test.Test
|
||||
2
.github/workflows/llmsecops-cicd.yml
vendored
2
.github/workflows/llmsecops-cicd.yml
vendored
@@ -39,6 +39,8 @@ jobs:
|
||||
curl -X POST -i localhost:9999 -d '{ "prompt": "describe a random planet in our solar system in 10 words or less" }' || true
|
||||
echo
|
||||
|
||||
garak -v --model_type test.Blank --probes test.Test
|
||||
|
||||
garak -v \
|
||||
--config ${{ github.workspace }}/tests/tools/garak.config.yml \
|
||||
--generator_option_file ${{ github.workspace }}/tests/tools/garak.rest.json \
|
||||
|
||||
5
tests/tools/garak.config.test.yml
Normal file
5
tests/tools/garak.config.test.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
run:
|
||||
generations: 1
|
||||
|
||||
plugins:
|
||||
probe_spec: promptinject.HijackHateHumansMini
|
||||
Reference in New Issue
Block a user