Method and apparatus for agent runtime auditable security snapshot and contract verification
Patent Information
- Application Number
- CN202611256791.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-19
- Publication Date
- 2026-09-18
AI Technical Summary
[0005]针对现有智能体平台以日志与持久化记忆维系上下文而缺乏会话级授权冻结、泄露检测仅分析隐藏状态而无运行时快照、权限与策略运行中途变更导致运行上下文不一致且事后难以举证还原的问题,本申请提供一种智能体运行时可审计安全快照和契约验证方法及装置,能够在智能体单次会话启动时冻结运行时不可变的授权快照与模型策略快照并生成全局唯一的快照标识,以所述快照标识贯穿会话全生命周期并依据冻结快照对权限边界与策略版本一致性作契约验证,在会话结束后关联执行结果留存审计记录以支撑依据快照标识精确还原各操作的授权边界与操作主体
[0017] As can be seen from the above technical solution, this application provides an auditable security snapshot and contract verification method and apparatus for intelligent agents at runtime. By freezing immutable authorization snapshots and model policy snapshots at the start of a single session of the intelligent agent and generating a globally unique snapshot identifier, the snapshot identifier is used to pass through each stage of parsing and derivation, task issuance, local execution and result feedback, and contract verification is performed on the consistency of permission boundaries and policy versions based on the frozen snapshot. After the session ends, the snapshot and execution results are associated to generate audit records to support the accurate restoration of the authorization boundaries and operation subjects of each operation based on the snapshot identifier. According to the audit feedback, the authorization snapshot structure and model policy snapshot structure are calibrated and fed back to the snapshot freezing stage to form a closed loop.
Smart Images

