A static vulnerability mining intelligent agent system, method, and apparatus based on driving engineering.
By using a static vulnerability mining intelligent agent system based on driving engineering, the problems of missing context and unreachable paths in static vulnerability mining tools in large and complex projects are solved. It achieves autonomous execution and efficient vulnerability analysis, reduces false positive rate, and improves the efficiency and accuracy of static vulnerability mining.
Patent Information
- Application Number
- CN202610783508.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-02
- Publication Date
- 2026-06-30
AI Technical Summary
Existing static vulnerability discovery tools suffer from issues such as missing context, unreachable paths, and high false positive rates when dealing with large and complex projects. Furthermore, agents based on large models face problems of logical unreachability and missing context in long-chain tasks.
A static vulnerability mining intelligent agent system based on driving engineering is adopted. Through the collaborative work of the environment perception and object representation layer, execution layer, orchestration layer, memory layer, semantic management layer and security layer, a unified standardized mechanism is defined, including source-convergence point dual anchor point identification, tool access mechanism, autonomous task execution loop, layered progressive memory compression, dynamic loading of prompt words and event-driven interception verification nodes, etc., to realize the autonomous execution of the intelligent agent and the full-link logical reachability verification.
It significantly reduces the false positive rate of static vulnerability discovery, improves the efficiency of static vulnerability discovery, enables autonomous execution and full vulnerability analysis of intelligent agents in complex code projects, solves the problems of logical unreachability and missing context, and improves execution efficiency and accuracy.
Smart Images

