A method and apparatus for intercepting illusions in large-scale model execution plans based on static verification

By employing a six-dimensional static verification method to perform multi-dimensional verification on the task execution plan generated by the large language model, the illusion error problem of task execution plans in existing technologies is solved, ensuring the legality and security of the plan and improving the controllability and reliability of the system.

CN123115187APending Publication Date: 2026-11-17BEIJING TCHZT INFO TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611400758.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-10
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

Existing technologies cannot effectively verify phantom errors in task execution plans generated by large language models, such as missing capabilities, parameter mismatches, dependency cycles, unauthorized calls, and semantic tampering, which can lead to task failures or misoperations in business systems.

Method used

A six-dimensional static verification method is adopted, including capability existence verification, parameter matching verification, dependency legality verification, permission satisfaction verification, degradation strategy semantic constraint verification, and verification expression legality verification. This ensures that the execution plan undergoes multi-dimensional structural and semantic checks before execution, rejects illegal plans, and reports errors.

Benefits of technology

It achieves deterministic interception of illusion errors before execution, ensuring the legality and security of the plan, reducing verification costs, improving the controllability and reliability of the system, and forming a two-layer protection system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123115187A_ABST
    Figure CN123115187A_ABST
Patent Text Reader

Abstract

This invention discloses a method and apparatus for intercepting illusion errors in large-scale execution plans based on static verification, relating to the field of artificial intelligence technology. The method includes: obtaining an execution plan generated by a task planning module based on user intent and a system capability catalog. This plan contains multiple steps and a degradation strategy. Each step includes a step identifier, capability identifier, parameter definition, output definition, verification expression, and dependency declaration. Six-dimensional static verification is performed on the execution plan: capability existence, parameter matching, dependency validity, permission satisfaction, semantic constraints of the degradation strategy, and validity of the verification expression. If any dimension fails, execution is rejected and the task planning module is fed back with a structured error reason for retrying. If all dimensions pass, execution is allowed. This invention deterministically intercepts various illusion errors in multi-step execution plans before execution, forming a "verification-feedback-retry" closed loop, improving the reliability of enterprise AI agent systems.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence task orchestration and enterprise business system automation technology, specifically to a method, apparatus, device, and storage medium for statically validating and intercepting illusion-like errors in task execution plans generated by large language models before execution. This invention is applicable to application scenarios where an orchestration agent generates a multi-step execution plan based on the user's natural language intent and the system's capability catalog, and after passing static validation, the scheduling execution module calls various system cognitive agents for actual execution. Background Technology

[0002] In the intelligent agent platform of an enterprise business system, the orchestrator agent serves as the task scheduling hub and typically includes an intent parser, a task planner, and an executor. The task planner, based on a Large Language Model (LLM), generates a multi-step execution plan according to the user's natural language intent and the system's capability registry. Each step declares the invoked agent, capability name, input parameters, output definition, validation expression, and dependencies. The plan also includes concurrency grouping and degradation strategies. Due to the probabilistic nature of the LLM generation process, the generated execution plan may reference non-existent capabilities, mismatched parameters, illegal step dependencies, or degradation paths containing semantic tampering. Directly executing such a plan will lead to task failure, and in cases involving write operations, may even cause erroneous operations within the business system.

[0003] In existing technologies, the security of LLM tool calls mainly includes the following types of solutions: The first type is risk-based protection based on operation type, a typical example being the solution used in the open mainframe project Zowe MCPServer. This solution categorizes the mainframe's MCP tools according to risk level—read-only operations are executed directly, write operations require manual confirmation, and destructive operations undergo additional checks. This type of solution protects against single tool calls, performs static grading based on operation type, does not check the overall structural legality of multi-step execution plans or the correctness of dependencies between steps, and cannot detect semantic tampering of the user's original business conditions that may exist in the degradation path.

[0004] The second category is tool registration and governance facilities, such as MCP Registry, AWS AgentCore Gateway, and Azure API Center. These solutions provide tool registration, discovery, authentication, and central governance capabilities, addressing whether a tool is registered and whether the caller has the necessary permissions. However, they do not verify whether the parameter reference paths in the multi-step execution plan generated by the LLM actually exist in the upstream output, whether the dependency graph contains cycles, or whether the data connections between steps are valid. Their scope is on the capability supply side of governance, rather than on a per-plan verification of a single task plan.

[0005] The third category is general LLM illusion suppression techniques, including cue word constraints, self-reflection, and evaluation set regression testing. These techniques are all probabilistic suppression and cannot guarantee deterministic interception; the role of evaluation set regression testing is to improve the model side, but it cannot replace deterministic interception before execution.

[0006] In summary, the existing technology has the following shortcomings: (1) The verification object is a single operation rather than the entire execution plan, so it cannot detect structural and semantic errors between steps; (2) There is no verification mechanism for the semantic legality of the degradation path, so it cannot prevent the degradation strategy from secretly tampering with the user's original business conditions; (3) There is no deterministic error correction closed loop that links with the planner after verification failure. Summary of the Invention

[0007] Technical problems to be solved This invention aims to solve the following technical problems: (1) The LLM planner may reference capabilities that do not exist or are unavailable in the capability catalog. How can we deterministically discover and intercept them before execution? (2) The parameters in the plan (including cross-step parameter references) may not match the capability schema, and the reference path may not exist in the upstream output. How can we determine this in advance before the data is actually generated? (3) The dependency graph of the plan steps may contain cycles or dangling references, which may lead to deadlock or disordered execution order; (4) The plan may exceed the current user's permission scope, and the permission gap should be exposed before execution rather than during execution; (5) The downgrade path may "pretend to succeed" by relaxing the user's original business conditions, resulting in hidden result distortion; (6) If the result verification expression in the plan allows arbitrary code execution, it itself becomes a risk surface for injection and execution.

