AI agent distribution and permission control method and system

By generating dynamic intent contracts and verifying constraint compliance and semantic consistency, the rigidity problem of AI agent permission control models is solved, achieving dynamic adaptation and security of task execution, and is suitable for multi-agent collaborative scenarios.

CN120850274BActive Publication Date: 2025-12-09SICHUAN LEWEI TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202511354991.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-22
Publication Date
2025-12-09
Estimated Expiration
2045-09-22

AI Technical Summary

Technical Problem

Existing AI agent permission control models are usually static, making it difficult to adapt to dynamic changes in tasks, and lack an effective verification mechanism to verify the consistency between the agent's execution intention and the user's original intention, which may lead to intention deviation and permission abuse.

Method used

By generating dynamic intent contracts, which include intent summaries and execution constraints, the constraint compliance and semantic consistency of AI agent action plans are verified, and temporary capability credentials are authorized before execution. A contract modification process is introduced to adapt to environmental changes.

Benefits of technology

Ensure that the action plan of the AI ​​agent is consistent with the user's original intent at the logical and semantic level, can dynamically adjust behavior to adapt to environmental changes, achieve safe and continuous task execution, and realize the secure transfer and controllable decomposition of permissions in multi-agent collaboration scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120850274B_ABST
    Figure CN120850274B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of artificial intelligence, and discloses an AI intelligent agent distribution and permission control method and system, which takes a dynamic intention contract as a core: through a hierarchical contract mechanism, a complex main task is safely decomposed into multiple subtasks, a sub-contract inherited and narrowed from the main contract constraint is generated for the subtasks, and a tree-shaped trust chain capable of being verified in a backward direction is constructed by using an encryption pointer, so that fine allocation and control of permissions are realized; secondly, the method has self-adaptive correction capability; when an intelligent agent fails to execute due to environmental changes, a correction proposal can be autonomously generated; the system will re-verify based on the original contract and new environmental facts, and only after verification, a temporary ability voucher is granted for the correction operation. Through the closed-loop control of pre-prevention, in-process supervision and post-adaptive correction, the safety, autonomy and reliability of the AI intelligent agent in executing a task are significantly improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of artificial intelligence, in particular to an AI agent distribution and permission control method and system. BACKGROUND

[0002] With the rapid development of artificial intelligence technology, AI agents (Agents) are evolving from tools that execute single, pre-set instructions into intelligent entities that can autonomously plan and execute complex, multi-step tasks. However, existing permission control and behavior management mechanisms for AI agents have significant limitations in dealing with such highly dynamic and complex task requirements.

[0003] Traditional permission control models, such as Role-Based Access Control (RBAC), typically use static authorization strategies. This mechanism pre-configures a fixed set of permissions for the agent, lacking dynamic awareness of the task context. When user intentions are complex and varied, this rigid authorization method struggles to strike a balance between security and functionality: either overly broad permissions are granted to ensure task completion, introducing potential security risks, or the agent frequently fails when encountering unexpected situations due to insufficient permissions, unable to effectively complete the task.

[0004] Furthermore, existing technologies are particularly vulnerable when dealing with execution exceptions and environmental changes. When an AI agent encounters a failure while following a predetermined plan to perform an operation, the system often only interrupts the task and reports errors, lacking a safe, closed-loop adaptive correction mechanism. The system cannot dynamically and safely grant the agent temporary permissions needed to complete the correction action, significantly compromising its autonomy and robustness.

[0005] For complex scenarios requiring collaboration among multiple agents, existing technologies also fail to provide effective hierarchical control solutions. After the task is decomposed, the execution of each sub-task is often isolated, lacking a unified framework to ensure that their behavior always aligns with the overall goals and constraints of the main task (such as total budget, security policies), which easily leads to goal deviation and resource abuse.

[0006] Therefore, there is an urgent need for a new technical solution to address the technical pain points of existing AI agent permission control rigidity, lack of task context awareness, inability to safely adaptively correct, and difficulty in hierarchical control. SUMMARY

[0007] The technical problem to be solved by the present application is that the AI agent permission control model in the prior art is usually static, difficult to adapt to the dynamic changes of tasks, and lacks effective verification mechanisms for the execution intentions of agents and the original intentions of users, which may lead to intention deviation and permission abuse. Figure One ​

[0008] To solve the above technical problems, the present application provides the following technical solutions:

[0009] The first aspect of the present application provides an AI agent distribution and permission control method, which comprises the following steps:

[0010] Receiving a natural language instruction of a user, and generating a dynamic intent contract based on the natural language instruction; the dynamic intent contract contains an intent abstract corresponding to the natural language instruction and an execution constraint extracted from the natural language instruction;

[0011] Distributing the dynamic intent contract to an execution environment of an AI agent;

[0012] The AI agent generates an action plan according to the intent abstract and the execution constraint in the dynamic intent contract;

[0013] Before the AI agent executes the action plan, a contract verification module is called to verify the action plan;

[0014] After the contract verification module passes the verification, the AI agent is authorized to execute the action plan.

[0015] In one specific embodiment, the step of the contract verification module verifying the action plan comprises:

[0016] Constraint compliance verification: checking whether the parameters of each operation step contained in the action plan meet the execution constraint in the dynamic intent contract;

[0017] Semantic consistency verification: under the condition that the constraint compliance verification passes, calculating a plan abstract of the action plan, and judging whether the semantic alignment degree between the plan abstract and the intent abstract in the dynamic intent contract is not less than a preset alignment threshold.

[0018] Preferably, the step of semantic consistency verification specifically comprises:

[0019] Converting the natural language instruction into the intent abstract by using a first preset model;

[0020] Converting the action plan into the plan abstract by using the first preset model or a second preset model;

[0021] Calculating the semantic alignment degree between the intent abstract and the plan abstract by using a third preset model.

[0022] In one specific embodiment, the step of authorizing the AI agent to execute the action plan comprises:

