Add Quark Script Agent in Document#664
Merged
Merged
Conversation
haeter525
requested changes
Jul 27, 2024
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #664 +/- ##
=======================================
Coverage 78.73% 78.73%
=======================================
Files 64 64
Lines 5324 5324
=======================================
Hits 4192 4192
Misses 1132 1132
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Quark Script Agent
Introducing Quark's new member, the Quark Script Agent, the first AI assistant in the Quark team. This agent enables users to perform analyses using natural language, without the need for programming or scripting expertise, making the process simple and user-friendly.
The Quark Script Agent integrates with LangChain, which utilizes OpenAI's large language models to act as a bridge between natural language and the Quark Script API. LangChain defines the Quark Script API as a tool that large language models can understand and use. This means that users can easily call new analysis APIs using natural language commands by simply adding new tools as needed.
Showcase: Detecting CWE-798 with Quark Script Agent
Here's an example of using the Quark Script Agent with the
quarkScriptAgent.py. This agent can currently detect CWE-798 vulnerability in the ovaa.apk. See the details below.Quick Start
Decode the Prompts
Here are two prompts, each for executing different analysis processes.
Used Quark Script APIs/Tools that LLM used:
loadRuleUsed Quark Script APIs/Tools that LLM used:
runQuarkAnalysis,getBehaviorOccurList,getParameterValuesandisHardCodedThe
loadRule,runQuarkAnalysis,getBehaviorOccurList,getParameterValues, andisHardCodedfunctions are treated as tools within LangChain, enabling them to be invoked through thegpt-4omodel to analyze and identify CWE-798 vulnerabilities in the ovaa.apk sample.quarkScriptAgent.py.quarkScriptAgent.pyin the same folder; the LLM will automatically find files with matching names.