[0008] Technical solution To achieve the above objectives, this invention provides a method for intercepting illusions in large model execution plans based on static verification, comprising the following steps: Step S1, Obtain Execution Plan: Receive the execution plan generated by the task planning module based on user intent and system capability catalog; the execution plan includes multiple steps and degradation strategies, each step includes step identifier, capability identifier, parameter definition, output definition, validation expression and dependency declaration, and the execution plan also includes concurrent grouping; Step S2, perform a six-dimensional static verification on the execution plan; the six-dimensional static verification includes: Capability Existence Verification: Verify that each capability identifier referenced in each step exists in the system capability catalog and is available. Parameter matching and verification: Verify that the parameter definitions of each step conform to the input schema of the corresponding capability, and determine the existence of reference paths for cross-step parameter references before execution and before the data is actually generated, based on the output schema declared by the upstream step. Dependency validity verification: Construct a dependency graph for dependency declarations, verifying acyclic relationships and the absence of dangling references; concurrent grouping and dependencies. Figure 1 To; Permissions can satisfy the verification: verify that the current user has the authority to execute all steps of the plan, and verify the user's identity across the entire link from the user terminal to the target business system; Fallback Semantic Constraint Verification: Performs semantic comparison of fallback strategies. Fallback paths are only allowed to have a fallback result format or explicit error message, and modification of the user's original business conditions is prohibited. Expression validity check: Perform syntax check on the expression at each step, only allow expressions that conform to the restricted expression domain-specific language (DSL), and prohibit arbitrary code execution; Step S3: If any dimension of the six-dimensional static verification fails, the execution plan is rejected, and the structured error reason along with the execution plan is fed back to the task planning module for replanning. Step S4: If all six-dimensional static verifications pass, the execution plan is released and handed over to the scheduling execution module for execution.

[0009] Furthermore, step S3 also includes: when the number of replanning times of the execution plan exceeds a preset threshold, transferring the execution plan to manual processing and recording the interception event in the audit log.

[0010] Furthermore, the unified format for referencing cross-step parameters is: {{steps.<step_id> .output.<json_path>}},in<json_path> This can be omitted; omitting it indicates referencing the entire output of the upstream step, and<json_path> Supports the [*] array element wildcard syntax, which means taking the value of each element in the output array under this path; the parameter matching verification checks the reference expression by parsing the dependency chain to verify that the reference path actually exists in the output or output schema declared in the upstream step, and completes the existence determination based on the plan structure and capability schema before the data is actually generated.

[0011] Furthermore, the semantic constraint verification of the downgrade strategy specifically includes: extracting the user's original business condition set from the intent parsing result, wherein the original business conditions include at least one of the following: amount threshold, time range, and regional filtering conditions; comparing the parameters referenced in the downgrade strategy with the original business condition set one by one; if any original business condition is deleted or relaxed in the downgrade strategy, it is determined to be a violation; if the downgrade strategy only involves the downgrade result form or a clear error, it is determined to be passed.

[0012] Furthermore, the restricted expression domain-specific language (DSL) only allows comparison operations, logical operations, and predefined aggregate functions, including len, sum, any, and all, and prohibits the use of the eval function and any form of code execution instructions.

[0013] Furthermore, the dependency validity verification includes: constructing a directed graph for the dependency declarations of each step, and detecting whether a cycle exists through topological sorting; verifying whether the step identifiers referenced in each dependency declaration actually exist in the plan; and verifying that there are no direct or indirect dependencies between steps in the same group in concurrent groups.

[0014] Furthermore, the method also includes: during the execution of the scheduling execution module, when a certain step fails, the module executes the degradation logic according to the degradation strategy that has passed the semantic constraint verification of the degradation strategy. Beneficial effects

[0015] Compared with the prior art, the present invention has the following beneficial effects: (1) The interception of illusion errors is moved from "invocation control" to "pre-execution verification", and the verification of a single operation is extended to the multi-dimensional structural and semantic legality verification of the entire multi-step execution plan. It can screen out various types of illusion errors such as non-existence of capability, parameter mismatch, dependency loop, unauthorized call, semantic tampering and code injection in one go before the plan is executed.

[0016] (2) By introducing semantic constraint verification of the downgrade strategy, the deterministic interception of hidden semantic tampering in the downgrade strategy is realized for the first time, ensuring that even if the task fails, the reason for failure is clear and credible, and eliminating the "fake success" caused by relaxing the user's original business conditions.

[0017] (3) The existence determination of cross-step parameter reference path only depends on the output schema declaration in the capability directory, without actually calling any business system. The verification cost is low and it can be executed frequently within the planning loop.

[0018] (4) When the verification fails, the planner will retry along with the structured error cause feedback, so that the verifier can also serve as the deterministic error correction signal source of the planner. Compared with the probabilistic error correction mechanism such as LLM self-reflection, the convergence speed is faster and the results are reproducible and auditable. The retry limit is transferred to manual control to ensure the final controllability of the system.

[0019] (5) Together with the write operation security mechanism during the execution period (idempotent key, manual approval, Saga compensation), it forms a two-layer protection system of "static interception before execution + dynamic fallback during execution", which makes up for the lack of static verification dimension in the existing solution.

[0020] (6) This invention can be applied to various intelligent agent orchestration platforms based on large language models, especially in enterprise-level business system automation scenarios. The technical solution of this invention does not depend on a specific LLM model or platform and has broad application prospects. Attached Figure Description

[0021] Figure 1 This is an overall flowchart of the method according to an embodiment of the present invention.

