Skip to content

Commit

Permalink
probe: add whois injection to latentinjection (#947)
Browse files Browse the repository at this point in the history
Add tests for WHOIS response injections to `latentinjection` probe.
Resolves #73

## Todo:
* move whois responses into `payload`
* add second probe using same data in a "sandwiched" way like the Eiffel
snippet probe does, simulating a RAG being asked to identify and report
on any malicious domains in a whois DB

## Verification

- [ ] `garak -m test -p latentinjection.LatentWhois`
- [ ] Run the tests and ensure they pass `python -m pytest
tests/probes/test_probes_latentinjection.py`
  • Loading branch information
leondz authored Oct 24, 2024
2 parents 03356ed + 9fdd706 commit 9aadcfb
Show file tree
Hide file tree
Showing 4 changed files with 148 additions and 20 deletions.
9 changes: 9 additions & 0 deletions garak/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,15 @@ def main(arguments=None) -> None:
if "buffs" in args:
_config.plugins.buff_spec = args.buffs

# base config complete

if hasattr(_config.run, "seed") and isinstance(_config.run.seed, int):
import random

random.seed(
_config.run.seed
) # setting seed persists across re-imports of random

# startup
import sys
import json
Expand Down
Loading

0 comments on commit 9aadcfb

Please sign in to comment.