[0023] For each operation step in the action plan, before the operation step is executed, a temporary capability credential corresponding to the operation step is generated and granted to the AI agent;

[0024] After the operation step is executed, the temporary capability credential is invalidated or destroyed.

[0025] In one embodiment, the method further comprises a contract amendment procedure. When an external environment change is detected during the execution of the action plan by the AI agent, which causes the action plan to be unable to continue execution, the contract amendment procedure is initiated.

[0026] The contract amendment procedure comprises:

[0027] The AI agent generates an amendment proposal containing a new plan segment;

[0028] The amendment proposal is updated to the dynamic intent contract;

[0029] And the amended action plan containing the new plan segment is re-verified by the contract verification module.

[0030] Further, when the contract verification module re-verifies the amended action plan, in the step of performing semantic consistency verification, the external environment change is taken as context information to participate in the semantic alignment calculation between the amended action plan and the intent summary.

[0031] In one embodiment, when the action plan contains a sub-task that needs to be executed by another AI agent, the method further comprises:

[0032] An AI agent holding a master dynamic intent contract generates a sub-dynamic intent contract for the sub-task;

[0033] The sub-dynamic intent contract is linked to the master dynamic intent contract through an encryption pointer, and inherits or narrows the execution constraints of the master dynamic intent contract.

[0034] Preferably, when generating a sub-dynamic intent contract for the sub-task, a preset intent combination function is used to combine the intent summary of the master dynamic intent contract and the description of the sub-task to generate a sub-intent summary of the sub-dynamic intent contract.

[0035] Further, when verifying the sub-action plan associated with the sub-dynamic intent contract, the verification step further comprises:

[0036] Tracing back and checking the authorization scope of the sub-dynamic intent contract and its associated sub-action plan to determine that it does not exceed the authorization scope of the master dynamic intent contract.

[0037] The second aspect of the present application provides an AI agent distribution and permission control system, comprising:

[0038] An intention processing module, configured to receive a natural language instruction of a user, and generate a dynamic intention contract based on the natural language instruction, the dynamic intention contract containing an intention abstract corresponding to the natural language instruction and execution constraints extracted from the natural language instruction;

[0039] An AI agent, configured to receive the dynamic intention contract, and generate an action plan according to the intention abstract and the execution constraints in the dynamic intention contract;

[0040] A contract verification module, configured to verify the action plan before the AI agent executes the action plan, and authorize the action plan after verification;

[0041] An authorization management module, configured to provide a temporary capability voucher for the AI agent to execute the action plan according to the authorization result of the contract verification module.

[0042] The present application provides an AI agent distribution and permission control method and system. The following beneficial effects are achieved:

[0043] 1. The present application verifies the action plan generated by the AI agent by using the contract verification module before execution, and ensures that the action plan is consistent with the dynamic intention contract containing the original intention of the user in terms of logic and semantics. This double verification mechanism effectively prevents unexpected behavior caused by AI understanding deviation or autonomous planning deviation.

[0044] 2. The present application introduces a contract amendment process. When the original action plan is blocked due to changes in the external environment, the AI agent can generate a revised proposal, and the contract verification module re-verifies the revised action plan. This mechanism allows the agent to dynamically adjust its behavior without interrupting the task and violating the original intention constraints, thereby adapting to environmental changes and ensuring continuous execution of the task.

[0045] 3. The present application generates a sub-dynamic intention contract, and the main agent can delegate sub-tasks to other AI agents. The sub-dynamic intention contract inherits and narrows the execution constraints of the main contract, and through a hierarchical verification mechanism, it ensures that the execution permission of the sub-task does not exceed the authorized range of the main task, realizes the safe transmission and controllable decomposition of permissions among multiple agents, and is suitable for processing large-scale, distributed complex tasks. BRIEF DESCRIPTION OF DRAWINGS

[0046] Figure 1 The figure is a schematic diagram of the architecture of the AI agent distribution and permission control system of an embodiment of the present application.

[0047] Figure 2 a flowchart of an AI agent distribution and permission control method according to an embodiment of the present application;

[0048] Figure 3 a schematic diagram of a dynamic intention contract structure and its generation process according to an embodiment of the present application;

[0049] Figure 4 a schematic diagram of the internal processing flow of a contract verification module according to an embodiment of the present application;

[0050] Figure 5 a schematic diagram of instant authorization and temporary capability voucher circulation according to an embodiment of the present application;

[0051] Figure 6 a schematic diagram of contract adaptive correction and re-verification flow according to an embodiment of the present application;

[0052] Figure 7 a schematic diagram of sub-contract generation and hierarchical verification flow according to an embodiment of the present application.

[0053] Among them, 10, intention processing module; 20, AI agent; 30, contract verification module; 40, authorization management module; 300, dynamic intention contract; 310, intention abstract; 320, execution constraint; 410, constraint compliance verification stage; 420, semantic consistency verification stage. DETAILED DESCRIPTION

[0054] In order to make the purpose, technical scheme and advantages of the present application clearer, the technical scheme in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.

[0055] Referring to the drawings Figure 1 , Figure 1 is a schematic diagram of the architecture of an AI agent distribution and permission control system according to an embodiment of the present application. The present application provides an AI agent distribution and permission control system, which can include: an intention processing module 10, an AI agent 20, a contract verification module 30 and an authorization management module 40.

[0056] An intent processing module 10 is configured to receive a natural language instruction from a user and generate a structured data object, i.e., a dynamic intent contract, based on the natural language instruction. The dynamic intent contract contains an intent summary converted from the natural language instruction and a set of execution constraints extracted from the natural language instruction. The intent processing module 10 outputs the generated dynamic intent contract through a pre-set interface.

[0057] An AI agent 20 is deployed in an execution environment. The AI agent 20 is configured to receive the dynamic intent contract from the intent processing module 10. The AI agent 20 performs task planning based on the intent summary and the execution constraints contained in the dynamic intent contract and generates a sequence of one or more specific operation steps, i.e., an action plan. After the action plan is generated, the AI agent 20 submits the action plan to a contract verification module 30 for verification.