[0022] Figure 1 The overall flow of the method of this invention is illustrated. Key steps are labeled as follows: 100: Obtain the execution plan 200: Six-dimensional static verification 300: Did all checks pass? 400: Reject Plan, Feedback Planner 500: Has the retry limit been exceeded? 600: Transfer to manual processing 700: Release and execute 800: The scheduling and execution module is executing. Figure 2 This is a detailed flowchart of the six-dimensional static verification in an embodiment of the present invention.

[0023] Figure 2 This demonstrates the internal structure of the six-dimensional verification. Verification dimension labels: 210: Capability Existence Verification Submodule 220: Parameter Matching and Verification Submodule 230: Depends on the legality verification submodule 240: Permissions satisfy the verification submodule. 250: Degradation Strategy Semantic Constraint Validation Submodule 260: Expression validity validation submodule Figure 3 This is a flowchart of the algorithm for determining the semantic constraints of the degradation strategy in an embodiment of the present invention.

[0024] Figure 3 This demonstrates the decision-making process for semantic constraint verification of the degradation strategy. Key steps are numbered as follows: 310: Extract the original business condition set 320: Extracting the set of conditions for the degradation strategy 330: Compare the original conditions with the degradation strategy conditions one by one. 340: Determine if a violation exists (delete or relax the restriction). 350: Output verification result Figure 4 This is a flowchart of the cross-step parameter reference parsing process for parameter matching verification in an embodiment of the present invention.

[0025] Figure 4 This demonstrates the parsing process for cross-step parameter references during parameter matching and validation. Key steps are numbered as follows: 221: Parsing Reference Format 222: Check the dependency chain 223: Locate the reference path in the output schema 224: Type Compatibility Check 225: Passed 226: Failed Figure 5 This is a schematic diagram of the overall system architecture of an embodiment of the present invention.

[0026] Figure 5 The overall system architecture of this invention is illustrated. Main module numbers: 1: User side 2: Arranging Intelligent Agents 21: Intent Understanding Module 22: Task Planning Module 23: Static Validator 24: Scheduling and Execution Module 3: System Capability Directory 4: System Cognitive Intelligent Agent Cluster 41: SCA-ERP 42: SCA-CRM 43: SCA - Other Systems 5: Target Business System 51: ERP System 52: CRM System 53: Other business systems Detailed Implementation

[0027] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. The following embodiments are used to illustrate the present invention, but are not intended to limit the scope of the present invention.

[0028] Terminology Explanation Execution Plan: A structured task description generated by the task planning module, containing multiple steps. Each step declares the agent to be invoked, capability identifier, parameter definition, output definition, validation expression, and dependencies. The plan level includes concurrent grouping and degradation strategies.

[0029] Capability Registry: A structured directory that registers all available system capabilities. Each capability entry contains fields such as capability identifier, input schema, output schema, permission declaration, and service level agreement.

[0030] Fallback strategy: An alternative handling scheme declared in the execution plan when a certain step fails.

[0031] Domain-Specific Language for Restricted Expressions (DSL): A restricted expression syntax used for result validation that only allows comparison operations, logical operations, and predefined aggregate functions.

[0032] Cross-step parameter referencing: A parameter in one step of the plan references the output of another upstream step, with the uniform format {{steps}.<step_id> .output.<json_path>}};in<json_path> It can be omitted. When omitted, it means referencing the entire output of the upstream step, and supports the [*] array element wildcard syntax.

[0033] Fallback Semantic Constraint Verification: One dimension of the six-dimensional static verification, used to verify whether the fallback strategy violates the original business conditions of the user.

[0034] Example 1: Full-dimensional validation of cross-system query export tasks (normal pass scenario) This embodiment demonstrates the complete process of a cross-system query export task passing all six-dimensional static verifications and being allowed to execute normally. Application scenarios

[0035] The user entered: "Please help me find customers in North China whose transaction amount has exceeded 500,000 RMB in the last 30 days and export their contact records." The Intent Parser module outputs structured intents: { "intent": "complex_query_and_export", "entities": { "region": "North China", "time_range": "last 30 days", "amount_threshold": 500000, "target_data": ["Customer Information", "Contact Records"] } } The task planning module generates an execution plan (task_20260723_001) based on the above intents and system capability catalog, consisting of four steps: Step 1: Use the erp.order.query function of SCA-ERP to query orders from the last 30 days, aggregate by customer, and filter customers with an amount exceeding 500,000.

[0036] { "step_id": 1, "agent": "SCA-ERP", "capability": "erp.order.query", "parameters": { "time_range": ["2026-06-23", "2026-07-23"], "aggregation": "sum_by_customer", "filter": "total_amount > 500000" }, "output": "qualified_customers", "validation": "len(output) > 0" } Step 2: Call the crm.customer.query capability of SCA-CRM to query the information of qualified customers and limit it to the North China region.

[0037] { "step_id": 2, "agent": "SCA-CRM", "capability": "crm.customer.query", "parameters": { "customer_ids": "{{steps.1.output[*].customer_id}}", "query_conditions": {"region": "North China"}, "fields": ["customer_id", "name", "region", "sales_owner"] }, "output": "customer_list", "depends_on": [1], "validation": "len(output) > 0" } Step 3: Use the crm.contact_record.query capability of SCA-CRM to query the contact records of these customers.

[0038] { "step_id": 3, "agent": "SCA-CRM", "capability": "crm.contact_record.query", "parameters": { "customer_ids": "{{steps.2.output[*].customer_id}}" }, "output": "contact_records", "depends_on": [2] } Step 4: Use the crm.data.export function of SCA-CRM to export the results.

