-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathcreate_examples.sh
152 lines (110 loc) · 6.09 KB
/
create_examples.sh
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
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
#!/bin/bash
AGENT_PROMPT_TYPES="sec-design attack-surface attack-tree threat-modeling mitigations vulnerabilities"
declare -A models
declare -A deep_analysis_models
# models["o1"]="openai"
# models["o3-mini"]="openai"
# models["gemini-2.0-flash-thinking-exp"]="google"
# models["deepseek/deepseek-r1"]="openrouter"
# models["gemini-2.0-pro-exp"]="google"
models["anthropic/claude-3.7-sonnet:thinking"]="openrouter"
# deep_analysis_models["gemini-2.0-pro-exp"]="google"
# deep_analysis_models["gemini-2.0-flash-thinking-exp"]="google"
declare -A temperatures
temperatures["o1"]="1"
temperatures["o3-mini"]="1"
temperatures["gemini-2.0-flash-thinking-exp"]="0.7"
temperatures["deepseek/deepseek-r1"]="0.7"
temperatures["gemini-2.0-pro-exp"]="0.7"
temperatures["anthropic/claude-3.7-sonnet:thinking"]="1"
for agent_prompt_type in $AGENT_PROMPT_TYPES; do
# Iterate over the keys of the models array
for agent_model in "${!models[@]}"; do
agent_provider="${models[$agent_model]}"
safe_agent_model=$(echo $agent_model | tr '[:upper:]' '[:lower:]' | tr -cd '[:alnum:]_.-')
echo "Generating example for $agent_prompt_type with $agent_model"
ARGS="dir -t ../screenshot-to-code/ -v -o examples/dir-${agent_prompt_type}-screenshot-to-code-${safe_agent_model}.md --agent-model $agent_model --agent-temperature ${temperatures[$agent_model]} --agent-prompt-type $agent_prompt_type --agent-provider $agent_provider"
CMD="python ai_security_analyzer/app.py $ARGS"
echo "Running: $CMD"
python ai_security_analyzer/app.py $ARGS
sleep 10
done
done
for agent_prompt_type in $AGENT_PROMPT_TYPES; do
if [ "$agent_prompt_type" == "vulnerabilities" ]; then
continue
fi
# Iterate over the keys of the models array
for agent_model in "${!models[@]}"; do
agent_provider="${models[$agent_model]}"
safe_agent_model=$(echo $agent_model | tr '[:upper:]' '[:lower:]' | tr -cd '[:alnum:]_.-')
echo "Generating example for $agent_prompt_type with $agent_model"
ARGS="file -t tests/EXAMPLE_ARCHITECTURE.md -v -o examples/file-${agent_prompt_type}-ai-nutrition-pro-${safe_agent_model}.md --agent-model $agent_model --agent-temperature ${temperatures[$agent_model]} --agent-prompt-type $agent_prompt_type --agent-provider $agent_provider"
CMD="python ai_security_analyzer/app.py $ARGS"
echo "Running: $CMD"
python ai_security_analyzer/app.py $ARGS
sleep 10
done
done
for agent_prompt_type in $AGENT_PROMPT_TYPES; do
if [ "$agent_prompt_type" == "vulnerabilities" ]; then
continue
fi
# Iterate over the keys of the models array
for agent_model in "${!models[@]}"; do
agent_provider="${models[$agent_model]}"
safe_agent_model=$(echo $agent_model | tr '[:upper:]' '[:lower:]' | tr -cd '[:alnum:]_.-')
echo "Generating example for $agent_prompt_type with $agent_model"
ARGS="github -t https://github.com/abi/screenshot-to-code -v -o examples/github-${agent_prompt_type}-screenshot-to-code-${safe_agent_model}.md --agent-model $agent_model --agent-temperature ${temperatures[$agent_model]} --agent-prompt-type $agent_prompt_type --agent-provider $agent_provider"
CMD="python ai_security_analyzer/app.py $ARGS"
echo "Running: $CMD"
python ai_security_analyzer/app.py $ARGS
sleep 10
done
done
for agent_prompt_type in $AGENT_PROMPT_TYPES; do
if [ "$agent_prompt_type" == "vulnerabilities" ]; then
continue
fi
for agent_model in "${!deep_analysis_models[@]}"; do
agent_provider="${deep_analysis_models[$agent_model]}"
safe_agent_model=$(echo $agent_model | tr '[:upper:]' '[:lower:]' | tr -cd '[:alnum:]_.-')
echo "Generating example for $agent_prompt_type with $agent_model"
mkdir -p examples/deep-analysis/${safe_agent_model}
ARGS="github -t https://github.com/pallets/flask -v -o examples/deep-analysis/${safe_agent_model}/github-da-${agent_prompt_type}-flask-${safe_agent_model}.md --agent-model $agent_model --agent-temperature ${temperatures[$agent_model]} --agent-prompt-type $agent_prompt_type --agent-provider $agent_provider --deep-analysis"
CMD="python ai_security_analyzer/app.py $ARGS"
echo "Running: $CMD"
python ai_security_analyzer/app.py $ARGS
sleep 5
done
done
for agent_model in "${!models[@]}"; do
agent_prompt_type="vulnerabilities-workflow-1"
agent_provider="${models[$agent_model]}"
secondary_agent_provider="openai"
secondary_agent_model="o3-mini"
secondary_agent_temperature="1"
safe_agent_model=$(echo $agent_model | tr '[:upper:]' '[:lower:]' | tr -cd '[:alnum:]_.-')
echo "Generating example for $agent_prompt_type with $agent_model"
ARGS="dir -t ../screenshot-to-code/ -v -o examples/dir-vulnerabilitiesworkflow1-screenshot-to-code-${safe_agent_model}.md --agent-model $agent_model --agent-temperature ${temperatures[$agent_model]} --agent-prompt-type $agent_prompt_type --agent-provider $agent_provider --vulnerabilities-iterations 2"
CMD="python ai_security_analyzer/app.py $ARGS"
echo "Running: $CMD"
python ai_security_analyzer/app.py $ARGS
sleep 10
done
########################
# form3tech-oss
########################
for agent_prompt_type in $AGENT_PROMPT_TYPES; do
# Iterate over the keys of the models array
for agent_model in "${!models[@]}"; do
agent_provider="${models[$agent_model]}"
safe_agent_model=$(echo $agent_model | tr '[:upper:]' '[:lower:]' | tr -cd '[:alnum:]_.-')
echo "Generating example for $agent_prompt_type with $agent_model"
ARGS="dir -t ../terraform-provider-chronicle/ -v -o examples/form3tech-oss/dir-${agent_prompt_type}-terraform-provider-chronicle-${safe_agent_model}.md --agent-model $agent_model --agent-temperature ${temperatures[$agent_model]} --agent-prompt-type $agent_prompt_type --agent-provider $agent_provider -p go --include **/*.tf,**/*.tmpl,**/GNUmakefile"
CMD="python ai_security_analyzer/app.py $ARGS"
echo "Running: $CMD"
python ai_security_analyzer/app.py $ARGS
sleep 10
done
done