Figure CN122310552A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology, and in particular to a static vulnerability mining intelligent agent system based on driving engineering, a static vulnerability mining method, and a static vulnerability mining device. Background Technology
[0002] Software commonly suffers from security vulnerabilities such as memory corruption, out-of-bounds access, null pointer exceptions, and permission logic flaws. These vulnerabilities pose security risks to computer systems, necessitating in-depth analysis and discovery of these vulnerabilities. Static vulnerability discovery refers to the process of identifying vulnerabilities by analyzing the code without running the target software.
[0003] Known static code vulnerability discovery tools (such as CPPCheck and Flawfinder) primarily rely on predefined rule matching or simple syntax graph scanning of project code. However, when dealing with large and complex projects, static analysis generally faces the following bottlenecks: a) Missing context. For isolated code snippets, analysis tools cannot obtain global variable initialization information or external library call logic, which can easily lead to analysis interruption; b) Unreachable path. Because these tools cannot untangle complex nested conditional branches, they cannot connect to deep logic, easily leading to a large number of false negatives. c) High false positive rate. Due to a lack of understanding of business logic constraints, these tools often mistake legitimate logic for vulnerabilities.
[0004] Compared to the aforementioned static analysis tools, some researchers have introduced Large Language Models (LLMs) to optimize and improve the efficiency of traditional vulnerability mining. They have designed vulnerability mining agents (Agent = Model + Plan + Tool + Memory) based on memory components, planning components, tool invocation components, and the LLM. However, the illusion problem in the application of LLMs, the context loss and path unreachability issues caused by data flow and control flow overflow leading to prompts in large code projects, and the agent's reliance on manual task flow characterization, human interaction within loops, and inability to autonomously execute long-chain tasks have created new technical obstacles. The logical unreachability and context loss issues involved in the autonomous execution of long-chain tasks by static vulnerability mining agents urgently need to be addressed. Summary of the Invention
[0005] The purpose of this invention is to provide a static vulnerability mining agent system, method, and apparatus that addresses all or part of the problems mentioned above, based on harness engineering technology (Agent = Model + Harness), to solve the problems of logical unreachability and missing context in the autonomous execution of long-chain tasks by the static vulnerability mining agent.
[0006] The technical solution adopted in this invention is as follows: In a first aspect, this application provides a static vulnerability mining intelligent agent system based on driving engineering, the intelligent agent system comprising cooperative components: The environmental perception and object representation layer is configured to: perform source-convergence dual anchor point identification on the target environment of the loading task request; The execution layer is configured to: define a tool access mechanism to access and schedule external tools; generate code semantic topology for candidate vulnerabilities based on source-convergence dual anchor points; and generate vulnerability confirmation reports based on successful taint propagation path backtracking. The orchestration layer is configured to: define and manage task execution modes; and define autonomous loop mechanisms for task execution to control the autonomous loop process of task execution. The memory layer is configured to define a hierarchical progressive memory compression mechanism for hierarchical compression of historical memories. The semantic management layer is configured to: define a dynamic loading mechanism for prompt words to load the minimum effective prompt word context according to task requirements; and define a progressive disclosure mechanism to disclose historical memory in layers according to task requirements. The security layer is configured to: define an event-driven interception and verification node mechanism to introduce pluggable control nodes at multiple stages of task execution through a hook mechanism; and define a tool call permission gating mechanism to restrict the agent's permissions to use tools.
[0007] Optionally, based on the source-convergence dual anchor points, the code semantic topology of candidate vulnerabilities is generated, including: Based on the source-convergence dual anchor points, forward slicing or backward slicing is performed to extract corresponding text information and grammatical information, forming the code semantic topology; wherein, for anchor points from which text information or grammatical information cannot be extracted, a defined symbolic stub mechanism is used to guide the large model to generate equivalent symbolic logic stubs.
[0008] Optional, the autonomous loop process for task execution includes five stages: thinking, acting, observing, verifying, and retrying / terminating. Thinking phase: Based on task objectives, historical memory, and current execution status, formulate the execution plan for this round, clarify the tool invocation type, execution actions, and expected results, and complete the decision-making for the execution plan; Action phase: According to the execution plan, specific actions are executed, corresponding tools are invoked, action details, tool invocation parameters and execution status are recorded and synchronized to the memory module; Observation phase: Collect the results and execution status returned by the tools in the action phase, compare them with the expected results, identify execution deviations, tool anomalies and invalid results, extract the core features of the comparison results and synchronize them to the verification phase and memory module; Verification phase: Based on the core features, verify the validity of the execution results of this round, their consistency with the task objectives, and the compliance of the tool calls, in order to determine whether it is necessary to enter the next round of loop, retry, or terminate. Retry / Termination Phase: Based on the verification results, if the task objective is not achieved but the execution is effective, return to the thinking phase, optimize the execution plan, and enter the next cycle; if the execution is ineffective, trigger the retry strategy within the set maximum retry conditions, and if the retry fails, the loop will be broken and an exception will be reported; if the task objective is achieved or the termination conditions are met, the loop will be terminated and the final result will be output.
[0009] Optionally, the hierarchical progressive memory compression mechanism is configured as follows: Historical memory is divided into three categories: original full memory, summary-level compressed memory, and structured indexed memory; among which: The original full memory is a structured historical memory; The summary-level compressed memory is compressed information obtained by compressing a portion of the original full memory; the triggering conditions for the summary-level compressed memory are: the time elapsed since the current task execution phase exceeds a predetermined time window, and / or the importance of the historical memory information is lower than a preset priority; The structured index memory is the index information of the original full memory.
[0010] Optionally, when the compression trigger condition is met, the compression intensity of the original full memory is adaptively adjusted according to the following principles: The compression rate of the original full memory is within a preset maximum compression rate threshold; Furthermore, the information retention rate of the original full memory is above a preset minimum information retention threshold.
[0011] Optionally, the hook mechanism is configured to include at least two types: pre-hooks and post-hooks; the pre-hooks and post-hooks each have predefined trigger points at multiple stages of task execution; wherein: The pre-hook is configured to: perform a safety and effectiveness assessment on the executed action; The post-hook is configured to: validate the results returned by the tool, format the output, extract key information, or decide whether to trigger subsequent steps.
[0012] In a second aspect, this application also provides a static vulnerability mining method, which is based on the aforementioned static vulnerability mining intelligent agent system based on driving engineering, and the method includes: Upon receiving a task request, the system integrates a dynamic loading mechanism for prompt words, a tool access mechanism, a tool call permission gating mechanism, an event-driven interception and verification node mechanism, and a layered progressive memory compression mechanism to initialize global constraints for task execution. Based on the aforementioned global constraints, the attack surface of the task request is located by linking the progressive disclosure mechanism, the dynamic loading mechanism of prompt words, and the autonomous loop mechanism of task execution. Based on the location-based attack surface, a dynamic loading mechanism for prompt words is used to identify source-convergence dual anchor points; based on the source-convergence dual anchor points, a code semantic topology for candidate vulnerabilities is generated; and according to a hierarchical progressive memory compression mechanism, the code semantic topology is compressed and stored in the memory module. Based on the aforementioned code semantic topology, a dynamic loading mechanism for prompt words is used to identify the complete taint propagation path; an event-driven interception and verification node mechanism is used in conjunction with a task execution autonomous loop mechanism to backtrack the taint propagation path. The linkage prompt word dynamic loading mechanism, based on the event-driven interception and verification node mechanism, performs closed-loop verification of the traced taint propagation path and generates a vulnerability verification report. The event-driven interception and verification node mechanism is used to verify the task termination condition; the entire process data of the task execution is extracted from the memory module to generate a final task result report containing the vulnerability confirmation report; the final task result report is verified through the event-driven interception and verification node mechanism to obtain a final task result report that passes the verification.
[0013] Optionally, initialize global constraints for task execution, including: Analyze the task request and extract the core parameters; A dynamic loading mechanism for prompt words is implemented to load static kernel-level prompt words and guide the large model to initialize global control rules. The integration mechanism for collaborative tools and the tool access permission gating mechanism initialize three-level permission isolation rules based on task type and risk level: Level 1 isolation rule: Lock the global tool whitelist and only allow non-intrusive tools; Level 2 isolation rules: Configure task scenario permission gating and disable intrusive tools; Level 3 isolation rule: Initialize dynamic permission gating for the session and reserve an entry point for permission upgrade approval in subsequent stages; A linkage event-driven interception and verification node mechanism is implemented, and a global control node is registered throughout the entire process. Initialize the memory module and the hierarchical compression rules of the hierarchical progressive memory compression mechanism.
[0014] Optionally, the attack surface for locating the task request includes: Based on the aforementioned global constraints, a progressive disclosure mechanism, a dynamic loading mechanism for prompt words, and a self-governing loop mechanism for task execution are linked to load the top-level meta-information of the task request; The linkage prompt word dynamic loading mechanism loads dynamic scene layer prompt words to guide the large model to delineate potential attack surfaces based on the top-level meta information and form a pre-positioning list of attack surfaces. Load the index information of the corresponding directory in the attack surface pre-location list to guide the large model to locate the attack surface data corresponding to the potential vulnerability source anchor point, and form a high-priority analysis object list. The collaborative task execution autonomous loop mechanism verifies the list of high-priority analysis objects. If the identified attack surface fails the verification, a loop retry is triggered to reload the top-level metadata and re-form the list of high-priority analysis objects for analysis. If the verification still fails after reaching the maximum retry condition, an abnormal circuit breaker is triggered to terminate the process. If the verification passes, the identified attack surface is retained.
[0015] In a third aspect, this application also provides a static vulnerability mining apparatus, which includes a processor and a storage medium; the storage medium stores a computer program, and the processor runs the computer program to perform the above-described static vulnerability mining method.
[0016] In summary, due to the adoption of the above technical solution, the beneficial effects of the present invention are: 1. This application constructs a multi-layered collaborative static vulnerability mining intelligent agent system, defines a unified standardized mechanism, adopts intelligent agent technology to improve the efficiency of static vulnerability mining, significantly reduces the false positive rate of static vulnerability mining, strengthens the automated loop of static vulnerability mining discovery, analysis, and verification, and specifically solves the problems of "logical unreachability" and "missing context" in long-chain static vulnerability mining and analysis tasks through standard logic design such as dual-end taint anchoring, symbolic logic stub completion, and full-link logic reachability verification.
[0017] 2. The intelligent agent task execution process design in this application does not rely on fixed vulnerability analysis rules, but only builds a standardized information supply chain and behavior control system, which can adapt to the continuous iteration of large model capabilities.
[0018] 3. Based on the constraints of the intelligent agent's task execution in the context of driving engineering, this application forms a strict control system of "pre-execution verification - in-execution control - post-execution audit" through the design of memory compression mechanism, progressive disclosure mechanism and event-driven interception verification node mechanism, which greatly suppresses the problems of context overflow, unconstrained operation, high error rate and model illusion in the execution process of intelligent agents.
[0019] 4. This application deeply integrates an autonomous loop architecture, enabling intelligent agents to autonomously advance tasks, autonomously handle anomalies, and autonomously optimize strategies. It can complete full vulnerability analysis of complex code projects without human intervention, significantly improving execution efficiency. Attached Figure Description
[0020] The present invention will be described by way of example and with reference to the accompanying drawings, wherein: Figure 1 This is a structural diagram of a static vulnerability mining intelligent agent system based on driving engineering.
[0021] Figure 2 This is a flowchart of the implementation of static vulnerability discovery methods.
[0022] Figure 3 This is a data flow diagram of the implementation of static vulnerability discovery methods. Detailed Implementation
[0023] All features disclosed in this specification, or all steps in all disclosed methods or processes, may be combined in any way, except for mutually exclusive features and / or steps.
[0024] Any feature disclosed in this specification (including any appended claims and abstract) may be replaced by other equivalent or similar features, unless specifically stated otherwise. That is, unless specifically stated otherwise, each feature is merely one example of a series of equivalent or similar features.
[0025] Current known static vulnerability discovery tools generally suffer from issues such as missing context, unreachable paths, and high false positive rates when dealing with large and complex project code. Furthermore, existing static vulnerability discovery agents optimized using large models still exhibit these problems, in addition to the continued issues of missing context and unreachable paths. They also generally rely on manual task flow characterization, manual interaction within loops, and the inability to autonomously execute long-chain tasks. To address this, this application proposes a static vulnerability discovery agent system, method, and apparatus based on a mastering engineering architecture. This aims to effectively solve the problems of logical unreachability and missing context in the autonomous execution of long-chain tasks by static vulnerability discovery agents, achieving controllable and efficient operation of the agent. Simultaneously, a reusable framework is built to improve the agent's engineering level and scenario adaptability.
[0026] The static vulnerability mining agent system disclosed in this application proposes a layered agent architecture based on driving engineering. It systematically decomposes the system from the underlying infrastructure to the upper-level vertical domain applications, forming six core functional layers. Each layer follows the principle of separation of concerns and collaborates through standardized interfaces to achieve the controllable release and engineering implementation of agent capabilities. The agent guides a large model to execute corresponding actions to complete the static vulnerability mining of user task requests.
[0027] like Figure 1 As shown, the static vulnerability discovery intelligent agent system based on driving engineering includes: (1) Environmental perception and object representation layer.
[0028] The environment perception and object representation layer is configured to perform source-convergence dual anchor point identification on the target environment of the loading task request.
[0029] The environmental perception and object representation layer enables the intelligent agent to adaptively perceive the target scene in conjunction with the user's task request, so as to supplement background information for subsequent task execution.
[0030] For static vulnerability discovery scenarios, the environment awareness and object representation layer is configured with the following mechanisms: Deep code semantic analysis: Based on a layered, progressive memory compression mechanism and a progressive disclosure mechanism, the large model is guided to locate potential attack surfaces and potential vulnerability sources (i.e., source anchors) such as memory management, authentication logic, and user input through readme documents, configuration files, package names, and file names, providing anchors for backward slicing. Static analysis tools are invoked to identify dangerous functions (sinks) (i.e., sink anchors), providing anchors for forward slicing.
[0031] (2) Execution layer.
[0032] The execution layer is configured to: define a tool access mechanism for accessing and scheduling external tools; generate the code semantic topology of candidate vulnerabilities based on source-convergence point dual anchors; and generate a vulnerability confirmation report based on successful taint propagation path backtracking.
[0033] The execution layer is responsible for the access and scheduling of external tools. This layer is oriented towards the task flow, forming customized functional modules for the static vulnerability mining agent.
[0034] The mechanisms defined in the execution layer mainly include: Tool Access Mechanism. Static vulnerability discovery agents frequently need to call various domain-specific tools, including static analysis tools, system command tools, custom tools, and third-party interfaces. The Model Context Protocol (MCP) and Skills are used to address the issues of "how to access, how to describe, and how to invoke" these tools. For example, the tools that a static vulnerability discovery agent needs to access include Codeql, CppCheck, Treesitter, and Joern, which are accessed through MCP and Skills.
[0035] A candidate vulnerability semantic topology extraction mechanism is implemented. Based on a source-convergence dual-anchor point system, a code semantic topology for candidate vulnerabilities is generated. Specifically, based on the source-convergence dual-anchor point system, forward or backward slicing is performed to extract corresponding textual and syntactic information, such as natural language annotation semantics, function names, parameter names, abstract syntax trees (ASTs), data flow graphs (DFGs), and control flow graphs (CFGs), forming a code semantic topology for further analysis by larger models.
[0036] Symbolic stub mechanism. During code semantic topology generation, for anchor points from which textual or syntactic information cannot be extracted, the large model is guided to generate equivalent symbolic logical stubs. For example, during code semantic topology generation, encountering an external call without source code (such as a library function, kernel system call, or undefined interface) would interrupt the extraction of textual or syntactic information. By designing a symbolic stub mechanism, for missing third-party library functions, the large model is guided to analyze the call context and generate equivalent symbolic logical stubs, allowing the extraction process to continue in a "logically complete" manner.
[0037] Vulnerability verification and evidence chain synthesis mechanism. For successful taint propagation path backtracking, the large model is guided to generate pseudocode trigger vectors that satisfy logical constraints, serving as a vulnerability verification report proving the existence of the vulnerability.
[0038] (3) Arrangement layer.
[0039] The orchestration layer is configured to: define and manage task execution modes; and define autonomous loop mechanisms for task execution to control the autonomous loop process of task execution.
[0040] As the core scheduling hub for intelligent agents to execute tasks, the orchestration layer is responsible for defining and managing the task execution modes of intelligent agents, covering execution scheduling scenarios such as single-agent autonomous closed-loop execution, multi-agent concurrent execution, and collective intelligent collaborative execution.
[0041] The mechanisms defined by the orchestration layer include: Swarm intelligence mechanism. Based on swarm intelligence theory, it deeply simulates the self-organizing and collaborative paradigm of social organisms such as bee colonies and ant colonies. Through simplified behavioral rules, local information interaction and autonomous decision-making among agents, it realizes the emergence of collective wisdom under global task objectives. It is the core orchestration mechanism that supports decentralized collaboration, adaptive evolution and the achievement of high-order task objectives that cannot be achieved by a single agent in complex dynamic scenarios.
[0042] As an optional implementation, the agent swarm intelligence mechanism is configured with an ant colony algorithm, replicating the spontaneous role evolution logic of scout ants, worker ants, and soldier ants in an ant colony. Each agent, based on its own capability profile, global task objectives, and real-time task progress of the swarm, autonomously claims task segments, dynamically switches and adapts to its role, spontaneously fills task gaps, avoids execution conflicts, and defines a role semantic space. K represents the total number of character types. k Index for character type, For the first k Types of roles, intelligent agents ( (For agent indexing) in Probability of character selection at any given moment Following the logic of self-differentiation, ,in, Represents intelligent agents The historical cumulative reward is used to measure the agent's historical performance in the corresponding role; , indicating the current task ( t The completion phase of (moment); Represents intelligent agents exist t The semantic authentication state vector under the autonomous loop, with the superscript c as the cognitive state identifier, represents the comprehensive state formed by the agent based on the global task, execution environment, situation, etc., and the cognitive state. From memory state Corresponding historical memory information and current perceptual information are combined to form a cognitive state. After this round of execution and verification, the data is updated and stored in the memory state. Simulating the low-redundancy information interaction mode of ant colony pheromones and bee colony figure-eight dance, a local information sharing bus is built. Each agent only transmits three types of extremely simple information: core task status, environmental perception signals, and action feedback results, rather than full context data. While avoiding information redundancy, global policy convergence is achieved based on a group consensus threshold. Interactive neighborhood , A collection of intelligent agents, i.e. Time and A set of intelligent agents that exchange information, where the exchange information is a semantic embedding vector, defined as follows: ( d (Pheromone dimension) is the global pheromone matrix for swarm intelligence of agents. Each row corresponds to an agent's memory embedding vector. The update rule corresponds to the ant colony pheromone update formula and is also compatible with the memory compression mechanism.
[0043] ; In the formula, Indicates the memory update rate. The smaller the group, the stronger the preservation of their historical memory. m Indicates the memory state identifier. For intelligent agents in t The individual memory state vector after memory compression under the autonomous loop, memory state cognitive state Provide historical experience support, cognitive state The result is a reverse iteration to update the memory state Simulating the resilience of social biological populations, the failure of a single agent, abnormal interruption, or policy deviation will not cause the global task to stagnate or fail. Criteria for vulnerability discovery and intelligent emergence, and the maximum task completion capability of a single agent. Group global task completion capability The two capabilities are quantified by the number of vulnerabilities discovered. Then it is determined that intelligence emerges.
[0044] Autonomous Loop Mechanism for Task Execution. Enabling autonomous loop process control for intelligent agent task execution is the core support for ensuring that intelligent agents can continuously advance task objectives, handle execution anomalies, optimize execution strategies, and avoid task interruptions, ineffective execution, and logical disconnections in multi-step, complex scenarios.
[0045] As an optional implementation method, the autonomous loop process of task execution includes five stages: thinking, action, observation, verification, and retry / termination. Through a linkage event-driven interception and verification node mechanism, the autonomous loop execution of the agent is realized.
[0046] Thinking phase: Based on the task objectives, historical memory and current execution status, formulate the execution plan for this round, clarify the tool call types, execution actions and expected results, and complete the decision-making for the execution plan.
[0047] Action phase: According to the execution plan, perform the corresponding specific actions, call the corresponding types of tools, record the action details, tool call parameters and execution status, and synchronize them to the memory module.
[0048] Observation phase: Collect the results and execution status returned by the tools in the action phase, compare them with the expected results, identify execution deviations, tool anomalies and invalid results, extract the core features of the comparison results (i.e. the identified execution deviations, tool anomalies and invalid results) and synchronize them to the verification phase and memory module.
[0049] Verification Phase: Based on the above core characteristics, verify the validity of the execution results of this round, their alignment with the task objectives, and the compliance of the tool calls, in order to determine whether it is necessary to enter the next round of the loop, retry, or terminate.
[0050] Retry / Termination Phase: Based on the verification results, if the task objective is not achieved but the execution is effective, return to the thinking phase, optimize the execution plan, and enter the next loop; if the execution is ineffective, trigger the retry strategy within the set maximum retry condition (e.g., a maximum of 3 retries, which can be customized); if the retry fails, the loop will be broken and an exception will be reported; if the task objective is achieved or the termination condition is met, the loop will be terminated and the final result will be output.
[0051] In one feasible implementation, a Deterministic Finite Automaton (DFA) is used to formally define the five-stage autonomous loop process. The autonomous loop state is defined as a quintuple: , where the set of states These correspond to six states: thinking, acting, observing, verifying, retrying, and terminating. Initial state. Enter the alphabet , representing the current state in sequence. Historical memory Tool Return Results Validity verification mark Current number of retries State transition function ; Set of Termination States , Refers to the termination state; the current autonomous loop terminates only when this termination state is entered.
[0052] (4) Memory layer.
[0053] The memory layer is configured to define a hierarchical progressive memory compression mechanism for hierarchical compression of historical memory; In the execution of intelligent agent tasks involving long processes, multiple steps, and multiple tool calls, the intelligent agent needs to continuously perceive historical behaviors, tool outputs, task status, contextual constraints, and phased conclusions to ensure that the task logic is coherent, the decisions are consistent, and the execution is traceable.
[0054] The mechanisms defined by the memory layer include: A hierarchical, progressive memory compression mechanism is proposed. Current known memory mechanisms use full storage, which suffers from problems such as linear expansion of the original memory size, high information redundancy, and the burying of key information as task execution steps increase, tool calls increase, and interaction rounds become longer. In this application, a memory compression mechanism is defined based on the existing memory mechanism to achieve hierarchical compression of historical memory. The original memory is structured, lightweighted, and redundancy-removed, significantly reducing the memory size while retaining core information, thus ensuring the long-term stable execution of the agent.
[0055] In one alternative implementation, the hierarchical progressive memory compression mechanism is configured as follows: Historical memory is divided into raw full memory, summary-level compressed memory, and structured indexed memory, for use in audit backtracking, contextual input, and rapid retrieval, respectively. Automatic summary compression is triggered in stages based on execution rounds and data length, removing redundant information, merging similar results, and extracting core states and conclusions.
[0056] The original full memory is historical memory that has undergone structured processing. Unstructured text is transformed into structured task status, key data, and tag information to increase information density.
[0057] Summary-level compressed memory involves compressing a portion of the original full memory. This means it doesn't compress the entire original full memory, but rather retains only a portion of the complete data while compressing the rest. The conditions triggering summary-level compressed memory are: the time elapsed since the current task execution exceeds a predetermined time window, and / or the importance of historical memory information is lower than a preset priority. In other words, original full memory that is too far removed from the current moment (exceeding the predetermined time window) and / or has low information importance (below the preset priority) is compressed, while original full memory that is within the predetermined time window or has high information importance (reaching the preset priority) is retained.
[0058] Structured index memory is the index information of the original full memory.
[0059] For example, a sliding window strategy is employed, where a predetermined time window defines the latest original full memory. Recent memory data within the sliding window is fully preserved, while earlier memories outside the window are compressed, retaining only the summary-level compressed memory and its corresponding index information, achieving gradual forgetting with finer details for recent memories and coarser details for older memories. The sliding window gradual compression task is configured to execute in rounds. The current execution round is The sliding window size is Then the gradual forgetting strategy of near-fine and far-coarse is satisfied: , (indicating the first) i The original full memory of the round trip is completely preserved. Only retain (indicating the first) i The original full memory of the round traversal is compressed into a summary-level compressed memory. (indicating the first) i The index information of the original full memory of the round traversal.
[0060] In addition, the original full memory can be prioritized according to the importance of the information. The original full memory with high priority (reaching the preset priority) is forcibly retained (which can include memories outside the sliding window, or not). The original full memory with low priority (below the preset priority) is preferentially compressed or discarded (which can include memories within the sliding window, or not).
[0061] Furthermore, as an optional implementation, when the compression trigger condition is met (i.e., partial compression of the original full memory), the compression intensity of the original full memory is adaptively adjusted according to the following principles: 1) The compression rate of the original full memory is within the preset maximum compression rate threshold.
[0062] Define the original full memory as Its size is expressed as After summarization-level memory compression, the memory representation is as follows: Its size is expressed as Compression ratio 。
[0063] 2) The information retention rate of the original full memory is above the preset minimum information retention threshold.
[0064] The information entropy of the original full memory is represented as: The information entropy of compressed memory is represented as Information retention rate .
[0065] In this application, memory compression must satisfy the double threshold constraint principle, defining a minimum information retention threshold. and the maximum compression ratio threshold ,Require .
[0066] (5) Semantic management layer.
[0067] The semantic management layer is configured to: define a dynamic loading mechanism for prompt words to load the minimum effective prompt word context based on task requirements; and define a progressive disclosure mechanism to disclose historical memory in layers based on task requirements.
[0068] The semantic management layer is responsible for the generation and management of prompt words.
[0069] The mechanisms defined by the semantic management layer include: Dynamic Prompt Loading Mechanism. Addressing the issue that current intelligent agents hard-coded prompts cannot dynamically adapt to task scenarios, this application defines a dynamic prompt loading mechanism. Prompts are layered into a static kernel layer, a dynamic scenario layer, a tool constraint layer, and a security verification layer. The specific responsibilities, execution actions, and essential differences of each layer are as follows: Static kernel layer prompts are the globally fixed, always-present underlying constraints for the intelligent agent, unchanging with task stages or scenario changes. Their core defines the agent's basic role positioning, overall task objectives, general behavioral guidelines, global security red lines, basic inference paradigms, and overall output format specifications. They provide the underlying operating foundation for the entire intelligent agent, ensuring the model does not deviate from the overall task direction. They are universal constraints for all tasks and do not contain any scenario-specific logic. Dynamic scenario layer prompts are scenario-specific constraints that dynamically switch with task stages, vulnerability types, and operating environments. They are loaded in stages as needed, updating the corresponding prompt content as the task enters a new phase. Its core is to match the business logic of the current stage, such as attack surface location rules and taint analysis requirements in the vulnerability discovery stage; Tool constraint layer prompts: These are specific constraints for specific tool invocation behaviors, loaded only momentarily before the agent initiates a tool invocation and unloaded after the invocation ends. Its core is to define tool invocation formats, parameter specifications, input and output requirements, invocation frequency limits, whitelist constraints, syntax specifications, and tool return result parsing rules. For example, dedicated instructions when invoking CodeQL, Treesitter, symbolic execution engines, and sandbox verification tools. This standardizes tool invocation behavior, avoiding illegal invocations, incorrect parameters, and tool abuse, and standardizing the interaction between the agent and external tools; Security verification layer prompts: These are security-related constraints for risk control, behavior auditing, and result compliance verification, dynamically injected according to the current risk level, and forcibly loaded at key nodes such as decision output, payload generation, and vulnerability confirmation. Its core is to impose compliance constraints on the model's output content, forcibly verify the rationality of the results, and limit the agent from exceeding security boundaries. This controls the agent's output and behavior from a security perspective, achieving constrained behavior, verifiable results, and controllable risks. During task execution, the intelligent agent triggers the loading, splicing, and injection of corresponding level modules in real time based on one or more of the task requirements corresponding to the current task stage, tool call type, risk level, and scenario characteristics. This forms a minimum effective prompt word context, avoids attention dilution, reduces prompt word redundancy, strengthens behavioral constraints, and improves the accuracy of task execution at the corresponding stage.
[0070] Progressive disclosure mechanism. Due to the context length limitations of large models, when dealing with some large-scale code projects or long-chain task execution, the accumulated historical context (historical memory) may be too long and passively truncated, leading to task execution failure. Therefore, in managing the context management mechanism of the engineering architecture, a progressive disclosure mechanism needs to be introduced. That is, information / code / tool capabilities are not input all at once, but are acquired on demand and unfolded in layers, following the process of gradual exposure and parsing of "single clue, complete subject, and in-depth analysis".
[0071] During the incremental disclosure process, the hard constraint on context length is: Let the first k After each round of disclosure, the total cumulative context length is It must satisfy: ; in, For the first i The layer prompts actually load a subset of information, only loading content relevant to the current analysis objective, rather than loading the entire set of information. for Length; For the first i The information set defined by the layer prompt words; This represents the maximum allowed context length for a large model.
[0072] The progressive disclosure mechanism imposes time constraints on tiered disclosure: information can only be loaded after the analysis and verification of the previous layer has passed. EnableLoad The next layer of information. Satisfies the temporal implication condition: ; in, This represents the validity check function, and the check result is... True or False .
[0073] By employing a progressive disclosure mechanism and its timing constraints, the context overflow problem caused by injecting all code at once is completely avoided, while ensuring the logical accuracy of task execution.
[0074] (6) Security layer.
[0075] The security layer is configured to: define an event-driven interception and verification node mechanism to introduce pluggable control nodes at multiple stages of task execution via hooks; and define a tool call permission gating mechanism to restrict the agent's permissions to use tools.
[0076] The security layer is responsible for the security monitoring of the intelligent agent system, including performance monitoring, status monitoring, task monitoring and event monitoring, to achieve real-time perception of the system's operating status and timely response to abnormal events.
[0077] The mechanisms defined by the security layer include: Event-driven interception and verification node mechanism. In the task execution process of the intelligent agent, control nodes with interception, verification, control and auditing functions are inserted based on specific event triggers (such as task reception, tool invocation, result output, state change). Their role is to respond to corresponding events before / after the intelligent agent performs specific actions, complete permission verification, dangerous behavior interception, log auditing or result correction, and realize fine-grained control of the intelligent agent.
[0078] Specifically, the event-driven interception verification node mechanism introduces pluggable control nodes at multiple stages of task execution through a hook mechanism.
[0079] As a specific implementation method, a single hook can be defined as a quadruple: , For the defined set of hooks; where, , indicates the trigger event of the hook, which is activated only when the event occurs; , indicating a triggering conditional predicate, , S Indicates the task state of the intelligent agent s The set, , This refers to a system atomic event that can trigger the hook's execution. e A set; Indicates to s Trigger? e The verification result is only when When this happens, the hook function is triggered to process the logic; , represents the core processing function of the hook. The input objects for the hook (such as tool call requests, context, model output, task schedules, etc.). The processed output object; , which represents the action to be performed by the hook, corresponding to allow, block, rewrite, and circuit breaker for exceptions.
[0080] In one alternative implementation, the hook mechanism is configured to include at least two types: pre-hook and post-hook, both of which can be defined as the quadruple form described above.
[0081] The pre-hook is configured to perform a safety and effectiveness assessment on the actions (of the agent). Examples include restricting high-risk system calls, filtering irrelevant analysis paths, performing security checks, or modifying task schedules.
[0082] The post-hook is configured to: validate the results returned by the tool, format the output, extract key information, or determine whether to trigger subsequent steps.
[0083] In addition, the vulnerability pattern library can be dynamically injected through the hook mechanism, enabling the system to adapt to different types of security analysis strategies in different tasks.
[0084] Pre-hooks and post-hooks have predefined trigger points at multiple stages of task execution, including but not limited to before task planning, before context building, before model inference, before and after tool invocation, and before result output, thereby introducing control nodes.
[0085] The definition of the event-driven interception and verification node mechanism enables the system to achieve external governance of agent behavior without modifying the model itself. It introduces pluggable control nodes into the agent execution process to achieve dynamic scheduling and policy intervention throughout the entire task execution process.
[0086] Through a defined hook mechanism, all hooks form a built-in unified event-driven interception and verification bus, integrating all event-driven interception and verification nodes to achieve centralized global management. These nodes include permission verification nodes, behavior auditing nodes, danger interception nodes, anomaly circuit breaker nodes, result verification nodes, and global verification nodes. All actions, tool calls, and state changes of the intelligent agent trigger corresponding events, which are then managed by the bus-scheduled relevant interception and verification nodes, ensuring that the intelligent agent operates within the security boundary.
[0087] Tool Invocation Permission Gating Mechanism. A tool invocation permission gating mechanism is introduced to constrain the permissions of intelligent agents to use tools. This mechanism constrains and controls the behavior of intelligent agents using tools, establishing tool permission isolation through three levels of permission isolation rules: global tool whitelist gating, task scenario permission gating, and session dynamic permission gating, thereby blocking high-risk behaviors at the source.
[0088] The aforementioned static vulnerability mining intelligent agent system improves the efficiency of static vulnerability mining, significantly reduces false positives, strengthens the automated loop of static vulnerability discovery, analysis, and verification, and addresses issues such as "logical unreachability" and "missing context" in long-chain static code task analysis through dual-end taint anchoring and full-link logical reachability verification.
[0089] Furthermore, the design of the intelligent agent task execution process does not rely on fixed vulnerability analysis rules, but only builds a standardized information supply chain and behavior control system, which can adapt to the continuous iteration of large model capabilities.
[0090] Based on the constraints of the intelligent agent's task execution under the protection of the driving engineering, a control logic of "pre-execution verification - in-execution control - post-execution audit" is formed through the design of memory compression mechanism, progressive disclosure mechanism and event-driven interception verification node mechanism. This greatly avoids problems such as context overflow, unconstrained operation, high error rate and model illusion in the intelligent agent task execution process.
[0091] The system incorporates a deeply integrated autonomous loop architecture, enabling intelligent agents to autonomously advance tasks, autonomously handle anomalies, and autonomously optimize strategies. It can complete full vulnerability analysis of complex code projects without human intervention, significantly improving execution efficiency.
[0092] Based on the ideas of this application, this embodiment also proposes a static vulnerability mining method based on the aforementioned system. This method adheres to the prediction that core capabilities such as vulnerability taint propagation path analysis, semantic analysis, and vulnerability verification will continuously improve and achieve breakthroughs autonomously with the iteration of large-scale model technology. Therefore, the core design goal of the task flow is not to construct a fixed vulnerability analysis logic, but rather to rely on the engineering system to build a precise, orderly, and lightweight information supply chain. This chain completely and compliantly transmits all-domain related information, including code semantics, semantic topology, historical memory, and tool output, to the large-scale model, providing sufficient data support for the model to exercise its autonomous reasoning and decision-making capabilities. Simultaneously, process standardization ensures the controllability and efficiency of information supply, enabling the task execution logic to adapt to the continuous evolution of the large-scale model's capabilities. Compared to the traditional technical path of vulnerability mining through hard-coded complex rules and fixed analysis logic, this method possesses stronger scalability and engineering practicality.
[0093] The task execution process of static vulnerability discovery is based on the core logic of global constraint pre-positioning, progressive information disclosure, full-link behavior control, autonomous closed-loop execution, and standardized output of results. It is linked to the event-driven interception and verification node mechanism, prompt word dynamic loading mechanism, progressive disclosure mechanism, layered progressive memory compression mechanism, task execution autonomous loop mechanism, tool invocation mechanism, and tool invocation permission gating mechanism, etc., which drive the engineering framework throughout the process. It breaks down the entire static vulnerability discovery process into multiple progressive, loop-iterable, and globally controllable execution stages, forming a standardized execution link that is end-to-end closed-loop, fully traceable, and reusable in multiple scenarios.
[0094] like Figure 2 , Figure 3 As shown, the static vulnerability discovery method includes the following stages: S1, Task initialization and global constraint injection phase.
[0095] In the S1 phase, task requests are received, and the dynamic loading mechanism of prompt words, the tool access mechanism, the tool call permission gating mechanism, the event-driven interception and verification node mechanism, and the layered progressive memory compression mechanism are linked to initialize the global constraints for task execution.
[0096] Phase S1 is the initial stage of task execution. The core objective of this stage is to complete global constraints such as defining task boundaries, injecting global control rules, and initializing the runtime environment, so as to solve the problems of unclear constraints, lack of unified scheduling, and ambiguous security boundaries when starting intelligent agent tasks from the source.
[0097] As an optional implementation, the method for initializing the global constraints of task execution in phase S1 includes the following steps: S101. Receive and parse the task request, and extract the core parameters.
[0098] The extracted core parameters may include the target code address, task type (e.g., general vulnerability mining, targeted mining of specific CWE type vulnerabilities, compliance audit, etc.), risk control level, task termination conditions, output specifications, and other core elements.
[0099] S102, Linked prompt word dynamic loading mechanism, loads static kernel layer prompt words, guides the large model to initialize global control rules.
[0100] Load static kernel layer prompts to clarify the overall task objective, agent behavior red lines, output format specifications, vulnerability assessment benchmark rules, etc., in order to build the underlying constraints for task execution.
[0101] S103, the linkage tool access mechanism and tool call permission gating mechanism, based on task type and risk level, initialize three-level permission isolation rules.
[0102] As mentioned in the previous embodiments, in one optional implementation, the tool call permission gating mechanism defines three levels of permission isolation rules: global tool whitelist gating, task scenario permission gating, and session dynamic permission gating. Specifically: Level 1 isolation rule: Lock the global tool whitelist and only allow non-intrusive tools; Level 2 isolation rules: Configure task scenario permission gating and disable intrusive tools that perform high-risk operations such as system command execution and file writing; Level 3 isolation rule: Initialize dynamic permission gating for the session and reserve an entry point for permission upgrade approval in subsequent stages.
[0103] It should be noted that the above three-level isolation rules do not have a strict hierarchical division.
[0104] S104, a linkage event-driven interception and verification node mechanism, registers a global control node for the entire process.
[0105] Taking the control nodes defined above as an example, the registered global control nodes include permission verification nodes, behavior auditing nodes, danger interception nodes, exception circuit breaker nodes, result verification nodes, and global verification nodes. The responsibilities and specific tasks of these nodes are as follows: Permission verification nodes are responsible for the pre-verification process before the agent initiates tool calls, executes system operations, or switches session permissions. This is based on a three-level gating rule system using a global tool whitelist, task scenario permissions, and dynamic session permissions to verify whether the current agent has the corresponding operation permissions. Behavior auditing nodes are responsible for the entire process accompanying any action of the agent before, during, and after execution. This includes collecting all behavioral data such as the agent's decision-making behavior, tool call records, parameter configurations, context changes, intermediate outputs, and retry behaviors. Danger interception nodes are responsible for decision-making before high-risk behaviors are executed. The system comprises several key components: a pre-hooked node to directly block dangerous actions and output risk warnings; an anomaly circuit breaker node to handle scenarios such as tool call failures, unsolvable constraints, failed bypass strategies, excessive retries, context overflows, and logical infinite loops; a result verification node to validate the output of each stage for validity, completeness, logical consistency, format, and constraint satisfaction; and a global verification node to coordinate task initialization and cross-stage consistency validation, ensuring full-process control and guaranteeing that the overall task direction remains on track, actions do not exceed limits, and results are compliant and reliable. These control nodes ensure that all agent actions, tool calls, and state changes throughout the task's lifecycle are under centralized management.
[0106] S105. Initialize the memory module and the hierarchical compression rules of the hierarchical progressive memory compression mechanism.
[0107] In step S105, based on the defined hierarchical progressive memory compression mechanism, a task-specific memory partition is created, dividing the memory into three types of storage units: original full memory, summary-level compressed memory, and structured index memory, thus completing the memory module initialization. Preset memory compression trigger thresholds, sliding window strategies (such as size and step size), and information priority rules to complete the hierarchical compression rule setting. Read-only image loading of the target code asset is then completed, isolating the original asset from the analysis environment and preventing modifications to the original code during the analysis process.
[0108] In addition, step S106 can be set in stage S1 to complete the pre-verification of task legality.
[0109] S106. Through the defined event-driven interception verification node mechanism (such as pre-hooks), compliance verification is performed on the task input parameters, target asset accessibility, and control rule integrity. If the verification fails, the task is terminated directly and the reason for the exception is reported. If the verification passes, the global constraint rules are locked and the next execution stage is entered, and unauthorized rule changes are prohibited throughout the process.
[0110] S2, Code Asset Layered Indexing and Attack Surface Pre-positioning Phase.
[0111] In the S2 phase, based on the initial global constraints, the attack surface of the task request is located by linking the progressive disclosure mechanism, the dynamic loading mechanism of prompt words, and the autonomous loop mechanism of task execution.
[0112] The core objective of the S2 phase is to leverage the progressive disclosure mechanism to accurately define the attack surface from macro-architecture to micro-modules, addressing the core issues of large model context overflow, attention dilution, and inaccurate attack surface localization caused by a one-time input of all code, thus locking in the minimum effective scope for subsequent vulnerability analysis.
[0113] As an optional implementation, the method for locating the attack surface of a task request in phase S2 includes the following steps: S201. Based on global constraints, the top-level meta-information of the task request is loaded by linking the progressive disclosure mechanism, the dynamic loading mechanism of prompt words, and the autonomous loop mechanism of task execution.
[0114] In step S201, the hierarchical and progressive disclosure principle of "single clue - complete subject - in-depth analysis" is strictly followed. In the first round, only the top-level meta information of the target code project (i.e., task request) is loaded, including readme document, project configuration file, directory structure, package dependency list, external interface list, etc. No business code files are loaded to control the context size to the maximum extent.
[0115] S202, Linked prompt word dynamic loading mechanism, loads dynamic scene layer prompt words, guides the large model to delineate potential attack surfaces based on top-level meta information, and forms a pre-positioning list of attack surfaces.
[0116] Step S202 is responsible for project architecture analysis and initial attack surface screening. Through a dynamic loading mechanism of prompt words, dynamic scene-level prompt words are injected to guide the large model to complete project architecture layering, business logic sorting, and technology stack identification based on top-level meta information, and to delineate potential attack surfaces, including user-controllable input entry points, identity authentication modules, memory management modules, core data processing logic, and third-party component interaction interfaces, forming a pre-positioned list of attack surfaces.
[0117] S203. Load the index information of the corresponding directory in the attack surface pre-location list, guide the large model to locate the attack surface data corresponding to the potential vulnerability source anchor point, and form a list of high-priority analysis objects.
[0118] Step S203 is responsible for fine-grained attack surface convergence. Based on the verified attack surface pre-location list, a second-level progressive disclosure is performed, loading only the index information of the corresponding directories in the list (such as file names, function name lists, function signatures, etc.), rather than the full code content. This guides the large model to further narrow the analysis scope, locate the target files and core functions corresponding to potential vulnerability sources, and form a list of high-priority analysis objects.
[0119] S204. The autonomous loop mechanism of the linked task execution verifies the list of high-priority analysis objects. If the verification of the located attack surface fails, a loop retry is triggered to reload the top-level metadata and re-form the list of high-priority analysis objects for analysis. If the verification still fails after the maximum retry condition is reached, an abnormal circuit breaker is triggered to terminate the process. If the verification passes, the located attack surface is retained.
[0120] Step S204 is responsible for autonomous loopback verification. The linked task executes the autonomous loopback mechanism. If the attack surface location result does not have a clear high-risk area or is inconsistent with the project architecture logic, it means that the verification fails. In this case, a loopback retry is triggered, the project metadata is reloaded to optimize the parsing strategy, and a new list of high-priority analysis objects is formed for analysis. The maximum number of retries is 3 (which can be modified). If all 3 retries fail, an exception circuit breaker is triggered, the task exception is reported, and the process is terminated. If the verification passes, the located attack surface is retained, and the process proceeds to the next stage.
[0121] S3, Vulnerability Anchor Point Dual-End Identification and Semantic Topology Construction Stage.
[0122] In Phase S3, based on the location-based attack surface, a dynamic loading mechanism for prompt words is used to identify source-convergence dual anchor points. Based on these dual anchor points, a code semantic topology for candidate vulnerabilities is generated. Using a layered, progressive memory compression mechanism, the code semantic topology is compressed and stored in the memory module.
[0123] The core objective of the S3 phase is to complete the locking of dual-end anchor points and the construction of code semantic topology for vulnerability analysis. It also uses a symbolic stub mechanism to address the pain points of interrupted slicing process, incomplete semantic information extraction, and broken context logic caused by external calls, thus providing a complete semantic foundation for subsequent taint path backtracking.
[0124] In one alternative implementation, stage S3 includes the following steps: S301, Source-Convergence Dual Anchor Point Identification.
[0125] Based on the high-priority analysis objects locked in the S2 phase, a "source-convergence point dual-end parallel anchoring" strategy is adopted. On the one hand, through a prompt word dynamic loading mechanism, prompt words are injected into the tool constraint layer to guide the large model to call static analysis tools (CodeQL, CppCheck, etc.) within the permission gating, and identify dangerous functions (Sink) within the target range, including memory operation functions, string processing functions, system call functions, etc., forming a Sink anchor list (i.e., a convergence point anchor list). On the other hand, based on the pre-positioned potential vulnerability source points (Source), the Source anchor points that can be controlled by the user (i.e., source anchor points) are locked, forming a Source anchor list.
[0126] S302, Semantic topology extraction of candidate vulnerabilities.
[0127] Based on an effective source-convergence dual-anchor list, targeted program slicing is performed: forward slicing is executed for each Sink anchor, and backward slicing is executed for each Source anchor. During the slicing process, textual and syntactic information such as natural language annotation semantics, function names, parameter names, abstract syntax trees, data flow graphs, and control flow graphs are extracted simultaneously to construct the code semantic topology. During the slicing process, when an external call without source code (third-party library function, kernel system call, undefined interface) is encountered, an event-driven interception verification node is triggered, interrupting the slicing process and guiding the large model to generate an equivalent symbolic logical stub based on the symbolic stub mechanism, call context, function signature, industry-standard library function specifications, etc. The logical equivalence of this stub is verified through a post-hook. After the verification is passed, the stub is injected into the slicing process, ensuring that the slicing continues to run in a "logically complete" manner, thereby completely solving the problem of analysis process interruption caused by external calls.
[0128] S303, Code semantic topology construction and verification.
[0129] In step S303, the full semantic information (i.e., textual and syntactic information) and symbolic logical stubs extracted from the slices are integrated to construct a code semantic topology with taint anchors as the core and data flow and control flow as links. The completeness and logical coherence of the code semantic topology are verified by a post-hook. After the verification is passed, the code semantic topology is structured and stored in the memory module. The full slice data is then summarized, compressed, and updated to complete this stage of execution.
[0130] S4, the stage of taint path backtracking and autonomous assessment of vulnerability feasibility.
[0131] In the S4 phase, based on code semantic topology and a dynamic loading mechanism for prompt words, the complete taint propagation path is identified. This is combined with an event-driven interception and verification node mechanism, along with a task execution autonomous loop mechanism, to backtrack the taint propagation path.
[0132] Phase S4 is the core decision-making stage of vulnerability analysis. Its core objective is to rely on the autonomous loop mechanism of task execution to complete the full path backtracking and feasibility assessment of taint propagation path, solve the pain points of existing technologies that only crudely input code fragments, lack logical reachability verification, and have a high false positive rate, and achieve accurate initial screening of vulnerabilities.
[0133] In one alternative implementation, stage S4 includes the following steps: S401, Tracing the Path of Stain Transmission Backwards.
[0134] Based on code semantic topology, a dynamic loading mechanism for prompt words is used to inject security verification layers and scenario-specific prompt words. This clarifies the criteria for determining taint propagation paths, the rules for verifying logical reachability, and the basis for determining vulnerability types. It guides the large model to conduct reverse taint path backtracking from the Sink anchor point to the Source anchor point and identify the complete taint propagation chain.
[0135] S402, Fine-grained control and verification across the entire supply chain.
[0136] The entire process is managed with fine-grained control through an event-driven interception and verification node mechanism. Before each decision on path backtracking, constraints are injected through pre-hooks to avoid logical jumps and path misjudgments in the large model. After the backtracking of each link node is completed, the taint reachability and logical coherence of the node are verified through post-hooks. If the verification fails, a loop is triggered and the node backtracking is restarted.
[0137] S403, Logical reachability autonomous optimization.
[0138] For logically unreachable nodes discovered during the backtracking process (such as authentication interception, false condition judgments, parameter validation blockages, etc.), an autonomous loop mechanism for task execution is triggered. This guides the large model to re-find alternative paths and bypassable constraints based on code semantic topology, completing iterative path optimization. If multiple backtracking attempts fail to form a complete and reachable tainted link, the sink anchor is determined to have no valid vulnerability, the sink anchor analysis is terminated, and the process moves to the next sink anchor.
[0139] S404, Initial Vulnerability Assessment and Verification.
[0140] Once a complete and logically reachable taint propagation path is identified, the large model completes the initial assessment of vulnerability existence, simultaneously clarifying the vulnerability type, triggering conditions, and severity level, and generating an initial vulnerability assessment report. The logical rigor and link integrity of the initial vulnerability assessment report are verified through a post-hook. If the verification passes, the next stage is initiated; if the verification fails, a loop is triggered, and path backtracking and analysis are carried out again.
[0141] S5, Vulnerability Confirmation and Evidence Chain Closure Synthesis Stage.
[0142] In the S5 phase, a dynamic loading mechanism for linked prompt words is implemented. Based on an event-driven interception and verification node mechanism, the backtracked taint propagation path is verified in a closed loop, generating a vulnerability verification report.
[0143] The core objective of the S5 phase is to complete the theoretical verification of vulnerabilities and the construction of a closed-loop evidence chain, addressing the pain points of existing technologies such as the lack of vulnerability verification, unconvincing results, and the inability to form a traceable evidence chain, and achieving standardized and verifiable output of vulnerability discovery results.
[0144] In one optional implementation, stage S5 includes the following steps: S501, Vulnerability Trigger Vector Generation.
[0145] Based on the initial vulnerability assessment report and the complete taint propagation chain, a dynamic loading mechanism for prompt words is used to inject vulnerability verification-specific prompt words. This guides the large model to generate pseudocode trigger vectors (POCs) that meet the trigger conditions based on the logical constraints, input conditions, and path triggering requirements of the taint propagation path, thus completing the theoretical confirmation of the vulnerability's existence.
[0146] S502, Security Verification and Evidence Chain Synthesis.
[0147] The pre-processing hook performs security verification on the generated Proof of Concept (POC), strictly prohibiting the generation of code containing destructive or malicious execution logic; only non-intrusive pseudocode for theoretical verification is allowed. If the verification fails, a loop is triggered to regenerate the POC. After successful verification, the POC is strongly correlated with the taint propagation path, code semantic topology, anchor point location criteria, and vulnerability type determination rules, forming a closed-loop vulnerability evidence chain of "source point location - path backtracking - triggering conditions - hazard verification".
[0148] S503, Results Verification and Archiving.
[0149] The completeness, closed-loop nature, and compliance of the vulnerability evidence chain are checked by post-hook. The verification dimensions include whether the taint propagation path is complete, whether the POC meets the full path logical constraints, and whether the vulnerability type and severity level are accurately determined. If the verification passes, a standardized vulnerability confirmation report is generated. If the verification fails, a retry loop optimization is triggered, with a maximum of 3 retries (configurable). If all retries fail, the vulnerability is marked as pending manual review.
[0150] S6. Task termination and standardized archiving of results stage.
[0151] In phase S6, the event-driven interception verification node mechanism is used to verify the task termination conditions. The entire process data of the task execution is extracted from the memory module to generate a final task outcome report containing a vulnerability confirmation report. This final task outcome report is then verified using the event-driven interception verification node mechanism to obtain a verified final task outcome report.
[0152] Phase S6 is the final stage of task execution. Its core objectives are to complete the task loop termination, standardize the output of results, and accumulate reusable assets, thereby addressing the pain points of existing technologies, such as the lack of clear termination conditions for tasks, the lack of unified standards for results, and the inability to reuse architecture and experience.
[0153] In one optional implementation, stage S6 includes the following steps: S601, Task termination condition verification.
[0154] The event-driven interception verification bus's global verification node is triggered to check the execution status of the entire task: all taint anchors have been analyzed, all valid vulnerabilities have been confirmed, there are no pending analysis tasks, and the task's preset termination conditions are met. Upon successful verification, the task execution autonomous loop is officially terminated, and all task execution artifacts are locked.
[0155] S602, Final Results Integration and Output.
[0156] The linked memory module extracts core information from the entire task process from three types of memory partitions and integrates it into a standardized final task report. The report includes a task execution overview (which can be parsed in the S1 phase), attack surface location results, a list of tainted anchor points (Source anchor list and Sink anchor list), a complete vulnerability evidence chain, and a vulnerability confirmation report.
[0157] S603, Results Archiving and Asset Accumulation.
[0158] The final report of the heat medium is checked for compliance and completeness through a post-hook. After the check is passed, the report is archived persistently: the final success report of the task, the full audit log and the original analysis products are archived to the storage system to achieve full life cycle traceability.
[0159] S604, Resource Release.
[0160] Release the tool permissions, memory resources, and session context used by this task to complete the closed loop of the entire task execution process.
[0161] Based on the ideas of this application, an embodiment of this application also proposes a static vulnerability mining device, which includes a processor and a storage medium. The storage medium stores a computer program, and the processor runs the computer program to execute the static vulnerability mining method of the above embodiment.
[0162] This invention is not limited to the specific embodiments described above. The invention extends to any new feature or combination disclosed in this specification, as well as any new method or process step or combination disclosed herein.
Claims
1. A static vulnerability discovery intelligent agent system based on driving engineering, characterized in that, The intelligent agent system includes those that work collaboratively: The environmental perception and object representation layer is configured to: perform source-convergence dual anchor point identification on the target environment of the loading task request; The execution layer is configured to define a tool access mechanism for accessing and scheduling external tools. Based on the source-convergence dual anchor points, generate the code semantic topology of candidate vulnerabilities; In addition, based on the successful taint propagation path backtracking, a vulnerability confirmation report is generated; The orchestration layer is configured to define and manage task execution modes. In addition, define a task execution autonomous loop mechanism to control the autonomous loop process of task execution; The memory layer is configured to define a hierarchical progressive memory compression mechanism for hierarchical compression of historical memories. The semantic management layer is configured to define a dynamic loading mechanism for prompt words, which loads the minimum effective prompt word context according to task requirements. In addition, a progressive disclosure mechanism is defined to disclose historical memories in layers according to task requirements; The security layer is configured to: define an event-driven interception and verification node mechanism to introduce pluggable control nodes at multiple stages of task execution through a hook mechanism; and define a tool call permission gating mechanism to restrict the agent's permissions to use tools.
2. The static vulnerability mining intelligent agent system based on driving engineering as described in claim 1, characterized in that, Based on the source-convergence dual anchor points, the code semantic topology of candidate vulnerabilities is generated, including: Based on the source-convergence dual anchor points, forward slicing or backward slicing is performed to extract corresponding text information and grammatical information, forming the code semantic topology; wherein, for anchor points from which text information or grammatical information cannot be extracted, a defined symbolic stub mechanism is used to guide the large model to generate equivalent symbolic logic stubs.
3. The static vulnerability mining intelligent agent system based on driving engineering as described in claim 1, characterized in that, The autonomous loop process for task execution includes five stages: thinking, acting, observing, verifying, and retrying / terminating. Thinking phase: Based on task objectives, historical memory, and current execution status, formulate the execution plan for this round, clarify the tool invocation type, execution actions, and expected results, and complete the decision-making for the execution plan; Action phase: According to the execution plan, specific actions are executed, corresponding tools are invoked, action details, tool invocation parameters and execution status are recorded and synchronized to the memory module; Observation phase: Collect the results and execution status returned by the tools in the action phase, compare them with the expected results, identify execution deviations, tool anomalies and invalid results, extract the core features of the comparison results and synchronize them to the verification phase and memory module; Verification phase: Based on the core features, verify the validity of the execution results of this round, their consistency with the task objectives, and the compliance of the tool calls, in order to determine whether it is necessary to enter the next round of loop, retry, or terminate. Retry / Termination Phase: Based on the verification results, if the task objective is not achieved but the execution is effective, return to the thinking phase, optimize the execution plan, and enter the next cycle; if the execution is ineffective, trigger the retry strategy within the set maximum retry conditions, and if the retry fails, the loop will be broken and an exception will be reported; if the task objective is achieved or the termination conditions are met, the loop will be terminated and the final result will be output.
4. The static vulnerability mining intelligent agent system based on driving engineering as described in claim 1, characterized in that, The hierarchical progressive memory compression mechanism is configured as follows: Historical memory is divided into three categories: original full memory, summary-level compressed memory, and structured indexed memory; among which: The original full memory is a structured historical memory; The summary-level compressed memory is compressed information obtained by compressing a portion of the original full memory; the triggering conditions for the summary-level compressed memory are: the time elapsed since the current task execution phase exceeds a predetermined time window, and / or the importance of the historical memory information is lower than a preset priority; The structured index memory is the index information of the original full memory.
5. The static vulnerability mining intelligent agent system based on driving engineering as described in claim 4, characterized in that, When the aforementioned compression trigger condition is met, the compression intensity of the original full memory is adaptively adjusted according to the following principles: The compression rate of the original full memory is within a preset maximum compression rate threshold; Furthermore, the information retention rate of the original full memory is above a preset minimum information retention threshold.
6. The static vulnerability mining intelligent agent system based on driving engineering as described in claim 1, characterized in that, The hook mechanism is configured to include at least two types: pre-hooks and post-hooks; the pre-hooks and post-hooks each have predefined trigger points at multiple stages of task execution; wherein: The pre-hook is configured to: perform a safety and effectiveness assessment on the executed action; The post-hook is configured to: validate the results returned by the tool, format the output, extract key information, or decide whether to trigger subsequent steps.
7. A static vulnerability discovery method, based on the static vulnerability discovery intelligent agent system based on driving engineering as described in any one of claims 1-6, characterized in that, The methods include: Upon receiving a task request, the system integrates a dynamic loading mechanism for prompt words, a tool access mechanism, a tool call permission gating mechanism, an event-driven interception and verification node mechanism, and a layered progressive memory compression mechanism to initialize global constraints for task execution. Based on the aforementioned global constraints, the attack surface of the task request is located by linking the progressive disclosure mechanism, the dynamic loading mechanism of prompt words, and the autonomous loop mechanism of task execution. Based on the location-based attack surface, a dynamic loading mechanism for prompt words is used to identify source-convergence dual anchor points; based on the source-convergence dual anchor points, a code semantic topology for candidate vulnerabilities is generated; and according to a hierarchical progressive memory compression mechanism, the code semantic topology is compressed and stored in the memory module. Based on the aforementioned code semantic topology, a dynamic loading mechanism for prompt words is used to identify the complete taint propagation path; an event-driven interception and verification node mechanism is used in conjunction with a task execution autonomous loop mechanism to backtrack the taint propagation path. The linkage prompt word dynamic loading mechanism, based on the event-driven interception and verification node mechanism, performs closed-loop verification of the traced taint propagation path and generates a vulnerability verification report. A linkage event-driven interception and verification node mechanism is used to verify task termination conditions. The memory module extracts the full-process data of the task execution process and generates a final task result report containing the vulnerability confirmation report; the final task result report is verified through an event-driven interception verification node mechanism to obtain a verified final task result report.
8. The static vulnerability discovery method as described in claim 7, characterized in that, Initialize global constraints for task execution, including: Analyze the task request and extract the core parameters; A dynamic loading mechanism for prompt words is implemented to load static kernel-level prompt words and guide the large model to initialize global control rules. The integration mechanism for collaborative tools and the tool access permission gating mechanism initialize three-level permission isolation rules based on task type and risk level: Level 1 isolation rule: Lock the global tool whitelist and only allow non-intrusive tools; Level 2 isolation rules: Configure task scenario permission gating and disable intrusive tools; Level 3 isolation rule: Initialize dynamic permission gating for the session and reserve an entry point for permission upgrade approval in subsequent stages; A linkage event-driven interception and verification node mechanism is implemented, and a global control node is registered throughout the entire process. Initialize the memory module and the hierarchical compression rules of the hierarchical progressive memory compression mechanism.
9. The static vulnerability discovery method as described in claim 7, characterized in that, Locate the attack surface of the task request, including: Based on the aforementioned global constraints, a progressive disclosure mechanism, a dynamic loading mechanism for prompt words, and a self-governing loop mechanism for task execution are linked to load the top-level meta-information of the task request; The linkage prompt word dynamic loading mechanism loads dynamic scene layer prompt words to guide the large model to delineate potential attack surfaces based on the top-level meta information and form a pre-positioning list of attack surfaces. Load the index information of the corresponding directory in the attack surface pre-location list to guide the large model to locate the attack surface data corresponding to the potential vulnerability source anchor point, and form a high-priority analysis object list. The collaborative task execution autonomous loop mechanism verifies the list of high-priority analysis objects. If the identified attack surface fails the verification, a loop retry is triggered to reload the top-level metadata and re-form the list of high-priority analysis objects for analysis. If the verification still fails after reaching the maximum retry condition, an abnormal circuit breaker is triggered to terminate the process. If the verification passes, the identified attack surface is retained.
10. A static vulnerability discovery device, characterized in that, It includes a processor and a storage medium; the storage medium stores a computer program, and the processor runs the computer program to perform the static vulnerability discovery method as described in any one of claims 7-9.