[0039] { "step_id": 4, "agent": "SCA-CRM", "capability": "crm.data.export", "parameters": { "data": "{{steps.3.output}}", "format": "xlsx", "template": "contact_record_template" }, "depends_on": [3] } The degradation strategy accompanying the plan is described in a structured format: { "fallback_strategy": { "step_1_failure": { "action": "terminate", "description": "Task terminated, error reason returned (filtering criteria cannot be relaxed without authorization)", "return_on_failure": "Order query failed; unable to retrieve data for eligible customers". "original_conditions_preserved": true }, "step_3_failure": { "action": "degrade", "description": "Downgraded to exporting only basic customer information, with clear indication of missing contact records", "original_conditions_preserved": true }, "export_failure": { "action": "degrade", "description": "Changed to return JSON format data and indicate the reason for export failure", "original_conditions_preserved": true } } } Dimension 1: Verification of the Existence of Capabilities

[0040] The static validator checks the capability identifiers referenced in each step of the plan one by one: The erp.order.query referenced in step 1 exists in the capability directory and is in an available state; The crm.customer.query referenced in step 2 exists in the capability directory and is in an available state; The crm.contact_record.query referenced in step 3 exists in the capability directory and is in an available state; The crm.data.export referenced in step 4 exists in the capability directory and is in an available state.

[0041] Verification result: Passed. Dimension Two: Parameter Matching Validation

[0042] The verifier checks the parameters of each step one by one: Step 1: The parameter names time_range, aggregation, and filter are all defined in the input schema of erp.order.query. The required fields have been filled in and the types match.

[0043] Step 2: The parameter names customer_ids, query_conditions, and fields are all defined in the input schema of crm.customer.query; the cross-step parameter reference {{steps.1.output[*].customer_id}} is parsed and the reference expression format is correct. Checking the output schema of Step 1 along dependency chain 1, it is confirmed that the customer_id field exists in the schema of the output qualified_customers declared in Step 1, and its type is string.

[0044] Step 3: The parameter name customer_ids is defined in the input schema of crm.contact_record.query; the cross-step parameter reference {{steps.2.output[*].customer_id}} is parsed and checked against the output schema of Step 2 to confirm that the customer_id field exists.

[0045] Step 4: The parameter names data, format, and template are all defined in the input schema of crm.data.export; the cross-step parameter reference {{steps.3.output}} is in the correct format.

[0046] Verification result: Passed. Dimension 3: Reliance on Legality Verification

[0047] The validator build depends on the directed graph: 1->2->3->4 (step 2 depends on 1, step 3 depends on 2, and step 4 depends on 3).

[0048] Topological sorting verification shows that there are no cycles in the dependency graph; the step identifiers referenced in each dependency declaration (such as 1 in depends_on: [1] in step 2) are all actually present in the plan; parallel_groups are grouped into [[1],[2],[3],[4]], each group contains only one step, and there are no dependency conflicts within the same group.

[0049] Verification result: Passed. Dimension 4: Permissions can satisfy verification

[0050] Verifier check: The permissions declared in erp.order.query are ["order_query"], which the current user has. The permissions declared by crm.customer.query are ["customer_query"], which the current user has. The permissions declared in crm.contact_record.query are ["contact_query"], which the current user has. The crm.data.export declaration has the permission ["data_export"], and this capability requires approval. The current user is qualified to trigger the approval.

[0051] User identity is penetrated throughout the entire chain from "user → orchestration agent → SCA → target business system", and permissions are satisfied at each stage.

[0052] Verification result: Passed. Dimension 5: Verification of semantic constraints for degradation strategies

[0053] The verifier executes the semantic constraint determination algorithm for the degradation strategy: Step 1: Extract the user's original business condition set from the intent parsing results: amount_threshold: 500000 (Amount threshold of 500,000) time_range: ["2026-06-23", "2026-07-23"] (Time range: the most recent 30 days) region: "North China" (regional selection criterion) Step 2: Analyze each degradation scheme in the degradation strategy item by item. Since the degradation strategy uses a structured format, the validator directly reads the `action` and `modified_conditions` fields of each scheme: step_1_failure: action is terminate, original_conditions_preserved is true. This degradation solution involves task termination and does not reference or modify the original business conditions. Judgment: Constraints met.

[0054] Step 3_failure: Action is "degrade", and original_conditions_preserved is true. This degradation solution only downgrades the result format from "complete export including contact records" to "export only basic information", without modifying the original business conditions such as amount_threshold, time_range, and region. Judgment: Meets constraints.

[0055] `export_failure`: `action` is `degrade`, `original_conditions_preserved` is `true`. This degradation solution only changes the output format and does not modify the original business conditions. Judgment: Meets constraints.

[0056] Step 3: None of the downgrade schemes removed or relaxed the original business conditions. Verification result: Passed. Dimension Six: Validating the Validity of Expressions

[0057] The validator performs syntax checks on the validation expression for each step: In step 1, len(output) > 0: This belongs to the comparison operation (>) + aggregate function (len), which conforms to the restricted DSL syntax; Step 2, len(output) > 0: Same as above; Since no validation expressions are declared in steps 3 and 4, this dimension does not require validation.

[0058] Verification result: Passed. Final judgment and release

[0059] All six-dimensional static validations passed, and execution plan task_20260723_001 was approved and handed over to the scheduling and execution module (Executor) for execution. The Executor executes in parallel groups, with concurrent calls within a group and dependency-based advancement between groups. During each step, cross-step parameter references are first resolved, and then the corresponding SCA's execute_capability method is called; after the step returns, the result is asserted based on the validated expression. When a step fails, degradation logic is executed according to the degradation strategy that has passed semantic constraint validation.