[0058] The contract verification module 30 is connected to the AI agent 20 and an authorization management module 40 through a data interface. The module is configured to receive the action plan submitted by the AI agent 20 and verify the compliance and consistency of the action plan according to the dynamic intent contract corresponding to the action plan. The verification process includes checking whether each operation step of the action plan complies with the execution constraints in the dynamic intent contract and calculating the semantic alignment degree between the action plan and the original intent. After the verification is completed, the contract verification module 30 outputs a verification result. Figure One

[0059] The authorization management module 40 is configured to receive the verification result from the contract verification module 30. When the verification result is passed, the authorization management module 40 is activated to generate and grant a temporary capability credential with a limited scope and a life cycle for a single operation step in the action plan to be executed by the AI agent 20. The credential enables the AI agent 20 to obtain the permission required to execute the single operation step. After the corresponding operation step is executed, the credential is invalidated.

[0060] In the workflow of the entire system, data and control signals are transmitted in the following order: the natural language instruction of the user is input into the intent processing module 10, which generates and distributes the dynamic intent contract to the AI agent 20. The AI agent 20 generates an action plan based on the contract and submits it to the contract verification module 30. After the contract verification module 30 passes the verification, it sends an authorization instruction to the authorization management module 40. The authorization management module 40 grants a temporary capability credential for a single operation of the AI agent 20, which uses the credential to execute the operation. This series of interrelated steps constitutes a closed-loop permission control and execution supervision process.

[0061] The accompanying drawings are referred to in order to provide a better understanding of the present application. Figure 2 , Figure 2 ​Fig. 1 is a flowchart of an AI agent distribution and permission control method according to an embodiment of the present application. The present application provides an AI agent distribution and permission control method, which can be applied to the system shown in Fig. 1. The method specifically includes the following steps: Figure 1

[0062] Step S201, the intent processing module 10 receives the natural language instruction input by the user terminal device, and generates a dynamic intent contract based on the instruction.

[0063] The generation process specifically includes two parallel processing branches:

[0064] First, the semantic processing unit inside the intent processing module 10 uses a pre-trained language model (such as an encoder based on the Transformer architecture) to map the complete natural language instruction text into a high-dimensional intent summary vector. This vector represents the core purpose of the user's instruction in the semantic space.

[0065] Second, the constraint extraction unit inside the intent processing module 10 performs entity recognition and rule matching on the natural language instruction to parse out structured execution constraints, such as upper limit of amount, time range, geographic location, prohibited operation list, etc.

[0066] Finally, the generated intent summary vector and execution constraint set are encapsulated into a unified data structure, i.e. a dynamic intent contract.

[0067] Step S202, the intent processing module 10 distributes the generated dynamic intent contract to the execution environment where the AI agent 20 is located through the internal communication bus or secure API interface of the system.

[0068] This distribution process ensures that the AI agent 20 obtains the initial processed and encapsulated unique task instruction source.

[0069] Step S203, the AI agent 20 receives and parses the dynamic intent contract.

[0070] The intent summary is taken as the top-level goal of task planning, and the execution constraints are taken as the boundary conditions in the planning process.

[0071] Based on its own tool or API calling capability, the AI agent 20 decomposes the task and generates an action plan composed of a series of ordered or parallel operation steps. Each operation step clearly defines the function or API to be called and the specific parameters required to execute the function.

[0072] Step S204, before executing any operation, the AI agent 20 must submit the complete action plan to the contract verification module 30 for verification. ​

[0073] The contract verification module 30 first performs a constraint compliance verification, i.e. checks whether the parameters of each operation step in the action plan are strictly within the range defined by the execution constraints in the dynamic intention contract.

[0074] After the constraint compliance verification passes, a semantic consistency verification is then performed. This process inputs the entire action plan text or its structured representation into a language model that is homogenous or compatible with the one used to generate the intention abstract, to generate a plan abstract vector.

[0075] Subsequently, the cosine similarity or Euclidean distance between the plan abstract vector and the intention abstract vector in the dynamic intention contract is calculated to obtain a quantitative semantic alignment degree. The alignment degree is compared with a preset alignment threshold, and only when the alignment degree is not less than the threshold, the semantic consistency verification passes.

[0076] Step S205, only when the contract verification module 30 completes the above-mentioned double verification and returns a verification pass result, the system enters the authorization and execution phase.

[0077] The contract verification module 30 sends an authorization signal to the authorization management module 40, which specifies the first operation to be executed in the action plan.

[0078] The authorization management module 40 generates a temporary capability credential for the AI agent 20 based on the single operation, which has a very short life cycle. The AI agent 20 uses the credential to execute the operation, and the credential is invalidated as soon as the operation is completed. Subsequently, the system loops this authorization process to authorize the next operation step in the action plan, until the entire action plan is executed.

[0079] If the verification of any step fails, the process is interrupted and an exception is reported to the user or the monitoring system.

[0080] Referring to the accompanying drawings Figure 3 , Figure 3 is a schematic diagram of the structure of a dynamic intention contract and its generation process according to an embodiment of the present application. The technical solution of the present application relies on a core data structure, i.e. a dynamic intention contract (DIC). The contract is a structured carrier that connects user intentions and AI agent execution behaviors.

[0081] The dynamic intention contract is a data object, and its specific implementation can be a JSON or XML format document. The data object mainly includes two core components: an intention abstract and execution constraints. The intention abstract is a structured representation of the user's intention, which is used to guide the AI agent to execute the action plan. Figure 3 An example structure of a dynamic intention contract 300 is shown.

[0082] The first component of the dynamic intent contract is the intent summary 310. The intent summary is a high-dimensional mathematical vector that precisely encodes the user's natural language instruction in the semantic space. The generation process of the intent summary, which is part of the aforementioned step S201, is accomplished by the intent processing module 10.

