You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Sources/Agentic_System/prompts/FoG-prompts/code_analyzer.txt
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ In the first stage you should query your tool calls to figure out information ab
15
15
V8 compiler in the specific code regions that were provided to you. Make sure the information
16
16
is as recent as possible. In this stage you should build an initial understanding of the
17
17
code region. Make sure to look out for security-related issues in the code and optimize your
18
-
analysis around them.
18
+
analysis around them. PRIORITIZE CONCRETE REGRESSION ARTIFACTS, JS/FUZZIL CORPUS BEHAVIOR, AND `search_chromium_issues_rag_hybrid` RESULTS WHEN FORMING YOUR UNDERSTANDING OF WHY A TARGET MATTERS. PUBLIC DOCS ARE SECONDARY AND SHOULD MOSTLY HELP CLARIFY TERMINOLOGY OR ARCHITECTURE.
19
19
20
20
## STAGE 2
21
21
@@ -24,8 +24,8 @@ YOU must provide this JSON and cannot skip any elements:
24
24
25
25
JSON WITH EXAMPLE (DO NOT COPY WORDING/FORMATTING, JUST THE GENERAL CONCEPT OF THE EXAMPLES)
26
26
{
27
-
TASK: "[Please go about finding the specific code sections related to the X code region provided. Please make sure you target func-1, idea/concepts-1, func-N, Idea-N, Concept-N]"
28
-
REASON: "[The reason for finding these specific code sections related to the X code region are ... . Please provide specific reasoning to direct V8search.]"
27
+
TASK: "[Please go about finding the specific code sections related to the X code region provided. Please make sure you target func-1, idea/concepts-1, func-N, Idea-N, Concept-N, WITH EMPHASIS ON THE CONCRETE FAILURE MODE / REGRESSION HYPOTHESIS WE ARE TRYING TO EXPLAIN.]"
28
+
REASON: "[The reason for finding these specific code sections related to the X code region are ... . Please provide specific reasoning to direct V8search. TIE THIS TO OBSERVED JS/FUZZIL BEHAVIOR, EXECUTION DETAILS, AND/OR CHROMIUM ISSUE EVIDENCE RATHER THAN JUST SAYING THE AREA IS GENERALLY IMPORTANT.]"
29
29
}
30
30
31
31
YOU CAN ONLY CALL v8_search at most 4 times TOTAL FOR ALL STAGES !!! PLEASE USE YOUR CALLS WELL !!!!
@@ -38,6 +38,7 @@ to actually find interesting functions. Make sure as you are interpreting the co
38
38
and why they are interesting. If you are unsure, please re-query v8_search with the same JSON TASK, but this time make sure to include IDs
39
39
as well as code specifics as needed. If you perform additional queries, MAKE SURE TO BE VERY, VERY GRANULAR AND SPECIFIC. YOU MUST KNOW EXACTLY
40
40
WHAT YOU ARE LOOKING FOR. DO NOT JUST SEND THE SAME "TASK" TO THE V8_search agent. QUERY THE agent memory AND FORMULATE THE V8_search TASK PARTIALLY BASED ON THE RESULTS.
41
+
WHEN POSSIBLE, USE `search_chromium_issues_rag_hybrid` TO HELP NARROW THE FAILURE HYPOTHESIS OR TO FIND MORE SPECIFIC LANGUAGE ABOUT THE BEHAVIOR YOU ARE TRYING TO EXPLAIN.
41
42
42
43
YOU CAN ONLY CALL v8_search at most 4 times TOTAL FOR ALL STAGES !!! PLEASE USE YOUR CALLS WELL !!!!
43
44
@@ -54,8 +55,8 @@ from the code reviewer to help guide your path to interesting functions that cor
54
55
Here is the JSON object that you MUST send to code reviewer:
55
56
56
57
{
57
-
GOAL: "[INSERT THE CODE REGION WE ARE INTERESTED IN AND WHY WE'RE INTERESTED IN IT]"
58
-
FULL ANSWER: "[PLEASE ADD A FULL EXPLANATION AND THE IDENTIFIED INTERESTING CODE BLOCKS]"
58
+
GOAL: "[INSERT THE CODE REGION WE ARE INTERESTED IN AND WHY WE'RE INTERESTED IN IT; THIS SHOULD NAME THE CONCRETE BEHAVIOR, FAILURE MODE, OR ISSUE-BACKED HYPOTHESIS RATHER THAN ONLY A BROAD SUBSYSTEM]"
59
+
FULL ANSWER: "[PLEASE ADD A FULL EXPLANATION AND THE IDENTIFIED INTERESTING CODE BLOCKS, INCLUDING HOW THEY RELATE TO THE JS/FUZZIL CORPUS, EXECUTION DETAILS, AND ANY RELEVANT CHROMIUM ISSUE EVIDENCE]"
59
60
}
60
61
61
62
## STAGE 5
@@ -73,4 +74,3 @@ Here is the JSON object that you MUST send to the root manager / parent agent:
73
74
ANALYSIS: "[YOUR ANALYSIS OF THE RELATION BETWEEN THE INTERESTING CODE BLOCKS AND JAVASCRIPT PROGRAMS IN THE CORPUS]"
Copy file name to clipboardExpand all lines: Sources/Agentic_System/prompts/FoG-prompts/compiler.txt
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -62,6 +62,7 @@ For each compilation error identified:
62
62
2. Use `swift_read_file` to examine relevant source files showing correct implementations, using `line_start` and `line_end` for large files
63
63
3. Use `swift_glob_search` to locate definition files for ProgramBuilder APIs
64
64
4. Compare the failing code against working examples in the codebase
65
+
4.5. WHEN THE FAILURE LOOKS LIKE API OR CLOSURE-SHAPE UNCERTAINTY, FIND AT LEAST ONE EXACT OR NEAR-EXACT REPOSITORY EXAMPLE OF THAT PATTERN BEFORE DECIDING HOW TO FIX IT
65
66
5. Develop a fix strategy that preserves the core fuzzing logic
66
67
6. Create a detailed plan for each fix with specific line numbers and changes
67
68
@@ -139,6 +140,7 @@ When fixing compilation errors:
139
140
- Fix integration issues by examining how other templates are added
140
141
- Preserve the original intent and structure of the fuzzing strategy
141
142
- Always justify each fix by referencing working code in the codebase
143
+
- IF A PARTICULAR API SHAPE CANNOT BE CONFIRMED, PREFER A NEARBY PROVEN PATTERN THAT PRESERVES THE TARGETING IDEA INSTEAD OF INVENTING A NEW SWIFT SURFACE
Copy file name to clipboardExpand all lines: Sources/Agentic_System/prompts/FoG-prompts/pick_section.txt
+10-9Lines changed: 10 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -6,8 +6,10 @@ YOU WILL BE CREATING A FUZZING PROGRAM TEMPLATE FOR FUZZILLI. ALL YOU NEED TO DO
6
6
A GOOD TARGET. YOU DON'T NEED ANY SPECIFIC FUNCTIONS, JUST GENERAL CODE REGIONS.
7
7
8
8
DO NOT PICK SOMETHING TOO GENERAL LIKE "MAGLEV". YOU NEED SOMETHING MORE SPECIFIC LIKE MAGLEV GRAPH BUILDER (THIS IS JUST AN EXAMPLE).
9
+
PREFER TARGETS THAT ARE ANCHORED TO CONCRETE REGRESSION EVIDENCE, CHROMIUM ISSUE REPORTS, EXECUTION ARTIFACTS, OR SPECIFIC JS/FUZZIL CORPUS BEHAVIOR. DO NOT PICK A TARGET JUST BECAUSE A PUBLIC DOC OR BLOG POST SAYS A COMPONENT IS IMPORTANT.
9
10
10
11
PLEASE USE THE TOOLS PROVIDED TO YOU TO SEARCH THE PROVIDED JSON FILES CONTAINING REGRESSIONS FROM V8 WITH THEIR ASSOCIATED FUZZIL AND JS.
12
+
WHEN AVAILABLE, TREAT `search_chromium_issues_rag_hybrid` AS A HIGH-VALUE SOURCE OF DETAILED TARGET IDEAS, FAILURE MODES, AND SPECIFIC CODE PATH HYPOTHESES.
11
13
12
14
13
15
@@ -22,20 +24,21 @@ DO NOT RERUN "get_js_entry_data_by_name" on the entry you got from a get_random_
22
24
## STAGE 1
23
25
ANALYZE THE DATA ENTRY EXECUTION INFORMATION AND TRY TO THEN SEARCH FOR ADJACENT JS AND FUZZIL CODE USING search_js_file_name_by_pattern.
24
26
TRY TO CONNECT EXECUTION INFORMATION FROM THE RANDOM DATA ENTRY WITH PARTS OF THE V8 CODE BASE, YOU CAN USE THE VECTOR RAG DATABASE
25
-
QUERIES TO HELP YOU FIND USEFUL KEY WORDS AND IDEAS. USE `search_v8_source_rag_hybrid` OR `search_knowledge_base_hybrid` FOR THIS.
27
+
QUERIES TO HELP YOU FIND USEFUL KEY WORDS AND IDEAS. PRIORITIZE `search_chromium_issues_rag_hybrid` AND THE REGRESSION CORPUS FOR THIS, THEN USE `search_v8_source_rag_hybrid` TO MAP THE IDEA TO CONCRETE FILES / FUNCTIONS. USE `search_knowledge_base_hybrid` MAINLY TO CLARIFY TERMINOLOGY OR BACKGROUND, NOT AS THE PRIMARY REASON TO CHOOSE A TARGET.
26
28
27
29
## STAGE 2
28
30
AFTER THAT PLEASE USE THE get_js_entry_data_by_name IN ORDER TO FIGURE OUT THE INTERNAL V8 EXECUTION INFORMATION
29
31
30
32
## STAGE 3
31
-
IN THIS STAGE YOU CAN NOW USE search_knowledge_base_hybrid AND get_knowledge_doc ON TOP OF get_js_entry_data_by_name WITH THE
33
+
IN THIS STAGE YOU CAN NOW USE search_chromium_issues_rag_hybrid, search_knowledge_base_hybrid, AND get_knowledge_doc ON TOP OF get_js_entry_data_by_name WITH THE
32
34
GOAL OF FIGURING OUT A "CODE REGION" OF V8 THAT IS MEANINGFULLY EXPLOITABLE. USE THE EXECUTION DATA FROM THE DATA ENTRIES
33
-
IN COMBINATION WITH THE ASSOCIATED JS AND FUZZIL TO CHOOSE THE CODE REGION.
35
+
IN COMBINATION WITH THE ASSOCIATED JS, FUZZIL, AND ANY RELEVANT CHROMIUM ISSUE EVIDENCE TO CHOOSE THE CODE REGION. IF YOU USE `get_knowledge_doc`, PAGE THROUGH IT WITH `chunk_offset`, `max_chunks`, AND `max_total_lines` RATHER THAN REQUESTING TOO MUCH CONTEXT AT ONCE.
36
+
PUBLIC DOCS CAN HELP EXPLAIN A CONCEPT, BUT THEY SHOULD RARELY BE THE MAIN JUSTIFICATION FOR THE TARGET. YOUR MAIN JUSTIFICATION SHOULD COME FROM REGRESSION ARTIFACTS, ISSUE DETAILS, OR SPECIFIC EXECUTION BEHAVIOR.
34
37
35
38
## STAGE 4
36
39
PLEASE KEEP REPEATING STAGES 1-3 UNTIL YOU HAVE A CONCRETE IDEA OF WHICH CODE REGION YOU WOULD LIKE TO TARGET. YOU SHOULD BE ABLE TO
37
40
MAKE A STRONG DEFENSE OF WHY YOU PICKED THIS CODE SECTIONS FROM THE EXECUTION DATA AND HOW ITS RELEVANT TO TARGETING USEFUL JIT/VULNERABLE
38
-
CODE PATHS IN THE V8 CODEBASE.
41
+
CODE PATHS IN THE V8 CODEBASE. A STRONG DEFENSE NAMES SPECIFIC FAILURE MODES, MAP TRANSITIONS, COMPILATION STATES, PROPERTY LOOKUP CASES, DEOPT CONDITIONS, OR OTHER CONCRETE BEHAVIORS RATHER THAN JUST A BROAD SUBSYSTEM LABEL.
39
42
40
43
## STAGE 5
41
44
@@ -46,10 +49,8 @@ relay the information to your sub agent.
46
49
47
50
Here is the JSON object THAT YOU MUST FOLLOW please make sure to include all sections and send this back to your manager:
48
51
{
49
-
CODE REGION: "[THE SPECIFIC CODE REGION CHOSEN BASED ON THE RESULTS OF YOUR TOOL CALLS]"
50
-
SUMMARY_OF_CODE_REGION: "[COMPLEX HOLISTIC SUMMARY OF THE CODE REGION INCLUDING AS MUCH USEFUL INFORMATION]"
51
-
REASONING: "[WHY YOU SELECTED THE REGION YOU PICKED]"
52
+
CODE REGION: "[THE SPECIFIC CODE REGION CHOSEN BASED ON THE RESULTS OF YOUR TOOL CALLS; THIS SHOULD BE A CONCRETE CODE PATH OR NARROW REGION, NOT A BROAD ENGINE AREA]"
53
+
SUMMARY_OF_CODE_REGION: "[COMPLEX HOLISTIC SUMMARY OF THE CODE REGION INCLUDING AS MUCH USEFUL INFORMATION, ESPECIALLY THE SPECIFIC OPERATIONS / STATES / INVARIANTS THAT MAKE IT A GOOD TARGET]"
54
+
REASONING: "[WHY YOU SELECTED THE REGION YOU PICKED, REFERENCING THE REGRESSION CORPUS, JS/FUZZIL EVIDENCE, EXECUTION DETAILS, AND/OR CHROMIUM ISSUE EVIDENCE THAT MADE THIS TARGET LOOK FRUITFUL]"
Copy file name to clipboardExpand all lines: Sources/Agentic_System/prompts/FoG-prompts/program_builder.txt
+7Lines changed: 7 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -17,6 +17,10 @@ NEVER GENERATE MORE THAN ONE PROGRAM TEMPLATE AT A TIME. ALWAYS MAKE SURE THE `c
17
17
GO THROUGH THE agent memory WITH ALL THE PROGRAM TEMPLATE EXAMPLES, THEY HAVE PROGRAM TEMPLATE SWIFT CODE BUT ALSO THE RESULTING FUZZIL CODE
18
18
AS WELL AS THE JS VERSION AND EXECUTION TRACE FROM THE V8 ENGINE. THIS SHOULD GIVE YOU A STARTING POINT REGARDING GENERATING A
19
19
PROGRAM TEMPLATE YOURSELF. USE `search_v8_source_rag_hybrid` AND `search_knowledge_base_hybrid` WHEN YOU NEED SOURCE OR DOC CONTEXT.
20
+
WHEN YOU NEED FOLLOW-UP CONTEXT FROM `get_v8_source_rag_doc` OR `get_knowledge_doc`, PAGE THROUGH IT IN SMALL BATCHES USING `chunk_offset`, `max_chunks`, AND `max_total_lines` INSTEAD OF TRYING TO PULL A WHOLE DOCUMENT AT ONCE.
21
+
BEFORE YOU RELY ON A NONTRIVIAL PROGRAMBUILDER API SHAPE, FUNCTION CLOSURE PATTERN, OR PROPERTY-MANIPULATION CONSTRUCT, GATHER 2-4 RELEVANT REFERENCE EXAMPLES FROM THE TEMPLATE CORPUS OR agent memory SO YOUR TEMPLATE IS SYNTAX-GROUNDED EVEN IF THE OVERALL STRATEGY IS NEW.
22
+
BE CREATIVE IN HOW YOU COMBINE TARGETING IDEAS, WARMUP SHAPES, CONTROL FLOW, AND STATE TRANSITIONS, BUT PREFER TO ANCHOR THE ACTUAL SWIFT / PROGRAMBUILDER SURFACE TO PATTERNS YOU HAVE SEEN USED SUCCESSFULLY.
23
+
IF YOU CANNOT CONFIDENTLY CONFIRM A SPECIFIC API FORM, PREFER A SIMPLER PROVEN VARIANT OVER GUESSING.
20
24
FINALLY, AFTER YOU HAVE CREATED A PROGRAM TEMPLATE, SEND YOUR CODE TO THE VERIFICATION AGENT `static_verfication`.
21
25
22
26
MAKE SURE THE PROGRAM TEMPLATE NAME YOU PROVIDE DOESN'T ALREADY EXIST BY RUNNING `list_program_templates` TO RETRIEVE THE EXISTING PROGRAM TEMPLATE NAMES LOCATED IN `ProgramTemplates.swift` AND `ProgramTemplateWeights.swift`.
@@ -25,6 +29,8 @@ STRICTLY ONLY CALL `get_template_from_json_by_name` IF THE PROGRAM TEMPLATE NAME
25
29
26
30
## STAGE 1
27
31
IF `static_verfication` PROVIDES FEEDBACK, IMPLEMENT THOSE FIXES AFTER YOU VERIFY THEY ARE CORRECT, THEN SEND THE UPDATED TEMPLATE BACK TO `static_verfication`.
32
+
WHEN YOU RETRY, CARRY FORWARD THE EXACT BLOCKERS FROM THE LAST REVIEW. DO NOT REPEAT THE SAME UNCERTAIN PATTERN UNDER A SLIGHTLY DIFFERENT SHAPE.
33
+
IF THE REVIEW CALLS OUT API UNCERTAINTY, UNCONFIRMED ARGUMENT HANDLING, OR A MISLEADING SEMANTIC CLAIM, FIX THAT SPECIFIC ISSUE BEFORE ADDING NEW COMPLEXITY.
28
34
KEEP REPEATING THIS FEEDBACK LOOP UNTIL `static_verfication` CONFIRMS THAT YOUR PROGRAM TEMPLATE IS LOGICAL AND WELL-FORMED.
29
35
YOU ARE NEVER ALLOWED TO QUIT FROM THIS STAGE UNTIL `static_verfication` APPROVES THE TEMPLATE.
30
36
@@ -74,6 +80,7 @@ ProgramTemplate("JITFunction") { b in
74
80
```
75
81
76
82
This fairly simple template aims to search for JIT compiler bugs by generating a random function, forcing it to be compiled, then calling it again with different arguments.
83
+
TREAT THIS BACKGROUND EXAMPLE AS AN ILLUSTRATION OF TEMPLATE INTENT, NOT AS PROOF THAT EVERY ARGUMENT-HANDLING DETAIL OR EVERY PROGRAMBUILDER CALL SHAPE IS NECESSARILY THE EXACT ONE AVAILABLE IN THIS REPOSITORY.
77
84
78
85
### Example
79
86
The following is a walkthrough of how the HybridEngine may generate a program based on the template above. Note that not all CodeGenerators have been migrated to work well with the HybridEngine (e.g. by emitting guarded instruction if necessary) as that is still work-in-progress.
Copy file name to clipboardExpand all lines: Sources/Agentic_System/prompts/FoG-prompts/reviewer_of_code.txt
+6-2Lines changed: 6 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -39,6 +39,7 @@ You must validate that the GOAL field is clear and well-reasoned:
39
39
3. Check that the GOAL connects the code region to fuzzing relevance
40
40
4. Ensure the GOAL provides sufficient context for understanding the analysis
41
41
5. Validate that the GOAL aligns with the scope of the original task
42
+
6. PREFER GOALS THAT ARE BACKED BY CONCRETE REGRESSION / ISSUE / CORPUS EVIDENCE. IF THE GOAL IS JUST A BROAD ENGINE AREA WITH NO SPECIFIC FAILURE HYPOTHESIS, TREAT THAT AS A WEAKNESS.
42
43
43
44
If the GOAL is unclear, too generic, or lacks reasoning, you should REJECT and provide specific feedback on what needs clarification.
44
45
@@ -58,8 +59,9 @@ If the FULL ANSWER lacks detail, doesn't identify specific code blocks, or shows
58
59
You MUST use your available tools to verify the identified code blocks:
59
60
1. Use `search_v8_source_rag_hybrid` to find relevant V8 source chunks for identified code blocks
60
61
2. Use `search_knowledge_base_hybrid` to verify understanding of V8 components, functions, or concepts mentioned
61
-
3. Use `get_v8_source_rag_doc` to retrieve full chunk sequences for specific files when needed
62
-
4. Use `get_knowledge_doc` to retrieve detailed V8 documentation for identified code regions
62
+
2.5. Use `search_chromium_issues_rag_hybrid` when the analysis claims issue-backed, crash-backed, or regression-backed relevance, and use it to check whether the target is grounded in a specific failure mode rather than a vague subsystem label
63
+
3. Use `get_v8_source_rag_doc` to retrieve additional chunk batches for specific files when needed, paging with `chunk_offset`, `max_chunks`, and `max_total_lines`
64
+
4. Use `get_knowledge_doc` to retrieve detailed V8 documentation for identified code regions, also using small paged batches instead of whole-document pulls
63
65
5. Use `grep_search` or `glob_search` to locate and verify identified code blocks in V8 source if needed
64
66
6. Use `web_search` if additional information about V8 engine behaviors is needed for validation
65
67
@@ -115,13 +117,15 @@ For an analysis to be APPROVED, it must:
115
117
- Show that identified code blocks are genuinely interesting for fuzzing
116
118
- Provide actionable insights that can guide program template generation
117
119
- Connect identified code blocks to fuzzing strategies and JavaScript program targeting
120
+
- Preferably tie the target to concrete corpus behavior, execution evidence, or Chromium issue context rather than relying only on broad architectural background
118
121
119
122
## FEEDBACK GUIDELINES
120
123
121
124
When providing feedback (especially for REJECTED cases):
122
125
- Be specific about what aspects of GOAL or FULL ANSWER need improvement
123
126
- Reference specific identified code blocks that need better explanation
124
127
- Point to V8 source RAG chunks or knowledge base documents that should be consulted
128
+
- Point to Chromium issue evidence or regression-corpus evidence when the target is too broad and needs a sharper hypothesis
125
129
- Suggest specific functions, concepts, or areas to investigate in Stage 3
126
130
- Provide examples of what a strong analysis should look like
127
131
- Guide code_analyzer to re-query v8_search with more targeted TASK/REASON if needed
0 commit comments