[0060] Example 2: Interception and Feedback Retry of the Illusion Project (Reverse Interception Scenario) This embodiment demonstrates the entire process of an execution plan containing an illusion error being intercepted by a six-dimensional static check, the error reason being fed back to the planner for retry, and the plan passing after a successful retry. Application scenarios

[0061] The user input is the same as in Example 1. The task planning module generates an incorrect execution plan due to the LLM illusion. This plan references a capability that does not exist in the capability catalog in step 2, and the degradation strategy in this step involves tampering with the user's original business conditions. Illusion Project Contents

[0062] Step 1 (Normal): { "step_id": 1, "agent": "SCA-ERP", "capability": "erp.order.query", "parameters": { "time_range": ["2026-06-23", "2026-07-23"], "aggregation": "sum_by_customer", "filter": "total_amount > 500000" }, "output": "qualified_customers", "validation": "len(output) > 0" } Step 2 (Illusion): The planner generates a non-existent capability crm.customer.profile_query.

[0063] { "step_id": 2, "agent": "SCA-CRM", "capability": "crm.customer.profile_query", "parameters": { "customer_ids": "{{steps.1.output[*].customer_id}}" }, "output": "customer_list", "depends_on": [1], "validation": "len(output) > 0" } The downgrade strategy includes a violation downgrade scheme: { "fallback_strategy": { "step_1_failure": { "action": "retry_with_modified_params", "description": "If the query fails, the amount threshold will be relaxed from 500,000 to 300,000 for retry". "modified_conditions": { "amount_threshold": 300000 }, "original_conditions_preserved": false }, "step_2_failure": { "action": "terminate", "description": "Task terminated", "original_conditions_preserved": true } } } Interception process

[0064] Dimension 1 Verification (Capability Existence): The validator checks the crm.customer.profile_query referenced in step 2—this capability identifier does not exist in the system capability directory. The validator records the reason for the structured error: { "dimension": "capability_existence", "step_id": 2, "rule": "capability_id_must_exist_in_registry", "message": "The capability crm.customer.profile_query referenced in step 2 is not registered in the system capability directory." } Judgment: Not passed.

[0065] Dimension 5 verification (degradation strategy semantic constraints): The validator extracts the user's original business condition set: amount_threshold: 500000 time_range: ["2026-06-23", "2026-07-23"] region: North China Analysis of downgrade strategies: Step 1_failure: The action is `retry_with_modified_params`, and `modified_conditions` contains `amount_threshold: 300000`. This value is compared to the original condition `amount_threshold: 500000`: the original threshold was 500000, and the downgraded threshold is 300000. According to the quantitative judgment criteria for "condition relaxation," the threshold reduction from 500000 to 300000 constitutes a threshold reduction and is judged as relaxation. Violation.

[0066] step_2_failure: action is terminate, original_conditions_preserved is true, the original business conditions have not been modified.

[0067] The validator records the reasons for structured errors: { "dimension": "fallback_semantic_constraint", "step_id": 1, "rule": "fallback_must_not_modify_original_business_conditions", "message": "The downgrade solution in step 1 relaxes the user's original condition amount_threshold from 500000 to 300000", "details": { "original_condition": "amount_threshold: 500000", "fallback_condition": "amount_threshold: 300000", "violation_type": "condition_relaxation", "relaxation_criterion": "Lowering the amount threshold is considered a relaxation." } } Judgment: Not passed. Rejection and Feedback

[0068] Since both Dimension 1 and Dimension 5 validations failed, the execution plan was rejected as a whole. The two structured error reasons, along with the execution plan, were fed back to the task planning module. Retry and Correction

[0069] After receiving feedback, the task planning module is retrying: Correct the capability in step 2 from crm.customer.profile_query to the actual crm.customer.query that exists in the capability directory; Delete the non-compliant downgrade scheme step_1_failure, and retain the valid step_2_failure and other valid downgrade schemes from Example 1.

[0070] The revised execution plan was resubmitted for six-dimensional static validation, and all dimensions passed. The plan was then approved for execution. Retrying beyond the limit will result in manual intervention (supplementary scenario)

[0071] If the planner is still unable to generate a plan that passes all dimensions of the verification within the preset maximum number of retries (e.g., 3 times), the execution plan will be handed over to manual processing. The system will record the reason for each verification failure, the number of retries, and the final decision to hand it over to manual processing in the audit log.

[0072] Determination algorithm for semantic constraint verification of degradation strategy The semantic constraint verification of the degradation strategy of this invention adopts the following judgment algorithm. Structured degradation strategy description format

[0073] To ensure the machine-determinable nature of business conditions in the degradation strategy, the degradation strategy is described in a structured format. Each degradation plan is a JSON object containing the following fields: The JSON Schema definition for the structured degradation strategy is as follows: { "$schema": "http: / / json-schema.org / draft-07 / schema#", "type": "object", "patternProperties": { "^.*_failure$": { "type": "object", "required": ["action", "description", "original_conditions_preserved"], "properties": { "action": { "type": "string", "enum": ["terminate", "degrade", "retry_with_modified_params"] }, "description": { "type": "string"}, "return_on_failure": { "type": "string"}, "modified_conditions": { "type": "object", "additionalProperties": { "type": ["number", "string", "array", "boolean"]} }, "original_conditions_preserved": { "type": "boolean"} } } } } Specific examples