[0083] In particular, the intent processing module 10 employs a first pre-set model, denoted as When receiving the user's original natural language instruction, denoted as (e.g., "Help me book a flight from Shanghai to Beijing tomorrow night, with a price no more than 1000 yuan"), the instruction is input into the model . The model encodes the input text and outputs a fixed-dimension vector, which is the intent summary . This process can be represented by the following formula:

[0084] ;

[0085] wherein, is the input natural language instruction text, is the semantic encoding function (i.e., the first pre-set model), is the output intent summary vector. This vector captures the core semantics of the instruction, such as "book a flight", "Shanghai to Beijing", "tomorrow night", "price limit".

[0086] The first pre-set model can be one of the various pre-trained language models based on the Transformer architecture, such as BERT, RoBERTa, or T5. This model can be deployed as a standalone microservice, and the intent processing module 10 communicates with it through remote procedure calls (RPC); or, this model can also be directly integrated as a library inside the process of the intent processing module 10.

[0087] In a specific embodiment, in order to improve the understanding accuracy of instructions in a specific domain, the first pre-set model can be fine-tuned using a specific domain instruction-intent pair dataset based on a general pre-trained model. For example, in a flight booking application scenario, a dataset containing samples such as "(book a flight from Beijing to Shanghai, budget 800 yuan), (book_flight, beijing, shanghai, price<=800)" can be used for training, so that the model is more accurate in mapping semantics in this vertical domain.

[0088] The output intent summary vector is a dense real-valued vector, which can be 768-dimensional or 1024-dimensional. The semantic space that this vector resides in has a property that: the cosine similarity in vector space or the Euclidean distance in the vector space between the intent summary vectors generated from semantically similar natural language instructions are higher. This property is the technical basis for subsequent semantic consistency verification.

[0089] The second component of this dynamic intent contract is the execution constraints 320. The execution constraints are a set of structured key-value pairs or rule sets that explicitly define the boundary conditions that the AI agent cannot exceed when executing the task.

[0090] These constraints are also extracted by the intent processing module 10 from the natural language instruction in step S201. The extraction process can utilize named entity recognition (NER) techniques and rule template matching. For example, from the instruction "Help me book a flight from Shanghai to Beijing tomorrow night, with a price not exceeding 1000 yuan", the following execution constraints can be extracted:

[0091] task_type: "book_flight" (task type).

[0092] departure_city: "Shanghai" (departure city).

[0093] destination_city: "Beijing" (destination city).

[0094] departure_date: "2024-07-26" (departure date).

[0095] price_cap: {"amount": 1000, "currency": "CNY"} (price cap).

[0096] allowed_apis: ["query_flights", "book_flight_ticket"] (allowed API list).

[0097] denied_apis: ["cancel_flight_ticket"] (denied API list).

[0098] These execution constraints 320, together with the intent summary 310, constitute the complete dynamic intent contract 300. In the subsequent steps, the AI agent 20 must meet both requirements:

[0099] the final goal of its action plan must be consistent with the intent summary ​semantically aligned, and each of its concrete operation steps cannot violate any of the rules defined in the execution constraints 320.

[0100] In this way, the dynamic intent contract translates the user's ambiguous, unstructured natural language instructions into a precise, machine-readable, semantically-grounded execution framework with rigid boundaries, providing the basis for subsequent verification and authorization steps.

[0101] Referring to the accompanying drawings Figure 4 , Figure 4 is a schematic diagram of the internal processing flow of the contract verification module according to an embodiment of the present application. The contract verification module 30 is the component that performs supervision and risk control, which is executed in the aforementioned step S204 to review the action plan generated by the AI agent 20.

[0102] When the contract verification module 30 receives the action plan, it initiates a dual verification mechanism, which includes a constraint compliance verification phase 410 and a semantic consistency verification phase 420. The action plan must pass the verification of both phases in sequence to be deemed compliant.

[0103] First, the system enters the constraint compliance verification phase 410. In this phase, the contract verification module 30 performs a deterministic comparison of each operation step in the action plan with the execution constraints 320 in the dynamic intent contract. For example, an action plan can contain two steps:

[0104] [1. call query_flights(from="Shanghai", to="Beijing"), 2. call book_flight_ticket(flight_id="MU5101", price=1100)].

[0105] The verification module checks the allowed_apis constraint in the dynamic intent contract and confirms that both query_flights and book_flight_ticket are within the permitted range. Then it checks the price_cap constraint (e.g., {"amount": 1000, "currency": "CNY"}), and finds that the price 1100 in step 2 exceeds the upper limit of 1000. Therefore, the constraint compliance verification fails at this point and immediately reports the specific violation reason to the system, preventing the execution of the action plan.

[0106] Only when the action plan passes the constraint compliance verification completely, the system enters the semantic consistency verification phase 420. The core task of this phase is to judge whether the behavior planned by the AI agent is semantically consistent with the user's original intent Figure Oneto prevent the AI agent from "misinterpreting" or "deviating" from the user's fundamental goal without violating the explicit constraints.

[0107] The process of semantic consistency verification relies on a second preset model and a third preset model.

[0108] Firstly, the structured action plan (e.g., a series of function calls) generated by the AI agent needs to be converted into a piece of natural language description text, denoted as , through a preset template or serialization method. For example, the aforementioned action plan can be converted into: "First, query the flight from Shanghai to Beijing, then book a ticket for flight number MU5101 at a price of 1100 yuan."

[0109] Subsequently, the second preset model (which has the same or compatible model structure as the first preset model ) encodes the text into an action plan summary vector .

[0110] In a specific embodiment, the first preset model and the second preset model can share the same large-scale corpus pre-trained Transformer encoder bottom layer (e.g., BERT or RoBERTa). During the training phase, the two model branches can be regarded as two input towers of the same twin network, which are jointly optimized to map semantically related intents and action plans to adjacent positions in the vector space. This shared weight structure not only guarantees the unity of the vector space, but also greatly improves the training efficiency and generalization ability of the model.

