Skip to content

Commit 17ce460

Browse files
Merge pull request #20 from GitHubSecurityLab/optimize_demo
reduce token use in demo
2 parents 50ebf73 + d26eabc commit 17ce460

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed

src/seclab_taskflows/taskflows/audit/ghsa_variant_analysis_demo.yaml

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,9 @@ seclab-taskflow-agent:
1010
filetype: taskflow
1111
version: 1
1212

13-
model_config: seclab_taskflows.configs.model_config
14-
1513
globals:
1614
repo:
15+
ghsa:
1716

1817
taskflow:
1918
- task:
@@ -34,21 +33,29 @@ taskflow:
3433
- seclab_taskflows.toolboxes.gh_file_viewer
3534
- seclab_taskflow_agent.toolboxes.memcache
3635
user_prompt: |
37-
Fetch the details of the most recent GHSA of the repo {{ GLOBALS_repo }}.
36+
Fetch the details of the GHSA {{ GLOBALS_ghsa }} of the repo {{ GLOBALS_repo }}.
3837
3938
Analyze the description to understand what type of bug caused
40-
the vulnerability.
39+
the vulnerability. DO NOT perform a code audit at this stage, just
40+
look at the GHSA details.
41+
42+
Check if any source file is mentioned as the cause of the GHSA.
43+
If so, identify the precise file path and line number.
4144
42-
Try to determine from the description the
43-
name of the source code file that the bug was in.
45+
If no file path is mentioned, then report back to the user that
46+
you cannot find any file path and end the task here.
4447
4548
The GHSA may not specify the full path name of the source
4649
file, or it may mention the name of a function or method
4750
instead, so if you have difficulty finding the file, try
4851
searching for the most likely match.
4952
53+
Only identify the file path for now, do not look at the code or
54+
fetch the file contents yet.
55+
5056
Store a summary of your findings in the memcache with the GHSA
51-
ID as the key.
57+
ID as the key. That should include the file path and the function that
58+
the file is in.
5259
5360
- task:
5461
must_complete: true
@@ -61,8 +68,12 @@ taskflow:
6168
Fetch the GHSA ID and summary that were stored in the memcache
6269
by the previous task.
6370
71+
Look at the file path and function that were identified. Use the
72+
get_file_lines_from_gh tool to fetch a small portion of the file instead of
73+
fetching the entire file.
74+
6475
Fetch the source file that was identified as the cause of the
65-
GHSA in repo {{ GLOBALS_repo }}.
76+
GHSA in repo {{ GLOBALS_repo }}.
6677
6778
Do a security audit of the code in the source file, focusing
6879
particularly on the type of bug that was identified as the

0 commit comments

Comments
 (0)