[0074] Structured representation of each degradation scheme in Example 1 (normal pass scenario): { "fallback_strategy": { "step_1_failure": { "action": "terminate", "description": "Task terminated, error reason returned", "return_on_failure": "Order query failed; unable to retrieve data for eligible customers". "original_conditions_preserved": true }, "step_3_failure": { "action": "degrade", "description": "Downgraded to exporting only basic customer information, with clear indication of missing contact records", "original_conditions_preserved": true }, "export_failure": { "action": "degrade", "description": "Changed to return JSON format data and indicate the reason for export failure", "original_conditions_preserved": true } } } Structured representation of the violation downgrade scheme in Example 2 (violation interception scenario): { "fallback_strategy": { "step_1_failure": { "action": "retry_with_modified_params", "description": "If the query fails, the amount threshold will be relaxed from 500,000 to 300,000 for retry". "modified_conditions": { "amount_threshold": 300000 }, "original_conditions_preserved": false }, "step_2_failure": { "action": "terminate", "description": "Task terminated", "original_conditions_preserved": true } } } Quantitative criteria for "relaxed conditions"

[0075] When comparing the original business conditions with the conditions in the downgrade strategy, the following quantitative criteria are used to determine whether the conditions have been "relaxed": Summary of Judgment Rules: Amount / Numerical Threshold: If the numerical threshold in the downgrade strategy is more lenient than the original threshold (e.g., the upper limit of amount is increased, the lower limit of amount is decreased, the lower limit of quantity is decreased, and the upper limit of quantity is increased), it is considered relaxed; Numerical range: If the numerical range in the downgrade strategy is larger than the original range (e.g., the upper limit is increased, the lower limit is decreased, or the difference between the upper and lower limits is increased), it is considered to be relaxed; Time range window: If the time range window in the degradation strategy is larger than the original window (e.g., earlier start time, later end time, increased window length), it is considered to be relaxed. Filter condition deletion: If the downgrade strategy deletes a filter condition from the original conditions, it is considered as a relaxation; Enumeration value relaxation: If the degradation strategy changes the enumeration restriction in the original condition to a more relaxed value, it is considered relaxation. Condition extraction and comparison algorithm

[0076] The detailed steps of the algorithm are as follows:

[0077] Extract all business conditions from the structured entity set "entities" resulting from the intent parsing. The extraction rules are as follows: Iterate through all key-value pairs in entities; For numeric values ​​(such as amount_threshold: 500000), record them as numeric conditions; For array-type values ​​where the elements are strings (e.g., time_range: ["2026-06-23", "2026-07-23"]), the record is a range condition; For string values ​​(such as region: "North China", customer_level: "VIP"), the record is an enumeration condition; For boolean values ​​(such as include_archived: false), they are recorded as switch conditions.

[0078] The extracted conditions are organized into an original condition set C_original = {key: {type, value}}.

[0079] Step 2: Extracting Downgrade Strategy Conditions For each degradation scheme in the degradation strategy, different processing is performed based on its action type: If the action is terminate or degrade: it only involves the result of task termination or degradation, does not extract parameters, and is directly judged as pass; If the action is retry_with_modified_params: extract the modified parameters and their values ​​from the modified_conditions field to form the fallback condition set C_fallback; If the action field is missing or has an unknown value: extract the conditions by parsing the text and use regular expressions to match the known condition key names in the entities.

[0080] Step 3: Condition Comparison For each original condition c_i in C_original, a matching decision is made in the degradation scheme: for each (step_id, fallback) in fallback_strategy: if fallback.action in ["terminate", "degrade"]: continue / / Downgrade mode, does not involve modification of business conditions C_fallback = extract_from_modified_conditions(fallback.modified_conditions) for each condition in C_original: if condition.key in C_fallback: if isMoreRelaxed(C_fallback[condition.key],condition.value): return FAIL("Condition relaxed: " + condition.key + " changes from " + condition.value + " to " + C_fallback[condition.key]) else: / / The original conditions do not exist in the degradation plan, but the degradation plan is a parameter modification and retry type. / / This means that the original condition was ignored in the retry and was treated as deleted. return FAIL("Condition deleted: " + condition.key) / / Check if any new conditions not present in the original set of conditions have been introduced into modified_conditions. The introduction of new conditions is not considered a violation; the focus is only on whether the original conditions have been relaxed or deleted. return PASS The isMoreRelaxed(modifiedValue, originalValue) function compares each type according to the above "quantitative judgment criteria for relaxed conditions".

[0081] Step 4: Output Results If all downgrade schemes are within acceptable limits, output "Pass". If a violation is found, output the failure message and violation details, including: Validation dimension identifier: fallback_semantic_constraint Step identifiers: Steps corresponding to the violation downgrade plan Rule violation description: Condition relaxed or condition deleted. Original condition values: The original conditions being modified and their values. Downgrade condition value: The modified value in the downgrade plan. Judgment basis: the quantitative judgment criteria used

[0082] In this invention, the unified format for referencing parameters across steps is: {{steps.<step_id> .output.<json_path>}}.in<json_path> This can be omitted. When omitted, it indicates that the entire output of the upstream step is referenced (e.g., {{steps.3.output}}).<json_path> Supports the [*] array element wildcard syntax, which means taking the value of each element in the output array from the path (e.g., {{steps.1.output[*].customer_id}}).

[0083] The cross-step parameter reference resolution process in parameter matching and validation is as follows: Format parsing: Use regular expressions to match the {{...}} template tags in the parameter values ​​to extract the referenced step identifiers and JSON paths.

[0084] Dependency chain check: Confirm that the referenced step is in the dependency chain of the current step (i.e., the depends_on declaration directly or indirectly depends on the referenced step).

[0085] Existence check: Search for the field definition corresponding to the JSON path in the output schema of the referenced step. If found and the type matches, the referenced path is considered to exist; otherwise, it is considered not to exist.

[0086] Type compatibility check: If the type of the referenced field is consistent with the expected type of the current step parameter or can be implicitly converted, then the parameter type is determined to be a match.