[0111] Next, the third preset model is responsible for calculating the semantic alignment degree between the intent summary vector and the plan summary vector .

[0112] In a preferred embodiment, the implementation of the third preset model is based on the training idea of a Siamese Network. Specifically, the first preset model and the second preset model jointly constitute the two encoder branches of the Siamese Network.

[0113] In the training phase, a large amount of (user intent, positive action plan) and (user intent, negative action plan) triple data is input to the network. The goal of training (for example, through a contrastive loss function Contrastive Loss) is to make the vector pair generated by the positive pair as small as possible in the semantic space, and the vector pair generated by the negative pair as large as possible in the semantic space. The distance in the semantic space is as small as possible, while the distance of the vector pair generated by the negative pair is as large as possible.

[0114] The triple data used to train the twin network can be obtained in various ways: for example, existing user service logs can be used, taking the user request and the final successfully executed operation sequence as a positive pair; through manual annotation or the introduction of rules, taking the user request and the operation sequence that is rejected or leads to user complaints as a negative pair; or, through a large language model, data augmentation can be performed to generate multiple semantically consistent or inconsistent action plans for a user intent, thereby synthesizing a large amount of training data.

[0115] After training in this way, the vectors generated by the two encoders are in a unified and discriminative semantic space. Therefore, in actual operation, the third preset model The core function can be directly realized by calculating the cosine similarity of the two vectors:

[0116] ;

[0117] The similarity score Directly quantifies the alignment degree of the action plan and the user intent.

[0118] Finally, the calculated semantic alignment score Is compared with a preset alignment threshold The threshold (for example, 0.95) is part of the system safety policy, and its setting is usually based on precision-recall trade-off analysis on a large amount of test data, aiming to ensure that the system can both reject potential risk deviation behaviors and pass reasonable plans that are semantically consistent but slightly different in expression. Only when The semantic consistency verification passes.

[0119] The contract verification module 30 only outputs a verification pass signal when the action plan passes both the constraint compliance and semantic consistency verification stages, which authorizes the subsequent safe execution.

[0120] Referring to the accompanying Figure 5 , Figure 5Figure 1 is a flowchart illustrating the process of instant authorization and temporary capability credentialing according to an embodiment of the present invention. The security system of the present invention adheres to the principle of least privilege, i.e. an AI agent is granted only the minimum privilege necessary to execute the single operation step that has been verified at the current moment. This principle is realized through the authorization management module 40 and the temporary capability credentialing mechanism.

[0121] In the aforementioned step S204, the contract verification module 30 verifies the action plan submitted by the AI agent 20. Instead of authorizing the entire plan at once, the present invention adopts a step-by-step authorization mode. Only when the first operation step in the action plan (e.g. call query_flights(...)) passes the dual verification of constraint compliance and semantic consistency, the contract verification module 30 sends an authorization instruction to the authorization management module 40, which contains all the details of the single operation step that has passed the verification.

[0122] Upon receiving the authorization instruction, the authorization management module 40 instantaneously generates a temporary capability credential. In a preferred embodiment, the credential adopts the industry-standard JSON Web Token (JWT) format. Instead of a general and broad authorization token, the JWT is a precise credential that is tightly bound to a specific operation step and has an extremely short lifetime. Its Payload part contains the following key fields:

[0123] iss (Issuer): the credential issuer, i.e. the unique identifier of the authorization management module 40.

[0124] sub (Subject): the credential user, i.e. the unique identifier of the current AI agent instance 20.

[0125] aud (Audience): the credential receiver, i.e. the unique identifier of the target tool or API that the operation step will call (e.g. "FlightBookingAPI").

[0126] exp (Expiration Time): the expiration timestamp of the credential. The time is set very short, e.g. 5 seconds from the issuance time, just enough for the AI agent to complete one network call.

[0127] jti (JWT ID): a unique credential ID, used to prevent replay attacks.

[0128] cap (Capability): this is a custom core field, whose content is directly derived from the verified operation step, defining the authorized capability in the form of a structured object.

[0129] This cap field limits the scope of the authorization to the action of calling query_flights, and the parameters must match exactly.

[0130] The life cycle of the credential is as follows:

[0131] 1. Issue: The authorization management module 40 signs the JWT using its private key, generates a temporary capability credential, and issues it to the AI agent 20.

[0132] To ensure the absolute security of the signature, the private key used by the authorization management module 40 is stored in a hardware security module (HSM) or a dedicated cloud key management service (KMS). All signature operations are completed in these secure environments, and the private key itself is never exposed to the application layer, thereby eliminating the risk of key leakage due to the service itself being compromised. The corresponding public key is securely distributed to all target tools / APIs that need to verify the credential.

[0133] 2. Use and verification: When the AI agent 20 performs an operation step, it must attach this credential in the request sent to the target tool / API (usually in the Authorization header of HTTP). After receiving the request, the target tool / API first verifies the signature of the credential using the public key of the authorization management module, then checks the exp, aud, etc. fields, and most importantly, it will strictly compare the action and params declared in the cap field of the credential with the actual operation and parameters of the current request. Only when they are completely consistent will the operation be executed. Any mismatch (such as the AI agent trying to modify the parameters arbitrarily) will result in the request being rejected.

[0134] 3. Expire: Once the operation is executed, or the credential expires due to timeout, the credential is permanently invalidated. If the AI agent 20 wants to execute the next step in the action plan, it must submit the step along with the necessary context to the contract verification module 30 again, repeating the entire "verification-authorization-execution" cycle.

[0135] Through this mechanism of instant issuance, precise binding, and temporary capability credentials that are burned after use, the present application ensures that every step of the AI agent's action is under monitoring, eliminating the abuse of authority and potential overstepping behavior, thereby building a dynamic, fine-grained, and highly secure AI agent execution environment.

