File tree 6 files changed +156
-0
lines changed
6 files changed +156
-0
lines changed Original file line number Diff line number Diff line change @@ -85,3 +85,23 @@ testcases:
85
85
https://www.insight.stacklok.com/report/pypi/invokehttp?utm_source=codegate
86
86
does_not_contain : |
87
87
import invokehttp
88
+
89
+ anthropic_secret_redaction :
90
+ name : Anthropic Secret Redaction
91
+ provider : anthropic
92
+ url : http://127.0.0.1:8989/anthropic/messages
93
+ data : |
94
+ {
95
+ "messages": [
96
+ {
97
+ "role": "user",
98
+ "content":"Here's my API key: ghp_aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789. Can you help me list my repos on GitHub?"
99
+ }
100
+ ],
101
+ "model":"claude-3-5-haiku-20241022",
102
+ "stream": true
103
+ }
104
+ contains : |
105
+ CodeGate prevented 1 secret
106
+ not_contains : |
107
+ ghp_aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789
Original file line number Diff line number Diff line change @@ -11,6 +11,10 @@ testcases:
11
11
data : |
12
12
{
13
13
"messages":[
14
+ {
15
+ "content":"You are a coding assistant.",
16
+ "role":"system"
17
+ },
14
18
{
15
19
"content":"Reply with that exact sentence: Hello from the integration tests!",
16
20
"role":"user"
@@ -29,6 +33,10 @@ testcases:
29
33
data : |
30
34
{
31
35
"messages":[
36
+ {
37
+ "content":"You are a coding assistant.",
38
+ "role":"system"
39
+ },
32
40
{
33
41
"content":"Generate me example code using the python invokehttp package to call an API",
34
42
"role":"user"
@@ -42,3 +50,26 @@ testcases:
42
50
does_not_contain : |
43
51
import invokehttp
44
52
53
+ copilot_secret_redacting_chat :
54
+ name : Copilot secret redacting chat
55
+ provider : copilot
56
+ url : " https://api.openai.com/v1/chat/completions"
57
+ data : |
58
+ {
59
+ "messages":[
60
+ {
61
+ "content":"You are a coding assistant.",
62
+ "role":"system"
63
+ },
64
+ {
65
+ "content":"Here's my API key: ghp_aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789. Can you help me list my repos on GitHub?",
66
+ "role":"user"
67
+ }
68
+ ],
69
+ "model":"gpt-4o-mini",
70
+ "stream":true
71
+ }
72
+ contains : |
73
+ CodeGate prevented 1 secret
74
+ not_contains : |
75
+ ghp_aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789
Original file line number Diff line number Diff line change @@ -66,3 +66,29 @@ testcases:
66
66
}
67
67
contains : |
68
68
CodeGate detected one or more malicious, deprecated or archived packages.
69
+
70
+ llamacpp_secret_redacting_chat :
71
+ name : LlamaCPP secret redacting chat
72
+ provider : llamacpp
73
+ url : http://127.0.0.1:8989/llamacpp/chat/completions
74
+ data : |
75
+ {
76
+ "max_tokens":4096,
77
+ "messages":[
78
+ {
79
+ "content":"You are a coding assistant.",
80
+ "role":"system"
81
+ },
82
+ {
83
+ "content":"Here's my API key: ghp_aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789. Can you help me list my repos on GitHub?",
84
+ "role":"user"
85
+ }
86
+ ],
87
+ "model":"qwen2.5-coder-0.5b-instruct-q5_k_m",
88
+ "stream":true,
89
+ "temperature":0
90
+ }
91
+ contains : |
92
+ CodeGate prevented 1 secret
93
+ not_contains : |
94
+ ghp_aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789
Original file line number Diff line number Diff line change @@ -86,3 +86,29 @@ testcases:
86
86
}
87
87
contains : |
88
88
CodeGate detected one or more malicious, deprecated or archived packages.
89
+
90
+ ollama_secret_redacting_chat :
91
+ name : Ollama secret redacting chat
92
+ provider : ollama
93
+ url : http://127.0.0.1:8989/ollama/chat/completions
94
+ data : |
95
+ {
96
+ "max_tokens":4096,
97
+ "messages":[
98
+ {
99
+ "content":"You are a coding assistant.",
100
+ "role":"system"
101
+ },
102
+ {
103
+ "content":"Here's my API key: ghp_aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789. Can you help me list my repos on GitHub?",
104
+ "role":"user"
105
+ }
106
+ ],
107
+ "model":"qwen2.5-coder:0.5b",
108
+ "stream":true,
109
+ "temperature":0
110
+ }
111
+ contains : |
112
+ CodeGate prevented 1 secret
113
+ not_contains : |
114
+ ghp_aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789
Original file line number Diff line number Diff line change @@ -78,3 +78,29 @@ testcases:
78
78
https://www.insight.stacklok.com/report/pypi/invokehttp?utm_source=codegate
79
79
does_not_contain : |
80
80
import invokehttp
81
+
82
+ openai_secret_redacting_chat :
83
+ name : OpenAI secret redacting chat
84
+ provider : openai
85
+ url : http://127.0.0.1:8989/openai/chat/completions
86
+ data : |
87
+ {
88
+ "max_tokens":4096,
89
+ "messages":[
90
+ {
91
+ "content":"You are a coding assistant.",
92
+ "role":"system"
93
+ },
94
+ {
95
+ "content":"Here's my API key: ghp_aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789. Can you help me list my repos on GitHub?",
96
+ "role":"user"
97
+ }
98
+ ],
99
+ "model":"gpt-4o-mini",
100
+ "stream":true,
101
+ "temperature":0
102
+ }
103
+ contains : |
104
+ CodeGate prevented 1 secret
105
+ not_contains : |
106
+ ghp_aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789
Original file line number Diff line number Diff line change @@ -86,3 +86,30 @@ testcases:
86
86
}
87
87
contains : |
88
88
CodeGate detected one or more malicious, deprecated or archived packages.
89
+
90
+ # Commented out because it takes too much time in the CI pipeline. Also, this functionality should not be provider-specific
91
+ # vllm_secret_redacting_chat:
92
+ # name: VLLM secret redacting chat
93
+ # provider: vllm
94
+ # url: http://127.0.0.1:8989/vllm/chat/completions
95
+ # data: |
96
+ # {
97
+ # "max_tokens":4096,
98
+ # "messages":[
99
+ # {
100
+ # "content":"You are a coding assistant.",
101
+ # "role":"system"
102
+ # },
103
+ # {
104
+ # "content":"Here's my API key: ghp_aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789. Can you help me list my repos on GitHub?",
105
+ # "role":"user"
106
+ # }
107
+ # ],
108
+ # "model":"Qwen/Qwen2.5-Coder-0.5B-Instruct",
109
+ # "stream":true,
110
+ # "temperature":0
111
+ # }
112
+ # contains: |
113
+ # CodeGate prevented 1 secret
114
+ # not_contains: |
115
+ # ghp_aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789
You can’t perform that action at this time.
0 commit comments