-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprompts.go
50 lines (40 loc) · 1.35 KB
/
prompts.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package main
import (
"fmt"
)
func makeListPrompt(chunk string) string {
return fmt.Sprintf(
`Given the following bash script, explain with bullet points what it's doing. Don't complete or print the script itself...
[Script]
%s
[Format]
Use "•" character in the list, do not give any title to the list itself. Do not leave empty lines. Put space in between the text of the point and the marker.`,
chunk,
)
}
func makeSecurityPrompt(chunk string) string {
return fmt.Sprintf(
`[Context]
You are given a bash script that needs to be analyzed for security. Due to its size, the script is divided into smaller chunks. Please focus your analysis on the following chunk:
[Chunk]
%s
[Question]
Based on the provided chunk, please evaluate if it's secure to run the script on your machine. Please answer with one sentence only, starting with "It's ..."`,
chunk,
)
}
func makeConclusionPrompt(output string, securityAudit string) string {
return fmt.Sprintf(
`[Context]
You've analysed the script split into parts and gave the following conclusions:
"%s"
Also you've checked what the script is doing and produced this list:
"%s"
[Task]
Given this context and the list, summarize if it's safe to run such script on my computer.
[Format]
Give one sentence summary only, start it with "It's ..."`,
securityAudit,
output,
)
}