[0136] Referring to the accompanying Figure 6 , Figure 6Fig. 1 is a schematic diagram of a contract-adaptive revision and revalidation process according to an embodiment of the present invention. The present invention not only provides pre-emptive prevention and in-process supervision, but also possesses the ability to adapt and revise after the fact in response to dynamic environmental changes. This mechanism ensures that the AI agent can autonomously and safely adjust its behavior in the face of unexpected situations that arise during execution, without the need for service interruption or unnecessary human intervention.

[0137] The implementation principle of this mechanism is illustrated in detail below through a specific ticket booking scenario.

[0138] Suppose the user's initial instruction is "Book a flight from Shanghai to Beijing tomorrow night, with a price not exceeding 1000 yuan, and prefer to choose Eastern Airlines". The intent processing module 10 generates a dynamic intent contract containing an intent summary and execution constraints (price_cap <= 1000, preferred_carrier = "Eastern Airlines", etc.) accordingly. The initial action plan generated by the AI agent 20 can be:

[0139] 1. query_flights(..., carrier = "Eastern Airlines") -> returns a list of flights, with MU5101 as the first choice.

[0140] 2. book_flight_ticket(flight_id = "MU5101", price = 980).

[0141] Step 1: Detection and identification of execution failure

[0142] After being reviewed by the contract verification module 30, the AI agent 20 obtains a temporary capability credential for executing step 2 and attempts to call the book_flight_ticket interface. However, due to real-time changes in the ticketing system, this call fails. Instead of a successful confirmation, the target API tool returns a response containing explicit error information, such as an HTTP 409 Conflict status code, with a response body that is a structured data: {"error_code": "SEATS_SOLD_OUT", "message": "Flight MU5101 is sold out"}.

[0143] The internal logic of the AI agent 20 is designed to be able to parse such structured API responses. It not only identifies the operation failure, but more importantly, it understands the specific reason for the failure, which is "no tickets for the preferred flight". This information becomes a key environmental fact that triggers the subsequent revision process.

[0144] Step 2: Generate a "revision proposal" containing a new plan fragment

[0145] Upon identifying the cause of the failure, the AI agent 20 does not simply terminate the task. Instead, it initiates a local re-planning logic based on the known environmental facts.

[0146] The "re-planning logic" here is essentially a limited internal reasoning loop of the AI agent. The AI agent takes the original intent, the complete dynamic intent contract, and the newly acquired environmental fact ("Flight MU5101 is sold out") as context, and invokes its internal large language model reasoning core again to generate an alternative solution that satisfies the new constraint set. This process is not an unlimited re-creation, but a local optimization strictly within the contract boundaries and targeting the specific failure point.

[0147] The AI agent 20 consults its working memory for the unfiltered complete flight list returned by the query_flights operation in Step 1, and selects a sub-optimal option that satisfies all other constraints (such as price, destination, time) in the original dynamic intent contract, for example, China Southern Airlines' CA1832 flight at a price of 990 yuan.

[0148] Subsequently, the AI agent 20 generates a structured "correction proposal". This proposal is not an immediate execution instruction, but a data package to be reviewed, which includes:

[0149] Reference ID: pointing to the original dynamic intent contract ID.

[0150] Environmental context: the key fact leading to this correction, i.e., {"fact": "flight MU5101 is unavailable due to being sold out"}.

[0151] Modified action plan fragment: a new operation to replace the original failed step, i.e., call book_flight_ticket(flight_id="CA1832", price=990).

[0152] Step 3: Submission of the correction proposal and updating of the dynamic intent contract

[0153] The AI agent 20 submits this "correction proposal" to the intent processing module 10. Upon receiving the proposal, the intent processing module 10 does not directly modify the original dynamic intent contract to ensure the original intent's non-tamperability. Instead, it dynamically associates the "environmental context" information in the proposal as a temporary, additional constraint or fact with the original contract. At this point, the "contextualized contract" for this re-verification has logically evolved to: "maintain the original intent and constraints while knowing the fact that 'Flight MU5101 is sold out'."

[0154] Step 4: Contract Re-verification based on new context

[0155] The intent processing module 10 submits this "contextualized contract" along with the revised action plan fragment to the contract verification module 30 for re-verification.

[0156] Constraint compliance verification: The contract verification module 30 checks whether the new plan (booking CA1832 flight) still satisfies the original constraints, e.g. the price of 990 yuan does not exceed the upper limit of 1000 yuan.

[0157] Semantic consistency verification: This is the most critical step. When performing semantic alignment, the contract verification module 30 takes the new environmental context ("MU5101 is sold out") as background knowledge for its judgment. The third preset model In evaluating the alignment degree of the summary vector of the new plan with the original intent vector , its internal mechanism (such as the Transformer model based on attention mechanism) can recognize that, in the case where the preferred solution is not feasible, choosing an alternative solution that meets all other conditions is highly consistent with the user's fundamental intention of "booking a ticket". Therefore, although the specific flight has changed, the semantic alignment score will still be higher than the preset threshold .

[0158] Only after re-verification, the authorization management module 40 will issue a new temporary capability credential for this revised operation step. Through this closed-loop "execution-sensing-revision-reverification" process, the present invention enables the AI agent to exhibit high autonomy and adaptability to dynamic environments without sacrificing safety.

[0159] In addition, the present invention can also configure a risk escalation strategy. When the revision proposal involves changes that exceed the preset risk threshold (e.g. the price of the alternative solution is much higher than the original solution, or a completely new API needs to be called that did not appear in the original plan), or when consecutive multiple automatic revisions have all failed, the system can automatically push the "revision proposal" along with the complete context information to the artificial monitoring seat, and the final decision is made by the human operator. This provides a safety outlet for handling high-risk or high-ambiguity abnormal situations.

