Commit 26a3ed1
committed
Move jailbreak guardrails into single pipeline class
We've got 3 classes for Jailbreak guardrails. It's a fairly simple
class and can just be moved into a single class in the answer composition
pipeline.
I did consider leaving the JailbreakChecker class as a separate class, but
it just didn't seem like there was a lot of value.
One thing i noticed while merging this, is that we create a ResponseError
class in the JailbreakChecker, but we don't actually raise it anywhere
so it was redundant. I've removed it, but if we want we can check
that the llm response either returns the pass or fail value and
create the object in the db with the correct status if it doesn't.
We'd need to add some additional prompt config for the fail value though
in order to do that so i've avoided it for now.
We will need to do some follow up work to update the evaluation repo
since we just return the serialised answer now so it'll need to grab
the info it wants from the serialised answer instead of the result that
was previously returned from the JailbreakChecker.1 parent d2482d5 commit 26a3ed1
10 files changed
Lines changed: 139 additions & 480 deletions
File tree
- lib
- answer_composition
- pipeline
- guardrails
- claude
- tasks
- spec/lib
- answer_composition
- pipeline
- guardrails
- claude
- tasks
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
6 | 16 | | |
7 | 17 | | |
8 | | - | |
| 18 | + | |
9 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
10 | 26 | | |
11 | | - | |
12 | | - | |
13 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
14 | 31 | | |
15 | 32 | | |
16 | | - | |
| 33 | + | |
17 | 34 | | |
18 | 35 | | |
19 | 36 | | |
20 | 37 | | |
21 | 38 | | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | 39 | | |
31 | 40 | | |
32 | 41 | | |
33 | 42 | | |
34 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
35 | 86 | | |
36 | | - | |
| 87 | + | |
37 | 88 | | |
38 | 89 | | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
43 | 94 | | |
44 | 95 | | |
45 | 96 | | |
| |||
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | | - | |
| 24 | + | |
| 25 | + | |
26 | 26 | | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
| 27 | + | |
31 | 28 | | |
32 | 29 | | |
33 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | 29 | | |
31 | 30 | | |
32 | | - | |
| 31 | + | |
33 | 32 | | |
34 | 33 | | |
35 | 34 | | |
| |||
0 commit comments