[0087] For example, for a reference to {{steps.1.output[*].customer_id}}: The parsing process retrieves the reference from step 1 and the JSON path [*].customer_id; Confirm that step 1 is included in the depends_on function of step 2; In the output schema of step 1, find the customer_id field and confirm that it exists and is of type string; The expected type of the parameter customer_ids in step 2 is string or string array, which is compatible.

[0088] Topological sorting algorithms that rely on validity checks The validity check relies on topological sorting for implementation. Graph construction: Using step identifiers as nodes and depend_on declarations as directed edges, construct a directed graph.

[0089] Cycle detection: Kahn's algorithm (topological sorting based on in-degree) is used to detect cycles. If the number of visited nodes after sorting is not equal to the total number of nodes, a cycle exists.

[0090] Dangling reference detection: For each step identifier referenced in a dependency declaration, check whether it exists in the node set.

[0091] Concurrent group consistency check: For each group in parallel_groups, check whether there is a direct or indirect dependency relationship between any two nodes in the group. If so, the group is determined to be inconsistent with the dependency graph.

[0092] System Architecture The system architecture of this invention includes the following modules: Intent understanding module: Receives user natural language input and outputs structured intent (including business condition entities); Task planning module: Based on structured intents and system capability catalogs, it uses LLM to generate multi-step execution plans; Static validator: Performs six-dimensional static validation on the execution plan, and includes the following sub-modules: Capability Existence Verification Submodule Parameter matching and verification submodule Depends on the legality verification submodule Permissions are sufficient for the verification submodule. Degradation strategy semantic constraint verification submodule Expression validity validation submodule The scheduling and execution module executes plans that have passed static verification, schedules them by concurrency group, and handles degradation logic when steps fail. System Capability Catalog: Registers all available system capabilities as a source of factual verification.

[0093] Division of labor with execution-period security mechanisms The static verification and runtime write operation security mechanisms of this invention are complementary and do not substitute for each other: Static validation (this invention): Responsible for determining "whether the plan itself is legal," including whether the capability exists, whether the parameters match, whether the dependencies are legal, whether the permissions are satisfied, whether the degradation strategy is compliant, and whether the expression is safe. Validation is completed before execution and does not depend on actual business system calls.

[0094] Execution-time security mechanism: Responsible for determining "whether this actual call is safe," including idempotent key protection for write operations, default manual approval suspension, and reverse compensation according to the Saga pattern. This mechanism runs independently of static verification.

[0095] The two mechanisms constitute a two-layer protection system of "static interception before execution + dynamic fallback during execution".

[0096] Best practice The preferred implementation of this invention is as follows: the static validator is deployed as an embedded module of the orchestration agent, running within the same service as the task planning module and the scheduling execution module to reduce network latency. The validator runs as an independent thread, receiving the execution plan and executing non-conflicting verification dimensions in parallel (capability existence, permission fulfillment, and parameter matching can be parallelized), while executing dependent verification dimensions serially (dependency validity must be executed before parameter matching). The maximum number of retries is recommended to be configured to 3, which can be dynamically adjusted via environment variables or the configuration center. The specific value can be set comprehensively based on factors such as task urgency, system load, and historical success rate. Verification results are recorded in the execution history in structured JSON format for auditing and analysis.

[0097] Computer-readable storage medium embodiments This invention also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the method described in any of the above embodiments.

[0098] Electronic device examples This invention also provides an electronic device, including a processor and a memory, wherein the memory stores a computer program, and the computer program, when executed by the processor, implements the method steps described in any of the above embodiments.

Claims

1. A method for intercepting illusions in large-scale model execution plans based on static validation, characterized in that, Includes the following steps: Obtain the execution plan, which is generated by the task planning module based on user intent and system capability catalog. The execution plan includes multiple steps, concurrent grouping and degradation strategy. Each step includes step identifier, capability identifier, parameter definition, output definition, validation expression and dependency declaration. Perform a six-dimensional static verification on the execution plan; The six-dimensional static verification includes: Capability Existence Verification: Verify that the capability identifiers referenced in each step exist in the system capability catalog and are available. Parameter matching and verification: Verify that the parameter definitions of each step conform to the input schema of the corresponding capability, and determine the existence of reference paths for cross-step parameter references based on the output schema declared by the upstream step; Dependency validity verification: Construct a dependency graph for the dependency declarations of each step, and verify that there are no cycles and no dangling references; Permissions can satisfy the verification: verify that the current user has the authority to execute all steps of the plan; Degradation strategy semantic constraint verification: The degradation strategy is semantically compared. The degradation path is only allowed to have a degradation result form or an explicit error, and modification of the user's original business conditions is prohibited. Expression validity check: Perform syntax check on the expression at each step, only allow expressions that conform to the restricted expression domain-specific language (DSL), and prohibit arbitrary code execution; If any dimension of the six-dimensional static verification fails, the execution plan will be rejected, and the structured error reason, along with the execution plan, will be fed back to the task planning module for replanning. If all six-dimensional static checks pass, the execution plan is released and handed over to the scheduling and execution module for execution.

2. The method according to claim 1, characterized in that, The method further includes: when the number of replanning times of the execution plan exceeds a preset threshold, transferring the execution plan to manual processing and recording the interception event in the audit log.

3. The method according to claim 1, characterized in that, The format for referencing the cross-step parameters is: {{steps.<step_id> .output.<json_path>}},in<json_path> This can be omitted; omitting it indicates referencing the entire output of the upstream step, and<json_path> Supports wildcard syntax for array elements [*]; the parameter matching verification checks whether the reference path actually exists in the output or output schema declared in the upstream step by parsing the reference expression and checking along the dependency chain.