[0160] Referring to the accompanying Figure 7 , Figure 7Fig. 1 is a schematic diagram of sub-contract generation and hierarchical verification process according to an embodiment of the present application. For complex user intent that requires multi-step, cross-domain collaboration, the present application introduces a hierarchical contract management mechanism that can safely decompose a macroscopic main task into multiple sub-tasks that can be independently verified and executed.

[0161] The following is illustrated in detail through a scenario of "planning a complete business trip".

[0162] Suppose the initial instruction issued by the user is: "Help me plan a business trip from Shanghai to Beijing next week, for three days, with a total budget of no more than 3000 yuan."

[0163] A high-level planning-capable main AI agent (or "orchestration agent") receives the instruction and decomposes it into two main sub-tasks:

[0164] 1) Booking round-trip tickets;

[0165] 2) Booking a hotel.

[0166] At this point, the system starts the sub-contract generation and hierarchical verification process. The main AI agent now plays the role of "user" and requests the intent processing module 10 to generate a sub-dynamic intent contract for each sub-task. This process is not simply task assignment, but a process that includes permission inheritance and narrowing.

[0167] On the one hand, the sub-contract will automatically inherit all relevant global constraints in the main contract, for example, both the "booking tickets" and "booking a hotel" sub-contracts will inherit the constraints departure_city: "Shanghai", destination_city: "Beijing", trip_duration: "3 days", etc.

[0168] On the other hand, the main AI agent must explicitly allocate and refine shared resources or ambiguous constraints, for example, for the total budget of 3000 yuan, the main agent splits it according to its internal strategy, allocating 1200 yuan for the "booking tickets" sub-task and 1800 yuan for the "booking a hotel" sub-task, so in the sub-contract of "booking a hotel", its execution constraints will include a narrowing rule: price_cap: {"amount": 1800, "currency": "CNY"}.

[0169] After completing the inheritance and narrowing of physical constraints, the system also needs to ensure that the sub-tasks are consistent with the main task at the semantic level, because the intent of the sub-task is not isolated, it must carry the context of the main task. For example, the intent of "booking a hotel" is not to book any hotel, but to book a hotel for "this business trip".

[0170] To achieve this association at the semantic level, the system employs an intent composition function, denoted as , to generate the sub-intent vector . This function takes as input the main intent summary vector (representing "plan business trip") and a vector generated from the text describing the sub-task (e.g., "book hotel").

[0171] In a more optimal embodiment, the intent composition function can be implemented using a cross-attention mechanism. Specifically, the vector describing the sub-task is taken as the query (Query), and the main intent summary vector is taken as the key (Key) and value (Value). In this way, the model can calculate the relevance of the sub-task description to each semantic dimension of the main intent and selectively extract the most relevant contextual information from the main intent, weighted and fused to generate a highly contextualized sub-intent vector .

[0172] In a specific embodiment, can be a small feedforward neural network or attention network that concatenates or fuses and to output a completely new sub-intent vector that contains the context of the main task. In this way, the sub-intent vector not only encodes the "book hotel" action, but also implicitly contains semantic information such as "for business purposes", "in Beijing", "for three days" from the main intent.

[0173] When the sub-AI agent responsible for executing the "book hotel" task generates its action plan and submits it for verification, the system will perform a hierarchical verification to ensure that this hierarchical authorization system is strictly enforced. To this end, when the intent processing module 10 generates the sub-contract, it will automatically embed an "encrypted pointer" in the sub-contract. This pointer is not a mutable memory address, but an unalterable cryptographic hash value pointing to its parent contract, for example, the value obtained by performing SHA-256 operation on the unique ID and key content of the main contract, denoted as .

[0174] When verifying the action plan of the sub-task, the contract verification module 30 will first perform local verification, i.e., perform standard constraint compliance and semantic consistency verification, and compare the action plan of the sub-task with the execution constraints of the sub-contract and the sub-intent vector .

[0175] After the local verification passes, the contract verification module then performs a backtracking verification, which reads the field in the sub-contract and uses the hash value to securely retrieve the main contract from a trusted contract repository.

[0176] To ensure the integrity and tamper-proofing of the contracts and their hierarchical relationships, the "trusted contract repository" can be built based on tamper-proofing databases or private blockchain technologies. Whenever a main contract or sub-contract is created, it is recorded as a transaction, and its content and parent-child relationship (linked through parent_contract_hash) are permanently fixed. This design makes it easy to detect any illegal modification of the issued contract, thereby providing a trust foundation for hierarchical verification.

[0177] Subsequently, the contract verification module 30 performs an additional cross-layer check, for example, checking whether the specific date in the sub-task action plan falls within the "next week" range specified in the main contract, and verifying that the sub-task's expense (such as the total price of the hotel order of 1750 yuan) meets the sub-contract's budget (1800 yuan), while ensuring that the total budget allocated to all sub-tasks does not exceed the main contract's total budget of 3000 yuan.

[0178] Only when both the local verification and the backtracking verification pass, the sub-task's action steps will be authorized to execute. Through this sub-contract generation, permission narrowing, intent combination, and hierarchical verification mechanism based on encrypted pointers, the invention can firmly lock the control of complex tasks in a tree-shaped trust chain, ensuring the overall safety, consistency, and controllability of AI agents when executing complex collaborative tasks.

[0179] In summary, the invention discloses a closed-loop governance framework for AI agents that is safe, aligned, and adaptable. Based on dynamic intent contracts, the invention converts users' high-level intentions into machine-readable, verifiable structured rules and semantic benchmarks, clearly defining the boundaries of AI agents' behavior from the source.

[0180] On this basis, the invention, through the contract verification module, its unique "constraint compliance verification" and "semantic consistency verification" double-checking mechanism, not only can review the parameters and permissions of operations like traditional programs, but also can deeply understand and judge whether the AI's action plan is highly aligned with the user's fundamental intention at the semantic level, thereby effectively preventing potential risks caused by model hallucinations or understanding biases.