Figure CN122778367A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of intelligent agent security and trusted operation technology, specifically to an auditable security snapshot and contract verification method and apparatus for intelligent agent runtime. Background Technology
[0002] Existing intelligent agent platforms designed for operational scenarios often employ logging and persistent memory schemes to maintain operational context. These schemes write the interaction content and intermediate states during a session into hierarchical memory or long short-term memory structures for maintaining collaboration quality and managing the context. While these schemes prioritize task continuity and collaboration effectiveness, the recorded content does not formalize session security boundaries. They neither solidify the authorization scope at the session level nor freeze the effective version of model security policies. If permission or policy configurations change during operation, the authorization scope and policy version upon which ongoing operations are based drift, resulting in inconsistencies in the operational context.
[0003] Existing solutions for agent security mostly focus on detecting the leakage of hidden states. They determine whether sensitive information has been leaked by analyzing the hidden state of a session. However, their analysis focuses on intermediate data generated during operation and does not provide runtime snapshots at the time the session started. Due to the lack of session-level freezing of authorization scope and model policies, such detection struggles to answer the question of under what authorization boundary and policy version an operation was performed at the time it occurred. When operational decisions deviate and post-event accountability is required, the only recourse is to piece together the scene from discrete log fragments. The correspondence between authorization boundaries and operating entities is ambiguous, the tracing process is time-consuming, and the conclusions lack evidentiary value.
[0004] Existing agent collaboration schemes rely on variable central configurations for authorization and policy settings at each stage when distributing and transmitting tasks among multiple agents. This lack of a unified identifier across the entire session lifecycle links parsing, task distribution, local execution, and result feedback to a single frozen contract. Furthermore, if the pre-authorization status and security review policies for high-risk actions are updated mid-run, subsequent stages may make judgments based on different versions, making it difficult to reproduce the causes of security incidents. Therefore, a method is needed that freezes an immutable security snapshot at session initiation, uses the snapshot identifier throughout the entire lifecycle for contract verification, and retains and audits the associated results after session termination to support for verifiable reconstruction. Summary of the Invention
[0005] To address the problems of existing agent platforms that rely on logs and persistent memory to maintain context but lack session-level authorization freezing, leakage detection that only analyzes hidden states without runtime snapshots, and inconsistent runtime contexts caused by mid-run changes in permissions and policies, making it difficult to provide evidence and restore the situation afterward, this application provides an auditable security snapshot and contract verification method and apparatus for agent runtime. This method freezes immutable runtime authorization and model policy snapshots at the start of a single agent session and generates a globally unique snapshot identifier. This snapshot identifier is used throughout the entire session lifecycle, and contract verification is performed based on the frozen snapshot to ensure consistency between permission boundaries and policy versions. After the session ends, the execution results are associated with and audit records are retained to support the accurate restoration of the authorization boundaries and operating entities of each operation based on the snapshot identifier.
[0006] To solve at least one of the above problems, this application provides the following technical solution: Firstly, this application provides an auditable security snapshot and contract verification method for intelligent agents during runtime, comprising: freezing an authorization snapshot according to a preset authorization snapshot structure and simultaneously freezing a model policy snapshot according to a preset model policy snapshot structure when an intelligent agent starts a single session; generating a globally unique snapshot identifier for the session; setting the authorization snapshot and the model policy snapshot to an immutable state during runtime and binding them to the runtime context of the session; associating each processing step within the session with the snapshot identifier; a parsing module deriving the session task based on the authorization snapshot and sending the session task to local execution via an inter-agent collaboration protocol, and then sending back the execution result; each processing step performing contract verification on the permission boundary and policy version consistency of the current operation according to the frozen authorization snapshot and the model policy snapshot and a preset contract verification rule family, so that the session is not affected by subsequent permission changes and policy changes during runtime; after the session ends, associating the authorization snapshot and the model policy snapshot together with the execution result to generate an audit record and writing it into the audit log; restoring the authorization boundary and operation subject of each operation within the session according to the snapshot identifier; triggering snapshot policy calibration based on audit feedback and backflowing to the authorization snapshot structure and the model policy snapshot structure.
[0007] Furthermore, it also includes: when a single session of an agent is initiated, collecting the authorization boundary elements of the session subject according to a preset authorization snapshot structure and organizing them into an authorization snapshot; simultaneously collecting the security review policy elements at the time the session takes effect according to a preset model policy snapshot structure and organizing them into a model policy snapshot; and sealing the authorization snapshot and the model policy snapshot into a security contract that is immutable during the session runtime.
[0008] Furthermore, it also includes: calculating a globally unique snapshot identifier at the session level by applying a preset summary rule to the normalized content of the authorized snapshot and the model policy snapshot, mapping snapshots with consistent content to the same snapshot identifier, associating the snapshot identifier with the session subject identifier and the session start time and registering it in the session index table; writing the snapshot identifier into an immutable field of the session's runtime context and persisting throughout the session's entire lifecycle, using the snapshot identifier as the association key for retrieving frozen snapshots in each processing step within the session, and registering a tampering identifier for requests to modify the authorized snapshot and the model policy snapshot during runtime and rejecting their effectiveness.
[0009] Furthermore, it also includes: a parsing module reads the authorized snapshot using the snapshot identifier as the association key and derives the session task with the snapshot identifier within the authorized boundary; the session task is then sent to the local execution stage via an inter-agent collaboration protocol; the local execution stage retrieves the authorized snapshot and the model policy snapshot corresponding to the snapshot identifier based on the session task; after comparing the retrieved snapshot with the snapshot identifier carried by the session task, it executes the task and generates an execution result; the execution result, along with the snapshot identifier, is sent back to the upstream stage and written into the session execution trajectory.
[0010] Furthermore, it also includes: in each processing stage within the session, verifying whether the operating subject and target resource of the current operation fall within the authorization boundary according to the frozen authorization snapshot and the preset contract verification rule family, and verifying that the pre-authorization status of high-risk actions has not expired; registering an out-of-bounds flag and intercepting out-of-bounds operations; verifying the consistency between the security review policy version applicable to the current operation and the policy version at the time of freezing according to the frozen model policy snapshot; if the policy versions are inconsistent, restoring consistency based on the frozen version of the model policy snapshot and registering a drift flag.
[0011] Furthermore, it also includes: after the session ends, using the snapshot identifier as the association key, associating and aggregating the authorization snapshot and the model policy snapshot, along with the execution results of each operation within the session and the contract verification conclusion, according to a preset audit record structure to generate an audit record, wherein the audit record retains the verifiable fingerprints of the authorization snapshot and the model policy snapshot; writing the audit record to an append-only audit log with the snapshot identifier as the primary key and attaching a chained summary of the preceding record to the audit record; registering an archive exception flag for audit records that fail to be written and transferring them to a retry queue.
[0012] Furthermore, it also includes: during audit tracing, retrieving the corresponding audit record from the audit log based on the snapshot identifier, restoring the operating subject, authorized boundary, and applicable policy version of each operation within the session along the audit record; calculating the calibration amount based on the out-of-bounds frequency and drift frequency of the audit feedback, the field composition and preset threshold conditions of the authorized snapshot structure and the model policy snapshot structure, and feeding the calibration amount back to the authorized snapshot structure and the model policy snapshot structure after preset grayscale verification, so that the snapshot freeze of the next session adopts the calibrated structure.
[0013] Secondly, this application provides an auditable security snapshot and contract verification device for intelligent agents during runtime, comprising: a snapshot freezing module, used to collect the identity, role, and permission information of the session subject according to a preset authorization snapshot structure when a single session of the intelligent agent is started, freeze the authorization snapshot, generate a globally unique snapshot identifier for the session, and set the authorization snapshot to an immutable state during the session runtime; a policy snapshot module, used to synchronously collect the input / output security review policy and risk classification configuration at the effective time of the session according to a preset model policy snapshot structure, freeze the model policy snapshot, associate the model policy snapshot with the snapshot identifier, and set it to an immutable state during the session runtime; and a contract verification module, used to associate each processing step within the session with the snapshot identifier and support... The derivation, issuance, and execution feedback of session tasks verify the permission boundaries and policy version consistency of the current operation according to the frozen authorization snapshot and model policy snapshot, based on a preset contract verification rule family. The audit retention module, after the session ends, uses the snapshot identifier as the association key to associate the authorization snapshot and model policy snapshot along with the execution result to generate audit records and write them to the append-only audit log. It also restores the authorization boundaries and operation subjects of each operation within the session based on the snapshot identifier. The calibration backflow module calculates calibration amounts based on the field composition and preset threshold conditions of the authorization snapshot structure and the model policy snapshot structure according to audit feedback. After grayscale verification, the calibration amounts are backflowed to the authorization snapshot structure and the model policy snapshot structure.
[0014] Thirdly, this application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the intelligent agent runtime auditable security snapshot and contract verification method.
[0015] Fourthly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the described intelligent agent runtime auditable security snapshot and contract verification method.
[0016] Fifthly, this application provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the steps of the aforementioned intelligent agent runtime auditable security snapshot and contract verification method.
[0017] As can be seen from the above technical solution, this application provides an auditable security snapshot and contract verification method and apparatus for intelligent agents at runtime. By freezing immutable authorization snapshots and model policy snapshots at the start of a single session of the intelligent agent and generating a globally unique snapshot identifier, the snapshot identifier is used to pass through each stage of parsing and derivation, task issuance, local execution and result feedback, and contract verification is performed on the consistency of permission boundaries and policy versions based on the frozen snapshot. After the session ends, the snapshot and execution results are associated to generate audit records to support the accurate restoration of the authorization boundaries and operation subjects of each operation based on the snapshot identifier. According to the audit feedback, the authorization snapshot structure and model policy snapshot structure are calibrated and fed back to the snapshot freezing stage to form a closed loop. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below.
[0019] Figure 1 This is a flowchart illustrating the auditable security snapshot and contract verification method for the intelligent agent runtime in this application embodiment; Figure 2 This is a schematic diagram of the intelligent agent runtime auditable security snapshot and contract verification device in the embodiments of this application; Figure 3 This is a schematic diagram of the process of freezing the authorization snapshot and model policy snapshot and generating the snapshot identifier when the intelligent agent starts a single session in this application embodiment; Figure 4 This is a schematic diagram illustrating the process of using snapshot identification throughout all processing stages of a session and verifying contracts based on frozen snapshots in this embodiment of the application. Figure 5 This is a schematic diagram illustrating the process of generating audit records and writing them to the audit log by associating snapshots with execution results after the session ends in this embodiment of the application. Figure 6 This is a schematic diagram illustrating the process of restoring evidence based on snapshot identifiers and calibrating and reflowing snapshot strategies based on audit feedback in this embodiment of the application. Detailed Implementation
[0020] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are some embodiments of this application, but not all embodiments.
[0021] Considering that existing intelligent agent platforms mostly maintain the runtime context through log recording and persistent memory, but lack session-level authorization freezing, leakage detection only analyzes hidden states without runtime snapshots, and permissions and policies change during operation, resulting in inconsistent runtime contexts and difficulty in restoring evidence afterward, this application provides an auditable security snapshot and contract verification method for intelligent agent runtime. When an intelligent agent starts a single session, an immutable runtime authorization snapshot and model policy snapshot are frozen. The snapshot identifier is used throughout the entire session lifecycle for contract verification. After the session ends, the snapshot is associated with the execution result and retained for auditing to support evidence-based restoration.
[0022] This application provides an embodiment of an auditable security snapshot and contract verification method for intelligent agents at runtime, see [link to relevant documentation]. Figure 1 The method specifically includes the following: Step S101: When the agent starts a single session, freeze the authorization snapshot according to the preset authorization snapshot structure, and simultaneously freeze the model strategy snapshot according to the preset model strategy snapshot structure. Generate a globally unique snapshot identifier for the session, and set the authorization snapshot and the model strategy snapshot to an immutable state during runtime and bind them to the runtime context of the session.
[0023] In this embodiment, the method operates on an intelligent agent platform for parking lot management, such as... Figure 1 As shown, the platform starts with a snapshot freeze step between the session entry layer, task parsing layer, collaborative execution layer, and audit retention layer. When the intelligent agent receives an interaction request in a parking lot operation scenario and starts a single session, the session entry layer triggers a snapshot freeze. The freeze action is completed before any external calls are made in the session, and the authorization configuration and policy configuration on which the freeze is based are taken from the effective values at the time the session is started.
[0024] In one feasible implementation, the authorized snapshots are organized according to a preset authorized snapshot structure, such as... Figure 3 As shown, the authorized snapshot structure includes six types of fields: session subject identifier and role, workspace permissions, authorized skill packs and capability list, data access level, and high-risk action pre-authorization status. Workspace permissions record the scope of resources that the subject can read and write within the parking lot operation workspace. The data access level uses hierarchical coding to mark the sensitive level of accessible data. The high-risk action pre-authorization status records a random number and an expiration time. The random number is bound to a single pre-authorization, and the expiration time limits the effective window of the pre-authorization.
[0025] The model policy snapshot is frozen synchronously, and the model policy snapshot is organized according to the preset model policy snapshot structure. The model policy snapshot structure includes four types of fields: input security review rule version, output security review policy, risk level configuration, and default rejection rule set. The risk level configuration records the risk level threshold from low to high and the corresponding handling actions. The default rejection rule set is a fallback rejection when there is no matching allow rule. The values of each field are taken from the policy center snapshot reading at the time the session was started.
[0026] Based on this, a globally unique snapshot identifier is generated for the session. The snapshot identifier is a summary value calculated by applying a preset summary rule to the normalized content of authorized snapshots and model policy snapshots, and is then concatenated with the session subject identifier and the session start timestamp. The summary rule ensures that snapshots with consistent content are mapped to the same identifier, and that changes in content result in changes in the identifier. The snapshot identifier is associated and registered in the session index table with the snapshot identifier as the primary key.
[0027] The authorized snapshot and the model policy snapshot are written to the immutable fields of the session runtime context and set to an immutable state during runtime. The immutable fields can only be read and not overwritten during the session's lifecycle. During runtime, any modification requests to the two snapshots are registered with a tampering flag and are rejected. The freeze result is written to the snapshot storage with the snapshot identifier as the primary key, so that step S102 can read it at the entry point of each processing stage of the session by the snapshot identifier. Sessions that fail to freeze are registered with a freeze exception flag and the session startup is blocked.
[0028] Step S102: The snapshot identifier is used to associate each processing step in the session. The parsing module derives the session task based on the authorized snapshot and sends the session task to the local machine for execution via the inter-agent collaboration protocol. After sending back the execution result, each processing step performs contract verification on the current operation's permission boundary and policy version consistency according to the frozen authorized snapshot and the model policy snapshot and the preset contract verification rule family, so that the session is not affected by subsequent permission changes and policy changes during the session.
[0029] After the authorization snapshot, model policy snapshot, and snapshot identifier output in step S101 are ready, the session enters the processing phase, such as... Figure 1 As shown. Each processing step within the session includes parsing module derivation, distribution of cooperation protocols between agents, local execution, and result feedback. Each step reads the same frozen contract from the snapshot storage using the snapshot identifier as the association key. If the snapshot storage lacks the corresponding identifier, it registers that the snapshot did not match the identifier and blocks that step.
[0030] In one specific implementation, the parsing module reads the authorized snapshot using the snapshot identifier as the association key, and within the authorized boundaries, derives the session request into a session task, such as... Figure 4As shown, session tasks are organized using fields such as task identifier, snapshot identifier, operation subject, target resource, and operation type. The snapshot identifier is attached to the session task by the parsing module to bind it to the freeze contract. Candidate tasks that exceed the boundary are registered with an out-of-bounds identifier and no out-of-bounds identifier is generated.
[0031] Accordingly, the session task is distributed to the local execution stage via the inter-agent collaboration protocol. The inter-agent collaboration protocol carries a snapshot identifier and a task identifier in the message header. After receiving the session task, the local execution stage retrieves the corresponding authorized snapshot and model policy snapshot using the snapshot identifier. If the retrieved result is inconsistent with the snapshot identifier carried in the message header, a mismatch identifier is registered and execution is rejected. If they match, the session task is executed and an execution result is generated. The execution result is organized using the task identifier, snapshot identifier, execution status, and timestamp fields. The execution status takes values of success, rejection, and exception.
[0032] The local execution stage sends the execution result along with the snapshot identifier back to the upstream stage and writes it into the session execution trajectory. The session execution trajectory uses the snapshot identifier as the partition key and the timestamp as the order, and is aggregated in step S103.
[0033] In the parallel processing path, each processing step within the session performs contract verification on the current operation according to the frozen authorization snapshot and model policy snapshot, based on a preset family of contract verification rules. Figure 4 As shown. The contract verification rule family includes permission boundary verification rules and policy version verification rules. Permission boundary verification compares the permission scope of the authorized snapshot with the current operation subject and the target resource. Policy version verification compares the applicable version and the frozen version.
[0034] Optionally, contract verification categorizes and handles failed items. When the operating entity or target resource exceeds the authorized boundary, an out-of-bounds flag is registered and the current operation is blocked. If the applicable policy version is inconsistent with the frozen version, the frozen version is used to restore consistency and a drift flag is registered to ensure that the session is not affected by subsequent permission and policy changes. Operations that pass verification are allowed to proceed, and the verification conclusion is stored with a snapshot flag as the association key for reading in step S103.
[0035] Step S103: After the session ends, associate the authorization snapshot and the model policy snapshot with the execution result to generate an audit record and write it to the audit log. Restore the authorization boundaries and operation subjects of each operation in the session according to the snapshot identifier. Trigger snapshot policy calibration and backflow to the authorization snapshot structure and the model policy snapshot structure according to the audit feedback.
[0036] After the execution results and verification conclusions output in step S102 are ready, the session ends and audit retention is triggered, such as... Figure 1As shown. The audit retention uses the snapshot identifier as the association key, reads the authorized snapshot and model policy snapshot from the snapshot storage, and reads the execution results and verification conclusions of each operation from the session execution trajectory. When the session execution trajectory is not fully read, the trajectory missing segment identifier is registered and the existing segments are downgraded for retention.
[0037] In one feasible implementation, audit logs are organized according to a pre-defined audit log structure, such as... Figure 5 As shown, the audit log structure includes fields for snapshot identifier, authorized snapshot summary, model strategy snapshot summary, operation sequence, and result sequence. The operation sequence records the operation subject and target resource of each operation by timestamp, and the result sequence records the execution status and contract verification conclusion of each operation.
[0038] Accordingly, audit records are written to the append-only audit log using the snapshot identifier as the primary key. The append-only audit log only supports appending and does not support in-place modification. Each audit record is accompanied by a chained summary of the preceding record. The chained summary includes the content of the current record and the summary of the previous record in the summary calculation. Audit records that fail to be written are registered with an archive exception flag and transferred to the retry queue. Records that still fail to be retried are alerted and the original fragments are retained.
[0039] During audit tracing, the corresponding audit record is retrieved from the audit log based on the snapshot identifier, such as... Figure 6 As shown. By reconstructing the operational subject, authorized boundary, and applicable strategy version of each operation along the operation and result sequence of the audit records, the relevant operations and responsible parties can be accurately located when deviations occur in parking lot operation decisions. When the chain summary verification of the records fails, a record tampering identifier is registered.
[0040] Based on this, the snapshot policy calibration is triggered according to the audit feedback. The audit feedback collects the frequency of out-of-bounds flags, the frequency of drift flags, and the hit status. When the frequency of out-of-bounds flags exceeds the preset threshold, it prompts to converge the permission fields of the authorized snapshot structure. When the frequency of drift flags exceeds the preset threshold, it prompts to align the policy version management of the model policy snapshot structure. The threshold is determined based on the quantile statistics of historical audit data.
[0041] The calibration quantity adjusts the field composition and preset threshold conditions of the authorized snapshot structure and the model strategy snapshot structure. The adjustment methods include three types: field supplementation, threshold condition tightening, and rule version alignment. The calibration quantity is compared with the out-of-bounds and drift indicators before and after calibration in the sample session through preset grayscale verification. After the grayscale verification is passed, it flows back to the authorized snapshot structure and the model strategy snapshot structure, so that the snapshot freeze of the next session adopts the calibrated structure, forming a closed loop of freezing, verification, auditing and calibration.
[0042] As can be seen from the above description, the auditable security snapshot and contract verification method for the intelligent agent runtime provided in this application embodiment can freeze the authorization snapshot and model policy snapshot and generate a snapshot identifier when the intelligent agent starts a single session. The snapshot identifier is used to run through each processing stage of the session and contract verification is performed based on the frozen snapshot. After the session ends, the execution results are associated to retain audit records and the authorization boundaries of each operation are restored based on the snapshot identifier. The snapshot policy is calibrated and reflowed based on the audit feedback.
[0043] In one embodiment of the intelligent agent runtime auditable security snapshot and contract verification method of this application, see [link to relevant documentation]. Figure 3 It can also specifically include the following: Step S201: When a single session of an agent is started, the authorization boundary elements of the session subject are collected according to the preset authorization snapshot structure and organized into an authorization snapshot; Step S202: Synchronously collect the security review policy elements at the effective time of the session according to the preset model policy snapshot structure and organize them into a model policy snapshot. Seal the authorization snapshot and the model policy snapshot into a security contract that is immutable during the session runtime.
[0044] Step S101, the snapshot freezing process, involves collecting authorization information and organizing an authorized snapshot when the session starts, such as... Figure 3 As shown. The authorized snapshot is organized according to the preset authorized snapshot structure. The collection entry point is the identity service, permission service and pre-authorization service of the parking lot operation workspace. The collection action is completed in one go before the session generates external calls.
[0045] The Session Subject and Role fields of the authorized snapshot structure record the business account identifier that initiated this session and its role code in the workspace. The Workspace Permission field records the readable and writable scope of the account for parking space resources, billing rules and equipment instructions. The Authorized Skill Package and Capability List fields list the skill package versions that can be loaded in this session and the types of operations that can be executed.
[0046] The data access level field uses a hierarchical coding system from low to high to indicate the sensitivity level of the data that can be accessed in this session. The higher the level, the stricter the data anonymization and approval requirements. The high-risk action pre-authorization status field records the pre-authorization random number and expiration time for high-risk actions. The random number is bound to a single pre-authorization, and the expiration time limits its validity window. Pre-authorizations that exceed the expiration time are judged as invalid.
[0047] The values of each field are organized into an authorized snapshot after field-level validation. The validation covers the completeness of required fields and the legality of values. When the identity service returns an empty value or the permission service returns an unauthorized configuration, a collection anomaly flag is registered and the session startup is blocked. The collection anomaly flag, along with the missing field name, is recorded in the startup log.
[0048] The authorized snapshot and the model policy snapshot are sealed as an immutable security contract during session runtime. The sealing action writes both snapshots into immutable fields of the runtime context. The input security review rule version and output security review policy, risk classification configuration, and default denial rule set at the time the session takes effect are synchronously collected and organized into a model policy snapshot. Each policy field is taken from the effective reading of the policy center at the time the session starts.
[0049] The security contract is written to the snapshot storage with the snapshot identifier as the primary key. The snapshot storage uses the snapshot identifier as the primary key and the session subject identifier as the secondary index, so that step S102 can read it at the entry point of each processing stage of the session according to the snapshot identifier. The security contract that fails to be sealed is registered with a sealing exception identifier and the session is blocked from entering the processing stage.
[0050] In one embodiment of the intelligent agent runtime auditable security snapshot and contract verification method of this application, see [link to relevant documentation]. Figure 3 It can also specifically include the following: Step S301: Calculate a globally unique snapshot identifier at the session level for the normalized content of the authorized snapshot and the model policy snapshot according to a preset summary rule, so that snapshots with consistent content are mapped to the same snapshot identifier, and register the snapshot identifier, the session subject identifier, and the session start time in the session index table. Step S302: Write the snapshot identifier into the immutable field of the session's runtime context and persist it throughout the entire session lifecycle. Use the snapshot identifier as the association key for each processing step within the session to retrieve the frozen snapshot. Register the tampering identifier for requests to modify the authorized snapshot and the model policy snapshot during runtime and refuse to take effect.
[0051] After the authorization snapshot and model strategy snapshot in step S101 are ready, the snapshot freezing step calculates the snapshot identifier, such as... Figure 3 As shown. The snapshot identifier is calculated based on the normalized content of two snapshots according to preset summary rules. Normalization first arranges the snapshot fields in a preset order to eliminate the influence of field order on the summary, and then calculates the summary value for the arranged content.
[0052] The digest rule adopts a collision-resistant message digest algorithm. Snapshots with the same content are mapped to the same digest value. Any change in content will change the digest value. The digest value is concatenated with the session subject identifier and the session start time to obtain a globally unique snapshot identifier at the session level. Snapshot identifiers are not repeated within the same platform.
[0053] The snapshot identifier, the session subject identifier, and the session start time are associated and registered in the session index table. The session index table uses the snapshot identifier as the primary key and records the session subject identifier, the session start time, and the storage location of the security contract. When there is a conflict, the sequence number is appended according to the session start time to resolve the discrepancy.
[0054] The snapshot identifier is written into an immutable field of the session's runtime context and persists throughout the entire session's lifecycle. The immutable field can only be read and cannot be overwritten during the session's lifecycle. Each stage of the session, including parsing and derivation, task assignment, local execution, and result feedback, uses the snapshot identifier carried by this field as the association key.
[0055] Requests to modify the authorized snapshot and the model policy snapshot during operation are registered with a tampering identifier and rejected. Modification requests are intercepted by write protection of immutable fields. The tampering identifier is recorded in the request subject, request time and target fields and written into the session operation trajectory. The requester of the result receipt is rejected.
[0056] The binding relationship between the snapshot identifier and the security contract is stored with the snapshot identifier as the primary key, so that step S102 can retrieve the corresponding snapshot according to the snapshot identifier in each processing stage. If the binding relationship fails to be read, the missing identifier is registered and the stage is blocked to prevent the session from continuing to run in the absence of contract association.
[0057] In one embodiment of the intelligent agent runtime auditable security snapshot and contract verification method of this application, see [link to relevant documentation]. Figure 4 It can also specifically include the following: Step S401: The parsing module reads the authorized snapshot using the snapshot identifier as the association key and derives the session task with the snapshot identifier within the authorized boundary. The session task is then sent to the local execution stage via the inter-agent cooperation protocol. Step S402: The local execution stage retrieves the authorized snapshot and the model policy snapshot corresponding to the snapshot identifier based on the session task. After comparing the retrieved snapshot with the snapshot identifier carried by the session task, it executes the task and generates an execution result. The execution result, along with the snapshot identifier, is sent back to the upstream stage and written into the session execution trajectory.
[0058] After the snapshot identifier in step S102 is used throughout each processing stage of the session, the parsing module deduces the session task, such as... Figure 4 As shown. The parsing module reads the authorized snapshot from the snapshot storage using the snapshot identifier as the association key, and parses the session request into candidate operations and derives them into session tasks within the authorized boundaries defined by the authorized snapshot.
[0059] Session tasks are organized using fields such as task identifier, snapshot identifier, operation subject, target resource, operation type, and parameter set. The task identifier is a unique sequence number within the session. The snapshot identifier is attached to the session task by the parsing module to bind the session task to the freeze contract. The operation type is mapped to the operation subject predefined by the platform.
[0060] The target resource and operation type of the candidate operation are compared with the permission scope of the authorized snapshot. Candidate operations that fall within the authorization boundary are organized into session tasks. Candidate operations that exceed the authorization boundary are registered with an out-of-bounds flag and are not generated. The out-of-bounds flag records the candidate operation and the out-of-bounds field.
[0061] The session task is sent to the local execution stage via the inter-agent collaboration protocol. The inter-agent collaboration protocol carries a snapshot identifier and a task identifier in the message header, and the operation subject, target resource, operation type and parameter set in the message body. If the session task fails to be sent, an error identifier is registered and the task is retried.
[0062] The local execution phase retrieves the authorized snapshot and the model policy snapshot corresponding to the snapshot identifier based on the session task and executes them. The retrieval result is compared with the snapshot identifier carried in the message header. If they are inconsistent, the registration identifier does not match and execution is refused. If they match, the session task is executed according to the operation type to generate the execution result.
[0063] The execution result, along with the snapshot identifier, is sent back to the upstream process and written into the session execution trajectory. The execution result is organized with task identifier, snapshot identifier, execution status, result summary and timestamp. The execution status takes three values: success, rejection and exception. The session execution trajectory uses the snapshot identifier as the partition key and the timestamp as the order, and is read by step S601 at the audit aggregation entry.
[0064] In one embodiment of the intelligent agent runtime auditable security snapshot and contract verification method of this application, see [link to relevant documentation]. Figure 4 It can also specifically include the following: Step S501: In each processing stage within the session, based on the frozen authorization snapshot, verify whether the operation subject and target resource of the current operation fall within the authorization boundary according to the preset contract verification rule family, and verify that the pre-authorization status of high-risk actions has not expired. Register the boundary violation flag for out-of-bounds operations and intercept them. Step S502: Verify the consistency between the security audit policy version applicable to the current operation and the policy version at the time of freezing, based on the frozen model policy snapshot. If the policy versions are inconsistent, restore consistency based on the frozen version of the model policy snapshot and register the drift identifier.
[0065] In step S401, during the flow of the session task through each processing stage, the contract verification stage verifies the permission boundaries based on the frozen authorization snapshot, such as... Figure 4 As shown. The contract verification rule family includes permission boundary verification rules and policy version consistency verification rules. Permission boundary verification is performed at the operation entry point of each processing stage.
[0066] The permission boundary verification compares the current operation subject with the target resource to the permission scope of the authorized snapshot, and verifies whether the operation subject is the session subject registered for the authorized snapshot, whether the target resource falls within the workspace permission scope, whether the operation type is within the capability list, and whether the data access does not exceed the data reach level.
[0067] Operations involving high-risk actions require additional verification of the pre-authorization status. The random number matching of the pre-authorization status of the high-risk action is verified and the expiration time is not exceeded. Out-of-bounds operations are registered with an out-of-bounds flag and intercepted. The out-of-bounds flag records the operation subject, target resource, and out-of-bounds dimension and is recorded in the session execution trajectory.
[0068] Based on the frozen model policy snapshot, verify the consistency between the security audit policy version applicable to the current operation and the policy version at the time of freezing. Figure 4 As shown. Verify whether the version of the input security review rule invoked by the current operation matches the frozen version of the model policy snapshot.
[0069] When the policy versions are inconsistent, the frozen version of the model policy snapshot shall be used to restore consistency and register the drift identifier. The restoration action redirects the current operation to the review rule corresponding to the frozen version. The drift identifier records the current version, the frozen version and the deviation field and is recorded in the session running trajectory.
[0070] Contract verification allows items that pass the verification and retains the verification conclusion with the snapshot identifier as the association key. The verification conclusion records the operation identifier, verification dimension and pass status. The verification conclusion is available for step S601 to read at the audit aggregation entry point by the snapshot identifier. When the verification service is unreachable, the verification unreachable identifier is registered and the operation is blocked according to the default rejection rule set.
[0071] In one embodiment of the intelligent agent runtime auditable security snapshot and contract verification method of this application, see [link to relevant documentation]. Figure 5 It can also specifically include the following: Step S601: After the session ends, the authorized snapshot and the model policy snapshot, together with the execution results of each operation in the session and the contract verification conclusion, are associated and aggregated according to the preset audit record structure using the snapshot identifier as the association key to generate an audit record. The audit record retains the verifiable fingerprints of the authorized snapshot and the model policy snapshot. Step S602: Write the audit record to the append-only audit log with the snapshot identifier as the primary key and attach a chained summary of the preceding record to the audit record. Register an archiving exception identifier for the audit record that fails to be written and transfer it to the retry queue.
[0072] After the execution result and verification conclusion of step S501 are ready, the session ends and an audit log is generated, such as... Figure 5As shown. The audit retention process uses the snapshot identifier as the association key to read the authorized snapshot and model policy snapshot from the snapshot storage, and reads the execution results and verification conclusions of each operation within the session from the session execution trajectory.
[0073] The audit log is organized according to the preset audit log structure, which includes fields such as snapshot identifier, authorized snapshot summary, model strategy snapshot summary, operation sequence and result sequence. The operation sequence records the operation subject, target resource and operation type of each operation by timestamp, and the result sequence records the execution status and contract verification conclusion of each operation.
[0074] The authorized snapshot summary and the model strategy snapshot summary retain two verifiable fingerprints of the snapshot content. The fingerprints are calculated from the snapshot content by the summary rules, enabling audit records to support post-event verification of the snapshot content without redundantly storing the complete snapshot.
[0075] The audit record is written to the append-only audit log with the snapshot identifier as the primary key. The append-only audit log only supports appending and does not support in-place modification. Each audit record is accompanied by a chained summary of the previous record. The chained summary includes the current content and the previous summary in the summary calculation to form a tamper-proof chain.
[0076] For audit records that fail to be written, an archiving exception identifier is registered and transferred to the retry queue. The archiving exception identifier records the reason for failure and the primary key of the record. The retry queue retryes at preset intervals. Records that still fail to be retried trigger an alarm and retain the original fragment for manual processing.
[0077] The audit log uses the snapshot identifier as the primary key and the chained summary as the basis for integrity verification. Step S701 can detect the log at the trace entry point by the snapshot identifier. The audit record that is successfully written is returned as a write receipt, which records the writing time and record location.
[0078] In one embodiment of the intelligent agent runtime auditable security snapshot and contract verification method of this application, see [link to relevant documentation]. Figure 6 It can also specifically include the following: Step S701: During audit tracing, the corresponding audit record is retrieved from the audit log based on the snapshot identifier, and the operating subject, authorized boundary, and applicable policy version of each operation in the session are restored along the audit record; Step S702: Based on the out-of-bounds frequency and drift frequency reported by the audit feedback, calculate the calibration amount for the field composition and preset threshold conditions of the authorized snapshot structure and the model strategy snapshot structure. After the calibration amount is verified by preset grayscale, it is fed back to the authorized snapshot structure and the model strategy snapshot structure so that the snapshot freeze of the next session adopts the calibrated structure.
[0079] After the audit record in step S601 is written to the audit log, the traceability process can restore the evidence based on the snapshot identifier, such as... Figure 6 As shown. During audit tracing, the corresponding audit record is retrieved from the audit log based on the snapshot identifier. The retrieved record is first verified by chain digest. If the chain digest verification fails, a record tampering identifier is registered and the acceptance of that record is terminated.
[0080] By following the operation sequence and result sequence of the audit records, the operation subject, the authorization boundary, and the applicable policy version of each operation within the session can be reconstructed. The frozen contract can be located based on the authorization snapshot summary and model policy snapshot summary in the audit records, and the answer can be given to the authorization boundary and policy version under which a certain operation occurred.
[0081] The restoration results are organized into an evidentiary traceability chain based on the operation identifier. The traceability chain records the operation subject, authorization boundary, policy version and execution status. When deviations occur in parking lot operation decisions, the traceability chain can be used to accurately locate the relevant operations and responsible subjects. The location time is reduced from minutes of splicing discrete logs to seconds of direct lookup based on snapshot identifiers.
[0082] Based on this, the calibration amount of the snapshot structure is calculated according to the audit feedback. The audit feedback collects the frequency of out-of-bounds flags, the frequency of drift flags, and the traceability hit status. When the frequency of out-of-bounds flags exceeds the preset threshold, it prompts to converge the permission fields of the authorized snapshot structure. When the frequency of drift flags exceeds the preset threshold, it prompts to align the model strategy snapshot structure's strategy version management.
[0083] Based on audit feedback, the calibration amount is calculated for the field composition and preset threshold conditions of the authorized snapshot structure and the model strategy snapshot structure. The calibration amount covers three categories: field supplementation, threshold condition tightening, and rule version alignment. The preset threshold conditions are calibrated based on the quantile statistics of historical audit data and can be adjusted according to business risk preferences.
[0084] The calibration quantity is fed back to the authorized snapshot structure and the model strategy snapshot structure after being verified by a preset grayscale. The grayscale verification compares the out-of-bounds and drift indicators before and after calibration on the sample session. The calibration quantity that fails the grayscale verification is rolled back and the rollback mark is registered. The calibration quantity that passes the verification is fed back to the snapshot freezing step in step S101 so that the next session adopts the calibrated structure. The rollback record is stored with the calibration batch number as the primary key, forming a closed loop of freezing, verification, auditing and calibration.
[0085] To implement all or part of the method, this application provides an embodiment of an apparatus for implementing the intelligent agent runtime auditable security snapshot and contract verification method, see [link to embodiment]. Figure 2 The device specifically includes the following components: The snapshot freezing module is used to collect the identity, role, and permission information of the session subject according to the preset authorization snapshot structure when a single session of the agent is started, freeze the authorization snapshot, generate a globally unique snapshot identifier for the session, and set the authorization snapshot to an immutable state during the session runtime. The policy snapshot module is used to synchronously collect the input and output security review policies and risk classification configurations at the time of session effectiveness according to the preset model policy snapshot structure, freeze the model policy snapshot, associate the model policy snapshot with the snapshot identifier and set it to an immutable state during session runtime. The contract verification module is used to associate each processing step in the session with the snapshot identifier and support the derivation, issuance and execution feedback of session tasks. Based on the frozen authorization snapshot and the model policy snapshot, it verifies the permission boundaries and policy version consistency of the current operation according to the preset contract verification rule family. The audit retention module is used to associate the authorized snapshot and the model policy snapshot together with the execution result after the session ends, using the snapshot identifier as the association key, to generate an audit record and write it into the append-only audit log. Based on the snapshot identifier, the authorization boundaries and operation subjects of each operation in the session are restored. The calibration backflow module is used to calculate the calibration amount based on the field composition and preset threshold conditions of the authorized snapshot structure and the model strategy snapshot structure according to the audit feedback, and backflow the calibration amount to the authorized snapshot structure and the model strategy snapshot structure after grayscale verification.
[0086] The snapshot freezing module, upon initiating a single session with an agent, collects the session subject's identity, role, workspace permissions, authorized skill sets and capability lists, data access levels, and pre-authorization status of high-risk actions based on a preset authorization snapshot structure, freezing the authorization snapshot. For fields with abnormal collection, it registers a collection anomaly flag and blocks session initiation. It generates a globally unique snapshot flag for the session and sets the authorization snapshot to an immutable state during session runtime. The policy snapshot module, simultaneously based on a preset model policy snapshot structure, collects the input security review rule version and output security review policy, risk classification configuration, and default rejection rule set at the session's effective time, freezing the model policy snapshot. It associates the model policy snapshot with the snapshot flag and sets it to an immutable state during session runtime. The authorization snapshot and the model policy snapshot are written to the snapshot storage using the snapshot flag as the primary key.
[0087] The contract verification module associates the snapshot identifier with each processing stage of the session parsing and derivation, task issuance, local execution, and result feedback, and supports the derivation, issuance, execution, and feedback of session tasks. The parsing module derives the session task with the snapshot identifier within the authorization boundary defined by the authorization snapshot. The local execution stage retrieves the snapshot corresponding to the snapshot identifier, executes it, and then feeds back the execution result. The contract verification module verifies whether the operation subject and target resource of the current operation fall within the authorization boundary according to the frozen authorization snapshot and the preset contract verification rule family. It also verifies the consistency between the security audit policy version applicable to the current operation and the frozen version according to the frozen model policy snapshot. For out-of-bounds operations, it registers an out-of-bounds identifier and intercepts them. For policy versions that are inconsistent, it restores consistency with the frozen version and registers a drift identifier.
[0088] After a session ends, the audit retention module uses the snapshot identifier as the association key to associate the authorized snapshot and the model policy snapshot, along with the execution results of each operation within the session, according to a preset audit record structure to generate an audit record. The snapshot identifier is used as the primary key to write the record into an append-only audit log with a chained digest. Audit records that fail to write are registered with an archive exception flag and transferred to a retry queue. During audit tracing, the audit record is detected based on the snapshot identifier, and the authorization boundaries and operation subjects of each operation within the session are restored. The calibration reflow module calculates a calibration amount based on the field composition and preset threshold conditions of the authorized snapshot structure and the model policy snapshot structure according to the audit feedback. After grayscale verification, the calibration amount is reflowed into the authorized snapshot structure and the model policy snapshot structure, ensuring that the snapshot for the next session is frozen using the calibrated structure.
[0089] As can be seen from the above description, the auditable security snapshot and contract verification device for the intelligent agent provided in this application embodiment can support contract verification and verifiable restoration with runtime immutable security snapshots within a single session of the intelligent agent through the coordinated operation of five modules: snapshot freezing, policy snapshot, contract verification, audit retention and calibration reflow.
[0090] This invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the above-described method.
[0091] This invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method.
[0092] This invention also provides a computer program product, which includes a computer program that, when executed by a processor, implements the above-described method.
[0093] In this embodiment, an immutable authorization snapshot and model policy snapshot are frozen at the start of a single session of the agent, and a globally unique snapshot identifier is generated. The snapshot identifier is used to pass through each stage of parsing and derivation, task issuance, local execution and result feedback, and the contract verification of the consistency of permission boundaries and policy versions is performed based on the frozen snapshot. After the session ends, the snapshot and execution results are associated to generate audit records to support the accurate restoration of the authorization boundaries and operation subjects of each operation based on the snapshot identifier. The authorization snapshot structure and model policy snapshot structure are calibrated based on the audit feedback and fed back to the snapshot freezing stage to form a closed loop.
[0094] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for auditable security snapshots and contract verification during the runtime of an intelligent agent, characterized in that, The method includes: When an agent starts a single session, the authorization snapshot is frozen according to the preset authorization snapshot structure, and the model strategy snapshot is frozen simultaneously according to the preset model strategy snapshot structure. A globally unique snapshot identifier is generated for the session, and the authorization snapshot and the model strategy snapshot are set to runtime immutable state and bound to the runtime context of the session. The snapshot identifier is associated with each processing step in the session. The parsing module derives the session task based on the authorized snapshot and sends the session task to the local machine for execution via the inter-agent collaboration protocol, and then sends back the execution result. Each processing step performs contract verification on the current operation's permission boundary and policy version consistency according to the frozen authorized snapshot and the model policy snapshot and the preset contract verification rule family, so that the session is not affected by subsequent permission changes and policy changes during the session. After the session ends, the authorization snapshot and the model policy snapshot are associated with the execution result to generate an audit record and write it to the audit log. The authorization boundaries and operation subjects of each operation in the session are restored according to the snapshot identifier. The snapshot policy is calibrated and flowed back to the authorization snapshot structure and the model policy snapshot structure based on the audit feedback.
2. The method for auditable security snapshots and contract verification during agent runtime according to claim 1, characterized in that, The step of freezing the authorization snapshot according to a preset authorization snapshot structure and simultaneously freezing the model strategy snapshot according to a preset model strategy snapshot structure when the agent starts a single session includes: When an agent initiates a single session, it collects the authorization boundary elements of the session subject according to the preset authorization snapshot structure and organizes them into an authorization snapshot. The security review policy elements at the effective time of the session are collected synchronously according to the preset model policy snapshot structure and organized into a model policy snapshot. The authorization snapshot and the model policy snapshot are sealed into a security contract that is immutable during the session runtime.
3. The method for auditable security snapshots and contract verification during agent runtime according to claim 1, characterized in that, The step of generating a globally unique snapshot identifier for the session, setting the authorized snapshot and the model policy snapshot to a runtime immutable state, and binding them to the session's runtime context includes: The normalized content of the authorized snapshot and the model policy snapshot is calculated according to a preset summary rule to obtain a globally unique snapshot identifier at the session level, so that snapshots with consistent content are mapped to the same snapshot identifier, and the snapshot identifier is associated with the session subject identifier and the session start time and registered in the session index table. The snapshot identifier is written into an immutable field of the session's runtime context and persists throughout the session's entire lifecycle. The snapshot identifier is used as the association key for retrieving frozen snapshots in each processing stage within the session. Requests to modify the authorized snapshot and the model policy snapshot during runtime are registered with a tampering identifier and rejected.
4. The method for auditable security snapshots and contract verification during agent runtime according to claim 1, characterized in that, The step of associating each processing step within the session with the snapshot identifier, the parsing module derives the session task based on the authorized snapshot, and sends the session task to the local machine for execution via the inter-agent cooperation protocol, and then returns the execution result, includes: The parsing module reads the authorized snapshot using the snapshot identifier as the association key and derives the session task with the snapshot identifier within the authorized boundary. The session task is then sent to the local execution stage via the inter-agent cooperation protocol. The local execution stage retrieves the authorized snapshot and the model policy snapshot corresponding to the snapshot identifier based on the session task. After comparing the retrieved snapshot with the snapshot identifier carried by the session task, it executes the task and generates an execution result. The execution result, along with the snapshot identifier, is sent back to the upstream stage and written into the session execution trajectory.
5. The method for auditable security snapshots and contract verification during agent runtime according to claim 1, characterized in that, Each processing step performs contract verification on the consistency of the current operation's permission boundaries and policy version according to the frozen authorization snapshot and the model policy snapshot, based on a preset contract verification rule family. This ensures that the session is unaffected by subsequent permission and policy changes during its execution, including: Within the session, each processing step verifies whether the operating subject and target resource of the current operation fall within the authorization boundary according to the frozen authorization snapshot and the preset contract verification rule family, and verifies that the pre-authorization status of high-risk actions has not expired. Out-of-bounds operations are registered with out-of-bounds flags and blocked. Based on the frozen model policy snapshot, verify the consistency between the security audit policy version applicable to the current operation and the policy version at the time of freezing. If the policy versions are inconsistent, restore consistency based on the frozen version of the model policy snapshot and register the drift identifier.
6. The method for auditable security snapshots and contract verification during agent runtime according to claim 1, characterized in that, The step of associating the authorization snapshot with the model policy snapshot along with the execution result to generate an audit record and writing it to the audit log after the session ends includes: After the session ends, the authorized snapshot and the model policy snapshot, together with the execution results of each operation in the session and the contract verification conclusion, are associated and aggregated according to the preset audit record structure using the snapshot identifier as the association key to generate an audit record. The audit record retains the verifiable fingerprints of the authorized snapshot and the model policy snapshot. The audit record is written to the append-only audit log with the snapshot identifier as the primary key and a chained summary of the preceding record is attached to the audit record. For the audit record that fails to be written, an archiving exception identifier is registered and the record is transferred to the retry queue.
7. The method for auditable security snapshots and contract verification during agent runtime according to claim 1, characterized in that, The process of restoring the authorization boundaries and operation subjects of each operation within the session based on the snapshot identifier, triggering snapshot policy calibration based on audit feedback, and reverting to the authorization snapshot structure and the model policy snapshot structure includes: During audit tracing, the corresponding audit record is retrieved from the audit log based on the snapshot identifier, and the operating subject, authorized boundary, and applicable policy version of each operation within the session are restored along the audit record; Based on the frequency of out-of-bounds and drifts reported in the audit feedback, the calibration amount is calculated for the field composition and preset threshold conditions of the authorized snapshot structure and the model strategy snapshot structure. After the calibration amount is verified by preset grayscale, it is fed back to the authorized snapshot structure and the model strategy snapshot structure so that the snapshot freeze of the next session adopts the calibrated structure.
8. A device for auditable security snapshots and contract verification during the runtime of an intelligent agent, characterized in that, The device includes: The snapshot freezing module is used to collect the identity, role, and permission information of the session subject according to the preset authorization snapshot structure when a single session of the agent is started, freeze the authorization snapshot, generate a globally unique snapshot identifier for the session, and set the authorization snapshot to an immutable state during the session runtime. The policy snapshot module is used to synchronously collect the input and output security review policies and risk classification configurations at the time of session effectiveness according to the preset model policy snapshot structure, freeze the model policy snapshot, associate the model policy snapshot with the snapshot identifier and set it to an immutable state during session runtime. The contract verification module is used to associate each processing step in the session with the snapshot identifier and support the derivation, issuance and execution feedback of session tasks. Based on the frozen authorization snapshot and the model policy snapshot, it verifies the permission boundaries and policy version consistency of the current operation according to the preset contract verification rule family. The audit retention module is used to associate the authorized snapshot and the model policy snapshot together with the execution result after the session ends, using the snapshot identifier as the association key, to generate an audit record and write it into the append-only audit log. Based on the snapshot identifier, the authorization boundaries and operation subjects of each operation in the session are restored. The calibration backflow module is used to calculate the calibration amount based on the field composition and preset threshold conditions of the authorized snapshot structure and the model strategy snapshot structure according to the audit feedback, and backflow the calibration amount to the authorized snapshot structure and the model strategy snapshot structure after grayscale verification.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the intelligent agent runtime auditable security snapshot and contract verification method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the steps of the intelligent agent runtime auditable security snapshot and contract verification method as described in any one of claims 1 to 7.