4. The method according to claim 1, characterized in that, The semantic constraint verification of the degradation strategy specifically includes: Extract the user's original business conditions set from the intent parsing results. The original business conditions include at least one of the following: amount threshold, time range, and region filtering conditions. The parameters referenced in the degradation strategy are compared one by one with the original set of business conditions; If any original business condition is deleted or relaxed in the downgrade policy, it is considered a violation; If the downgrade strategy only involves the form of the downgrade result or an explicit error, it is considered to pass; The criteria for relaxation include at least one of the following: a reduction or increase in the amount or numerical threshold to a more lenient value is considered relaxation; an expansion of the numerical range is considered relaxation; an expansion of the time range window is considered relaxation; the deletion of the filtering condition is considered relaxation; and the enumeration condition allowing a more lenient value is considered relaxation.

5. The method according to claim 1, characterized in that, The Restricted Expression Domain-Specific Language (DSL) only allows comparison operations, logical operations, and predefined aggregate functions, including len, sum, any, and all. The use of the eval function and any form of code execution instruction is prohibited.

6. The method according to claim 1, characterized in that, The dependency validity verification specifically includes: A directed graph is constructed based on the dependency declarations of each step, and the existence of cycles is detected by topological sorting; Verify that the step identifier referenced in each dependency declaration exists in the plan; Verify that there are no direct or indirect dependencies between steps in the same group within the concurrent group.

7. The method according to claim 1, characterized in that, The method further includes: when a certain step fails during the execution of the scheduling execution module, the downgrade logic is executed according to the downgrade strategy that has passed the semantic constraint verification of the downgrade strategy.

8. The method according to claim 1, characterized in that, The verification of at least two dimensions in the six-dimensional static verification is performed in parallel; the capability existence verification, permission satisfaction verification, and parameter matching verification are performed in parallel, and the dependency legality verification is performed before the parameter matching verification.

9. A large-scale model execution plan illusion interception device based on static verification, characterized in that, include: The plan acquisition module is used to obtain the execution plan from the task planning module. The execution plan is generated by the task planning module based on user intent and system capability catalog, and includes multiple steps, concurrent grouping and degradation strategy. Each step includes step identifier, capability identifier, parameter definition, output definition, validation expression and dependency declaration. The static verification module is used to perform a six-dimensional static verification on the execution plan; The static verification module includes: The capability existence verification unit is used to verify that the capability identifiers referenced in each step exist in the system capability catalog and are available. The parameter matching and verification unit is used to verify that the parameter definitions of each step conform to the input schema of the corresponding capability, and to determine the existence of reference paths for cross-step parameter references based on the output schema declared by the upstream step. The dependency validity verification unit is used to construct a dependency graph for the dependency declarations of each step, verifying that there are no cycles and no dangling references; The permissions can satisfy the verification unit, which is used to verify that the current user has the authority to execute all steps of the plan; The degradation strategy semantic constraint verification unit is used to perform semantic comparison of the degradation strategy. The degradation path is only allowed to have a degradation result form or an explicit error, and modification of the user's original business conditions is prohibited. The expression validity verification unit is used to perform syntax verification on the expression at each step, allowing only expressions that conform to the restricted expression domain-specific language (DSL) and prohibiting arbitrary code execution. The feedback module is used to refuse to execute the execution plan when any dimension of the six-dimensional static verification fails, and to feed back the structured error reason along with the execution plan to the task planning module for replanning. The release module is used to release the execution plan and hand it over to the scheduling execution module for execution when all six-dimensional static verifications pass.

10. The apparatus according to claim 9, characterized in that, The feedback module is also used to: transfer the execution plan to manual processing when the number of replanning times exceeds a preset threshold, and record the interception event in the audit log.

11. The apparatus according to claim 9, characterized in that, The degradation strategy semantic constraint verification unit is specifically used for: Extract the user's original business conditions set from the intent parsing results. The original business conditions include at least one of the following: amount threshold, time range, and region filtering conditions. The parameters referenced in the degradation strategy are compared one by one with the original set of business conditions; If any original business condition is deleted or relaxed in the downgrade policy, it is considered a violation; If the downgrade strategy only involves the form of the downgrade result or an explicit error, it is considered to pass; The criteria for relaxation include at least one of the following: a reduction or increase in the amount or numerical threshold to a more lenient value is considered relaxation; an expansion of the numerical range is considered relaxation; an expansion of the time range window is considered relaxation; the deletion of the filtering condition is considered relaxation; and the enumeration condition allowing a more lenient value is considered relaxation.

12. The apparatus according to claim 9, characterized in that, In the parameter matching and verification unit, the format of the cross-step parameter reference is: {{steps.<step_id> .output.<json_path>}},in<json_path> This can be omitted; omitting it indicates referencing the entire output of the upstream step, and<json_path> Supports wildcard syntax for array elements [*]; the parameter matching and verification unit verifies the existence of the reference path in the output or output schema declared in the upstream step by parsing the reference expression and following the dependency chain.

13. The apparatus according to claim 9, characterized in that, The Restricted Expression Domain-Specific Language (DSL) only allows comparison operations, logical operations, and predefined aggregate functions, including len, sum, any, and all. The use of the eval function and any form of code execution instruction is prohibited.

14. The apparatus according to claim 9, characterized in that, The dependency validity verification unit is specifically used for: A directed graph is constructed based on the dependency declarations of each step, and the existence of cycles is detected by topological sorting; Verify that the step identifier referenced in each dependency declaration exists in the plan; Verify that there are no direct or indirect dependencies between steps in the same group within the concurrent group.

15. An electronic device comprising a processor and a memory, the memory storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the method of any one of claims 1 to 8.

16. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method of any one of claims 1 to 8.