[0181] At the implementation level, the present application implements the "least privilege principle" into each specific operation through the instant authorization and temporary capability certificate mechanism. This "burn after use" authorization, which is accurate to a single API call and has a very short life cycle, fundamentally eliminates the risk of replay attacks after the abuse of permissions and the theft of certificates, and builds a dynamic and fine-grained in-process supervision system.

[0182] More importantly, the present application is not a static defense system. Through the adaptive revision mechanism of the contract, the present application gives the system the robust ability to handle real-world dynamic changes and execution uncertainties. When encountering obstacles, the AI agent can safely generate revision proposals and ensure that its adjusted behavior remains faithful to the original intent through a revalidation process that includes new environmental context. At the same time, through the generation and hierarchical verification mechanism of sub-contracts, the present application can safely decompose and delegate complex tasks, use encrypted pointers to ensure that the execution of each sub-task is always under the jurisdiction of the main contract, and demonstrate its scalability.

[0183] Finally, through the organic synergy of the above modules, the present application forms a complete governance closed loop from intent understanding, pre-verification, in-process control to post-adaptation, ensuring that the AI agent always remains safe and controllable, intent-aligned and flexible and efficient when executing complex tasks in an open environment, providing a solid and reliable security guarantee for the deep application of AI technology in key fields.

[0184] Although embodiments of the present application have been shown and described, it will be understood by those having ordinary skill in the art that various changes, modifications, substitutions and alterations can be made hereto without departing from the principles and spirit of the present application, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A method for distributing and controlling permissions of AI intelligent agents, characterized in that, Includes the following steps: The system receives natural language instructions from users and generates dynamic intent contracts based on these instructions. The dynamic intent contracts include an intent summary corresponding to the natural language instructions and execution constraints extracted from the natural language instructions. Distribute the dynamic intent contract to the execution environment of the AI ​​agent; The AI ​​agent generates an action plan based on the intent summary and execution constraints in the dynamic intent contract; The action plan is verified before the AI ​​agent executes it. When the verification is successful, the AI ​​agent is authorized to execute the action plan; The steps of authorizing the AI ​​agent to execute the action plan include: For each operational step in the action plan, before execution, a temporary capability credential corresponding to the operational step is generated and granted to the AI ​​agent. After the above operation steps are completed, the temporary capability certificate is invalidated.

2. The AI ​​agent distribution and access control method according to claim 1, characterized in that, The steps for validating the action plan include: Constraint compliance verification: Check whether the operational parameters in the action plan comply with the execution constraints in the dynamic intent contract; Semantic consistency verification: When the constraint compliance verification passes, calculate the plan summary of the action plan and determine whether the semantic alignment between the plan summary and the intent summary in the dynamic intent contract meets the preset alignment threshold.

3. The AI ​​agent distribution and access control method according to claim 2, characterized in that, The steps of the semantic consistency verification include: The natural language instruction is converted into the intent summary using a first preset model; The action plan is converted into the plan summary using either the first preset model or the second preset model. The semantic alignment between the intent summary and the plan summary is calculated using a third preset model.

4. The AI ​​agent distribution and access control method according to claim 2, characterized in that, The method further includes: If, during the execution of the action plan by the AI ​​agent, an external environmental change is detected that would prevent the action plan from continuing, a contract correction process is initiated. The contract amendment process includes: The AI ​​agent generates a revised proposal that includes new plan segments; Update the proposed amendment to the dynamic intent contract; The revised action plan, which includes the new plan segments, will be re-verified.

5. The AI ​​agent distribution and access control method according to claim 4, characterized in that, The step of re-verifying the revised action plan containing the new plan fragment includes: Perform the constraint compliance verification and semantic consistency verification again; Specifically, when performing the semantic consistency verification, the changes in the external environment are used as context information and participate in the semantic alignment calculation between the revised action plan and the intent summary.

6. The AI ​​agent distribution and access control method according to claim 1, characterized in that, The method further includes: When the action plan includes sub-tasks that need to be performed by other AI agents, the AI ​​agent holding the main dynamic intent contract generates a sub-dynamic intent contract for the sub-tasks. The sub-dynamic intent contract is linked to the main dynamic intent contract through an encrypted pointer, and inherits or narrows the execution constraints of the main dynamic intent contract.

7. The AI ​​agent distribution and access control method according to claim 6, characterized in that, The steps for generating a sub-dynamic intent contract for the sub-task include: A sub-intention summary of the sub-dynamic intention contract is generated by using a preset intention combination function, combining the intention summary of the main dynamic intention contract and the description of the sub-task.

8. The AI ​​agent distribution and access control method according to claim 6, characterized in that, The verification of the sub-action plan associated with the sub-dynamic intent contract also includes: Retrospectively examine and verify whether the scope of authorization of the sub-dynamic intent contract and its associated sub-action plans is fully encompassed by the scope of authorization of the main dynamic intent contract to which they are linked.

9. An AI agent distribution and access control system, used to execute the AI ​​agent distribution and access control method as described in any one of claims 1-8, characterized in that, include: An intent processing module is used to receive natural language instructions from users and generate dynamic intent contracts based on the natural language instructions. The dynamic intent contracts include an intent summary corresponding to the natural language instructions and execution constraints extracted from the natural language instructions. The AI ​​agent is configured to receive the dynamic intent contract and generate an action plan based on the intent summary and execution constraints in the dynamic intent contract. The contract verification module is used to verify the action plan before the AI ​​agent executes the action plan, and to authorize it after the verification is passed; The authorization management module is used to provide temporary capability credentials for the AI ​​agent to execute the action plan based on the authorization result of the contract verification module.

Citation Information

Patent Citations

  • Power data management credible planning workflow method based on KCMAP

    CN119003744A

  • Multi-modal retrieval enhanced generation government affair intelligent system

    CN120495050A

  • Decision generation execution method and system based on AI intelligent agent

    CN120524939A