Method and system for compliance auditing of model inference based on trusted execution environment
By remotely verifying and collecting audit information in a trusted execution environment, verifiable audit credentials are generated and written into a trusted evidence storage structure. This solves the verification problem of large model reasoning behavior, enhances the credibility and security of audits, reduces the risk of sensitive information leakage, and provides verifiable technical evidence.
Patent Information
- Application Number
- CN202610788946.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-03
- Publication Date
- 2026-08-25
AI Technical Summary
Existing technologies suffer from challenges such as difficulty in verifying the reasoning behavior of large models, insufficient log credibility, potential leakage of sensitive information during the auditing process, and difficulty in defining the boundaries of responsibility.
By receiving inference requests in a trusted execution environment, performing remote verification, obtaining environmental measurement information, collecting audit information, generating verifiable audit credentials, and writing them into a trusted evidence storage structure, it supports signature verification and evidence storage structure integrity verification.
It enhances the authenticity, credibility, and verifiability of audit records, reduces the risk of sensitive information leakage, forms a complete audit loop, and provides objective technical evidence.
Smart Images

Figure CN122640133A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence security technology, specifically to a large-model inference compliance auditing method and system based on a trusted execution environment, in order to construct a verifiable, traceable, auditable and evidence-provable technical solution for the entire large-model inference process. Background Technology
[0002] With the widespread application of large model technology in numerous scenarios, the types of data processed in the model inference process are becoming increasingly complex, involving sensitive content such as personal privacy, trade secrets, operational data, R&D materials, medical records, and regulatory information. In highly compliant scenarios, the use of large models not only needs to ensure the validity and usability of the model output, but also needs to prove whether the inference itself takes place in a trusted environment, whether it has been verified by established security policies, whether it has been completed under compliance constraints, and whether objective, credible, and verifiable technical evidence can be provided in the event of a dispute.
[0003] Existing systems typically enhance security through logging, access control, network transmission encryption, and permission isolation. However, these measures largely remain at the level of traditional system security and are insufficient for providing credible evidence for the dynamic process of large-scale model inference. Traditional logs can only record that a request was processed by a system at a certain time, but they cannot prove whether the computing environment executing the task is an authenticated and trusted execution environment, nor can they prove that the model image, plugin components, and security configurations were not tampered with during execution.
[0004] On the other hand, traditional log systems are typically maintained by the platform or operations team, and log content may be tampered with, deleted, forged, or selectively retained, resulting in weak reliability. Furthermore, if user input, knowledge retrieval content, and model output are directly stored in plaintext in the logs, the auditing system itself will create a new exposure surface for sensitive information. Once the log repository or operations interface is attacked, data that originally only appeared briefly during inference will remain in the log system for a long time, creating a secondary leakage risk.
[0005] Trusted execution environment (TEI) technology provides runtime isolation and integrity protection for model execution, while remote proofs can be used to demonstrate that the execution environment is in a trusted state. However, most existing technologies only focus on runtime isolation or single-time environment authentication, lacking a technical solution that unifies remote proofs, environment metrics, reasoning behavior summaries, policy execution status, cryptographic signatures, and tamper-proof evidence storage into a closed-loop compliance audit system covering the entire reasoning process of large models. Summary of the Invention
[0006] The purpose of this invention is to provide a compliance auditing method and system for large model inference based on a trusted execution environment, in order to solve the problems in the prior art such as difficulty in verifying large model inference behavior, insufficient log credibility, potential leakage of sensitive information during the auditing process, and difficulty in defining the boundaries of responsibility.
[0007] To achieve the above objectives, this invention provides a large-scale model inference compliance auditing method based on a trusted execution environment, comprising:
[0008] Receive large model inference requests and parse the call information corresponding to the large model inference requests;
[0009] Before performing inference, remote verification is performed on the current execution environment to obtain environmental measurement information corresponding to the current execution environment, and the environmental measurement information is verified against a preset trusted baseline.
[0010] After successful verification, large model inference is performed in a trusted execution environment;
[0011] During and / or after the reasoning process, audit information corresponding to the current reasoning process is collected. The audit information includes summary information for characterizing at least one object in the reasoning input, reasoning process, or reasoning output, as well as the environmental measurement information corresponding to the current reasoning.
[0012] The audit information is combined and encapsulated, and a verifiable audit credential is generated through cryptographic signing.
[0013] Write the audit credentials into a trusted evidence storage structure that supports integrity verification and traceability;
[0014] When compliance reviews, dispute resolution, or security incident investigations are required, signature verification, digest consistency verification, and / or evidence structure integrity verification are performed based on the audit credentials in the trusted evidence storage structure.
[0015] Optionally, the current execution environment includes at least one of a trusted execution environment instance, a runtime image, a model runtime container, an inference plugin component, a key state, and a security configuration;
[0016] The environmental metrics information includes metrics, digest values, or identification information used to characterize the trusted execution environment instance, runtime image, model version, inference plugin components, key status, or security configuration status.
[0017] The audit information further includes at least one of the following: user identity identifier, request time, task type, session identifier, model version, policy number, policy execution status, risk interception status, and knowledge access identifier;
[0018] The summary information includes at least one of input summary, knowledge retrieval summary, and output summary. The input summary, knowledge retrieval summary, and output summary are respectively the representation values obtained after hashing, fingerprinting, summarizing, or compressing the original input content, knowledge retrieval content, and model output content. The audit voucher does not directly store the original plaintext input, knowledge retrieval plaintext, and output plaintext.
[0019] Optionally, before performing inference, remote proof of the current execution environment and acquisition of environment metric information are performed, specifically including:
[0020] Send a proof request carrying a session random number and a challenge value to the remote proof service;
[0021] Receive a remote proof report, which includes at least the TEE instance identifier, runtime image measurement value, model loading package summary, plugin manifest summary, security configuration summary, timestamp, and the challenge value;
[0022] The challenge value in the remote proof report is checked for consistency with the session random number, and the remote proof report identifier, proof validity period, session identifier and challenge value are written into the audit information.
[0023] Before inference begins, the validity period of the remote proof report and the consistency of the status of the running image, plug-in components and security configuration are verified again, and unauthorized hot update operations are prohibited within the inference window.
[0024] Optionally, large model inference is performed in a trusted execution environment, specifically including:
[0025] Perform prompt word assembly, policy execution, output pruning, audit information collection, and cryptographic signature processing in a trusted execution environment;
[0026] Perform non-sensitive network forwarding, general log brokering, and external knowledge base storage outside the trusted execution environment;
[0027] When large model weights or some computation layers cannot reside entirely in the trusted execution environment, a hybrid execution approach is adopted: sensitive layer weights, decoding control, and final output confirmation processing are executed inside the trusted execution environment, while non-sensitive computation layers are placed outside the trusted execution environment, and integrity verification or digest confirmation is performed on intermediate results transmitted across boundaries.
[0028] The process of input serialization, knowledge retrieval parameter construction, output structured field generation, and corresponding summary calculation is completed within the trusted execution environment.
[0029] Optionally, the audit information is combined and encapsulated and generated into a verifiable audit credential through cryptographic signature, including: combining and encapsulating at least one of the environmental measurement information, the digest information, the timestamp, the session identifier, the policy execution status, and the risk interception status according to a preset data structure to form an audit data packet;
[0030] The audit data packet or its digest value is signed by a private key, hardware security module, or security key service bound to the trusted execution environment to generate an audit credential containing the audit data packet and the signature value.
[0031] Optionally, the audit information is combined and encapsulated, and a verifiable audit credential is generated through cryptographic signing, wherein the generation of the digest information satisfies the following verifiability rules:
[0032] Input summary: The user input, system prompts, context round number, and tool call parameters are serialized according to a predetermined field order, and then hashed after being uniformly encoded and formatted.
[0033] Knowledge Request Summary: The hash value is calculated by combining the document identifier, document version number, fragment number, Top-K sorting result, access time, and knowledge source identifier.
[0034] Output summary: Perform hash operation on the final output text or structured fields, or in the case of streaming output, generate segmented summaries of fixed length and then aggregate them into the overall output summary;
[0035] In multi-round sessions, the session identifier, round number, and reference summary value of the audit record from the previous round are included in the current round summary calculation to ensure cross-round verifiability.
[0036] Optionally, the trusted evidence storage structure includes at least one of a protected audit database, a trusted log repository, an append-only log structure, a chained evidence storage structure, or a blockchain evidence storage structure.
[0037] Wherein, when the trusted evidence storage structure is a chain-like evidence storage structure, the subsequent audit record contains the summary value or reference information of the previous audit record, so as to form a traceable chain of evidence.
[0038] Optionally, compliance rule verification may also be performed before and / or after inference.
[0039] When any of the following situations occur: remote proof failure, model version not within the authorized scope, abnormal plugin status, mismatched permission policy, knowledge call scope exceeding the limit, or output result risk level exceeding the threshold, the inference will be refused or the result return will be blocked, and at least one of the following will be written into the blocking audit log: blocking reason, trigger rule identifier, timestamp, current environment measurement information, and user identity identifier.
[0040] Optionally, the signature verification includes verifying the signature value using the public key corresponding to the one used to generate the audit credential;
[0041] The summary consistency verification includes regenerating summary values from the original materials held by the verification party using the same summary method as that used to generate the summary information, and then comparing them.
[0042] The evidence storage structure integrity verification includes verifying the summary reference relationship or integrity proof relationship between the target audit record and its associated records.
[0043] Optionally, in the event of a compliance review, dispute arbitration, or security incident, a technical analysis can be conducted on the boundaries of responsibility for the platform, operations and maintenance party, caller, or third-party service provider by combining environmental measurement information in the audit documents, policy execution status, session identifier, call source identifier, and the relationships in the trusted evidence storage structure.
[0044] A second aspect of the present invention also provides a large-scale model inference compliance auditing system based on a trusted execution environment, comprising:
[0045] The inference request access module is used to receive large model inference requests and parse the call information corresponding to the large model inference requests.
[0046] The environment verification module is used to remotely verify the current execution environment before performing inference, obtain the environment measurement information corresponding to the current execution environment, and verify the environment measurement information with a preset trusted baseline.
[0047] The inference execution module is used to perform large model inference in a trusted execution environment after verification.
[0048] The audit information collection module is used to collect audit information corresponding to the current reasoning process during and / or after the reasoning process. The audit information includes summary information for characterizing at least one object in the reasoning input, reasoning process or reasoning output, as well as the environmental measurement information corresponding to the current reasoning.
[0049] The cryptographic signature module is used to combine and encapsulate the audit information and generate a verifiable audit credential through cryptographic signature;
[0050] The trusted evidence storage module is used to write the audit credentials into a trusted evidence storage structure that supports integrity verification and traceability;
[0051] The audit verification module is used to perform signature verification, digest consistency verification and / or evidence structure integrity verification based on the audit documents in the trusted evidence storage structure.
[0052] The large-model inference compliance auditing method and system based on a trusted execution environment according to the present invention can achieve at least the following technical effects:
[0053] By linking large model reasoning behavior with remote proof results and environmental metrics information of a trusted execution environment, audit logs not only reflect what happened, but also prove in what trusted environment the behavior occurred, thereby enhancing the authenticity, credibility, and verifiability of audit logs.
[0054] By recording only the summarized representation values of inputs, knowledge retrieval, and outputs, instead of directly recording the original plaintext content, the risk of sensitive plaintext exposure and long-term storage in the audit chain is reduced while meeting the requirements of post-verification, thus preventing the audit system from becoming a new source of leakage.
[0055] By combining cryptographic signatures with a trusted evidence storage structure, audit records are made verifiable in origin, detectable in content modification, and traceable in chain of evidence, thereby enhancing the integrity of the evidence chain and its resistance to tampering.
[0056] By blocking and simultaneously recording responses to compliance failures, abnormal permissions, excessive knowledge access, or excessive output risks, the system not only records successfully executed reasoning behaviors but also tracks abnormal behaviors that are rejected, blocked, or terminated, thus forming a more complete audit loop.
[0057] By performing signature verification, digest consistency comparison, and evidence structure integrity verification when needed, and combining environmental measurement information, policy execution status, and session correlation for technical analysis, it can provide objective, verifiable, and evidentiary technical evidence for regulatory spot checks, dispute arbitration, liability determination, and security incident investigation.
[0058] Other features and advantages of the invention will become clear from the following detailed description of exemplary embodiments of the invention with reference to the accompanying drawings. Attached Figure Description
[0059] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments of the invention and, together with their description, serve to explain the principles of the invention.
[0060] Figure 1 This is the overall flowchart of the large-model inference compliance auditing method based on a trusted execution environment according to the present invention;
[0061] Figure 2 This is a schematic diagram of the module structure of the compliance audit system of the present invention;
[0062] Figure 3 This is a flowchart illustrating the audit information collection, summarization, and audit voucher generation processes of this invention.
[0063] Figure 4 This is a schematic diagram of the credible evidence storage structure and evidence chain organization of the present invention;
[0064] Figure 5 This is a flowchart illustrating the compliance failure blocking and synchronous auditing process of this invention.
[0065] Figure 6 This is a flowchart illustrating the post-audit record verification, traceability, and responsibility analysis process for this invention. Detailed Implementation
[0066] Various exemplary embodiments of the present invention will now be described in detail with reference to the accompanying drawings. It should be noted that, unless otherwise specifically stated, the relative arrangement, numerical expressions, and values of the components and steps set forth in these embodiments do not limit the scope of the invention.
[0067] The following description of at least one exemplary embodiment is merely illustrative and is in no way intended to limit the invention or its application or use.
[0068] Techniques, methods, and equipment known to those skilled in the art may not be discussed in detail, but where appropriate, such techniques, methods, and equipment should be considered part of the specification.
[0069] In all the examples shown and discussed herein, any specific values should be interpreted as merely exemplary and not as limitations. Therefore, other examples of exemplary embodiments may have different values.
[0070] In this specification, "Trusted Execution Environment" refers to a protected execution environment that can provide runtime isolation, confidentiality protection, and integrity protection; "Environmental Measurement Information" refers to measurement results, digest values, or identification information used to characterize trusted execution environment instances, runtime images, model versions, plug-in components, key states, and security configuration states; "Digest Information" refers to the characterization value obtained after hashing, fingerprinting, digest encoding, or compression characterization of the original input content, knowledge call content, model output content, policy state, or related business objects.
[0071] In this specification, "trusted evidence storage structure" refers to a data structure or storage system that can support the verification and traceability of audit record integrity, including protected audit databases, trusted log repositories, append-only log structures, chained evidence storage structures, or blockchain evidence storage structures.
[0072] This embodiment illustrates the complete technical process of the large-model inference compliance audit method. For example... Figure 1As shown, this method does not perform remote proof in isolation, nor does it simply save ordinary logs after inference. Instead, it organizes a verifiable technical closed loop around a large model inference request, which includes verification of the trusted environment before inference, collection of audit information during inference, signature storage after inference, and post-signature verification and traceability.
[0073] S101, Receive large model inference request. The system receives large model inference requests from user terminals, business systems, or external interfaces, and parses the call information corresponding to the request. The call information may include at least one of user identity identifier, task type, session identifier, call source identifier, and call context. The above information may be recorded in the form of de-identified identifiers or business identifiers to support subsequent audit correlation without exposing too much business data.
[0074] S102, Perform remote verification and obtain environmental metrics information before inference. Before performing inference, the system performs remote verification of the current execution environment and obtains environmental metrics information characterizing the trusted state of the current execution environment. The environmental metrics information may include at least one of the following: trusted execution environment instance identifier, runtime image metric value, model version information, model runtime container configuration, inference plugin component integrity information, key status, and security configuration status. The system compares the environmental metrics information with a preset trusted baseline to determine whether the current environment meets the inference execution requirements.
[0075] S103, Perform policy verification and determine whether inference is allowed. After remote verification passes, the system further verifies at least one of the following: the permission policy, model authorization policy, knowledge retrieval policy, and output compliance policy applicable to the current request. If the verification passes, the inference execution phase is allowed; if the remote verification or policy verification fails, the system refuses to execute inference or suspends subsequent processing and enters the blocking and auditing process.
[0076] S104. Perform large model inference within a trusted execution environment. After successful verification, the system invokes the target large model to perform inference within the trusted execution environment. During inference, the system can combine knowledge base retrieval, tool invocation, permission policies, or business rules to complete the processing. Because the inference occurs within a remotely verified trusted execution environment, subsequent audit logs can establish a correspondence with the state of that trusted execution environment.
[0077] S105, Collect audit information corresponding to this reasoning process. For example... Figure 3As shown, the system collects audit information corresponding to the current inference process before, during, and / or after inference. The audit information includes summary information characterizing at least one object in the inference input, inference process, or inference output, as well as environmental metrics corresponding to the current inference. In optional embodiments, the audit information may further include at least one of the following: request time, task type, model version, policy number, policy execution status, risk interception status, knowledge call identifier, session identifier, and call source identifier.
[0078] S106, the original content is digested. To prevent the audit system from becoming a new storage center for sensitive information, the system digests user input, knowledge retrieval content, model output, or policy state, storing only the representational values that can be used for post-verification. This digestion process can be implemented using hash functions, fingerprint algorithms, digest encoding, or feature compression. The audit credentials do not directly store the original plaintext input, knowledge retrieval plaintext, or output plaintext. In this way, the verifier can regenerate the digest and perform consistency comparison while holding the original materials, and the audit system itself does not need to store sensitive plaintext for extended periods.
[0079] S107, Generate a verifiable audit credential. The system combines and encapsulates at least one of the following according to a preset data structure: environmental measurement information, digest information, timestamp, session identifier, policy execution status, and risk interception status, to form an audit data packet. Subsequently, the audit data packet or its digest value is signed using a private key bound to the trusted execution environment, a hardware security module, or a security key service to generate a verifiable audit credential. This audit credential can simultaneously represent the content of the reasoning behavior, the execution environment status, and the source of the signature.
[0080] In this embodiment of the invention, audit information is combined and encapsulated, and a verifiable audit credential is generated through cryptographic signature. The generation of the digest information satisfies the following verifiable rules: Input digest: User input, system prompts, context round number, and tool call parameters are serialized according to a predetermined field order, and hashed after unified character encoding and format regularization; Knowledge call digest: Document identifier, document version number, fragment sequence number, Top-K sorting result, access time, and knowledge source identifier are combined and a hash value is calculated; Output digest: The final output text or structured fields are hashed, or in a streaming output scenario, segmented digests are generated according to a fixed length and then aggregated into a whole output digest; In multi-round sessions, the session identifier, round number, and reference digest value of the audit record from the previous round are included in the current round digest calculation to ensure cross-round verifiability. By clarifying the standardized generation path of input digest, knowledge call digest, and output digest, the audit credential no longer relies on the platform's unilateral interpretation, but becomes objective technical evidence that can be independently reproduced and verified by a third party, significantly enhancing its persuasiveness in regulatory review, arbitration, and compliance audit.
[0081] S108, Write the audit credentials to a trusted evidence storage structure. The system writes the audit credentials to a trusted evidence storage structure that supports integrity verification and traceability. The trusted evidence storage structure can be a protected audit database, a trusted log repository, an append-only log structure, a chained evidence storage structure, or a blockchain evidence storage structure. In a preferred embodiment, such as... Figure 4 As shown, a subsequent audit record may contain a summary value or reference information of the previous audit record, enabling multiple audit records to form a traceable chain of evidence in chronological, session, or task order.
[0082] S109, executes blocking and simultaneously records logs when compliance fails. For example... Figure 5 As shown, when remote proof fails, the model version is outside the authorized scope, the plugin status is abnormal, the permission policy does not match, the knowledge access scope exceeds the limit, or the risk level of the output result exceeds the threshold, the system refuses to execute the inference or blocks the return of the result, and generates a blocking audit record. The blocking audit record may include at least one of the following: blocking reason, trigger rule identifier, timestamp, current environment measurement information, user identity identifier, and session identifier. Thus, the system not only records successfully executed inference behavior, but also records abnormal behaviors that are rejected, blocked, or terminated.
[0083] S110, implement post-event verification and traceability, and conduct responsibility analysis. For example... Figure 6As shown, in the event of regulatory inspections, internal audits, dispute arbitrations, liability determinations, or security incident investigations, the verifying party can read the target audit record and perform signature verification, digest consistency verification, and / or evidence structure integrity verification. Signature verification confirms that the audit voucher has not been modified since its signature was generated; digest consistency verification confirms whether the original materials held by the verifying party correspond to the reasoning behavior represented by the audit record; evidence structure integrity verification confirms whether the target audit record's position and association within the evidence chain are continuous. Based on this, the system can combine environmental measurement information, policy execution status, session identifiers, and call source identifiers to conduct technical analysis of the responsibility boundaries of the platform provider, operations and maintenance provider, caller, or third-party service provider.
[0084] In one embodiment of the present invention, remote proof of the current execution environment and acquisition of environment measurement information are performed before inference. Specifically, this includes: sending a proof request carrying a session random number and a challenge value to a remote proof service; receiving a remote proof report, which includes at least a TEE instance identifier, runtime image measurement value, model loading package summary, plugin manifest summary, security configuration summary, timestamp, and the challenge value; performing a consistency check between the challenge value in the remote proof report and the session random number, and writing the remote proof report identifier, proof validity period, session identifier, and challenge value into audit information; and re-checking the validity period of the remote proof report and the consistency of the runtime image, plugin components, and security configuration before inference starts, and prohibiting unauthorized hot update operations within the inference window. Prohibiting unauthorized hot updates within the inference window and re-checking the consistency of the image, plugins, and security configuration before inference starts effectively avoids time-difference attacks where the environment is trusted during proof but has been tampered with during inference, enhancing the real-time reliability of environment measurements.
[0085] In one embodiment of the present invention, large model inference is performed in a trusted execution environment (TEE), specifically including: prompt word assembly, policy execution, output pruning, audit information collection, and cryptographic signature processing within the TEE; non-sensitive network forwarding, ordinary log proxying, and external knowledge base storage outside the TEE; when the large model weights or some computational layers cannot reside entirely within the TEE, a hybrid execution method is adopted: sensitive layer weights, decoding control, and final output confirmation processing are executed within the TEE, while non-sensitive computational layers are placed outside the TEE, and integrity verification or digest confirmation is performed on intermediate results transmitted across boundaries; input serialization, knowledge call parameter construction, output structured field generation, and corresponding digest calculation are completed within the TEE. By placing the sensitive layer and decoding control within the TEE, and non-sensitive computation outside the TEE, and performing integrity verification on intermediate results transmitted across boundaries, the solution is applicable to real-world scenarios such as large model weights, limited GPU memory, and multi-node deployment, significantly improving feasibility while ensuring security. Furthermore, it enforces integrity checks or summary verification on intermediate results generated outside of the TEE to prevent sensitive information from being replaced or contaminated at the boundary, ensuring that the overall trusted audit loop is not compromised even when hybrid execution is employed.
[0086] Another embodiment of the present invention is used to illustrate specific implementations of the present invention in different service scenarios. In the cloud-based encrypted inference service scenario, the model service provider deploys large model inference instances in a cloud-based trusted execution environment. Users submit inference requests through clients, business systems, or API interfaces. Users or regulators typically cannot directly control the cloud operating environment, and therefore need to rely on remote proof and verifiable auditable credentials to confirm the credibility of the inference process.
[0087] In one implementation, after receiving a user's inference request, the cloud platform first remotely authenticates the trusted execution environment instance hosting the inference task to obtain environment measurement information. This environment measurement information may include at least one of the following: trusted execution environment instance identifier, runtime image metric value, model version information, inference plugin component integrity information, key status, and security configuration status. The platform compares this environment measurement information with a preset trusted baseline; if the comparison passes, the inference is allowed to proceed within the trusted execution environment; if the comparison fails, inference execution is rejected and a blocking audit record is generated.
[0088] During inference execution, the platform performs summarization processing on user input, knowledge call content, model output, or policy execution status, generating at least one of the following: input summary, knowledge call summary, output summary, or policy status summary. Instead of directly saving the original user input, knowledge call text, or model output plaintext in the audit log, the platform binds the summary information with the environmental metrics corresponding to that inference instance and generates a verifiable audit credential through cryptographic signature.
[0089] The audit credentials are written into a trusted evidence storage structure. This trusted evidence storage structure can be a cloud-based trusted log repository, an append-only log structure, a chained evidence structure, or other data structures that support integrity verification. When customer acceptance, regulatory inspection, or dispute resolution is required, users, customer systems, or regulatory verification parties can verify the audit credentials based on the public key or certificate chain provided by the platform, recalculate the digest value using their original inputs or outputs, and compare its consistency with the digest information in the audit credentials.
[0090] Using the above method, the verifier can confirm whether a specific inference request corresponds to a specified audit credential, whether it is processed by a specified model version, whether it occurs in a trusted execution environment verified remotely, and whether the relevant audit records remain intact in the evidence storage structure, without needing to access the full business logs within the cloud platform. This method enables environment trustworthiness verification, summary recording of inference behavior, signature credential generation, trusted evidence storage, and post-signature verification and traceability in cloud-deployed scenarios.
[0091] For example, this invention can be implemented in highly sensitive data scenarios such as finance, healthcare, government affairs, legal services, or business analysis. In such scenarios, user input may include customer asset information, medical records, treatment records, contract texts, risk control reports, confidential business data, or other sensitive content. If traditional log systems directly save input and output in plaintext, it can easily create new sensitive information exposure surfaces in the audit process.
[0092] In one implementation, the system verifies the trusted execution environment, model version, plugin integrity, and security policy configuration before inference, and performs compliance policy checks on user permissions, knowledge access scope, and output risk level. If the verification passes, the system executes inference and generates a digested audit credential; if remote proof fails, permission policy mismatch occurs, knowledge access scope exceeds limits, model version is abnormal, plugin integrity verification fails, or the output risk level exceeds a preset threshold, the system refuses to execute inference or blocks the return of inference results, and simultaneously generates a blocking audit record.
[0093] The blocking audit record may include at least one of the following: blocking reason, trigger rule identifier, time information, current environment measurement information, user identity digest, input digest, and risk blocking status. For model outputs that have been generated but blocked, the system may only save the output digest and risk policy hit status, without saving the complete plaintext output. The blocking audit record is also cryptographically signed to form a verifiable audit credential and written into a trusted evidence storage structure.
[0094] In financially sensitive Q&A scenarios, if an employee requests access to customer asset information beyond their authorized scope, the system can trigger a policy block during the knowledge access phase and write the access policy number, the reason for the block, the input summary, and environmental measurement information into the block audit voucher. The audit department can then verify the signature to confirm the actual occurrence of the block event and confirm whether the system has executed the established risk control rules using the policy number.
[0095] For example, in medical data analysis scenarios, if a large model processes medical record summaries, examination results, or auxiliary diagnostic texts, the system does not write the patient's original medical record, original input text, or complete model output into the audit log. Instead, it saves the corresponding summary information and strategy execution status. When a dispute arises regarding the result, the medical institution or authorized verification party can use the original materials they hold to recalculate the summary and compare it with the summary information in the audit voucher to confirm whether the disputed material corresponds to a specific inference record.
[0096] Through the above methods, the system can not only record successfully executed reasoning behaviors, but also record the trajectory of abnormal behaviors that are rejected, blocked, or terminated, thereby proving whether the relevant compliance policies have been actually implemented. At the same time, since the audit log does not directly save the original plaintext input, knowledge call original text, and complete output content, but saves the corresponding summary information, it can reduce the risk of secondary leakage caused by the long-term storage of sensitive plaintext data by the audit system, and realize the summarization, verification, and traceability of successful reasoning behaviors and abnormal blocking behaviors.
[0097] For example, the inference service platform is deployed on the side of a third-party service provider, and the client terminal submits large model inference requests to the inference service platform through an interface. In this scenario, clients are typically concerned about whether the platform processes requests in an agreed-upon trusted environment, whether it bypasses security policies, whether it modifies or deletes audit records, and whether it can delineate the responsibilities of the platform, the caller, the operations and maintenance provider, or the third-party component provider in the event of a dispute.
[0098] In one implementation, the platform performs a trusted environment remote verification before each inference, generates summary audit information during the inference process, and generates a signed audit credential after inference and writes it into a trusted storage structure. The audit credential is bound to at least some of the following: environmental measurement information, inference behavior summary information, policy execution status, time information, and session identifier.
[0099] When a customer believes there is a dispute regarding a particular output, they can request the platform to provide corresponding audit credentials. The customer can use the platform's public key, a third-party certificate chain, or a verification interface recognized by the regulatory authority to sign and verify the audit credentials; they can also recalculate the digest using the original input or disputed output in their possession and compare it with the digest information in the audit credentials; or they can verify whether the audit record is in a continuous evidence storage chain based on the relationship between previous and subsequent records in the evidence storage structure.
[0100] If the audit documentation shows that remote proof was successful, the model version matches the agreement, the policy execution status is normal, and the input / output summaries match the materials held by the customer, then it can be proven that the platform executed the inference in a trusted environment as agreed. If the audit documentation shows that remote proof failed, the plugin status is abnormal, the policy is blocked, or the environment measurement information is inconsistent with the trusted baseline, it can further help determine whether the dispute originates from the platform deployment environment, the caller's request content, the model configuration, external plugin components, or other third-party services.
[0101] In another implementation, the trusted execution environment can also be deployed on an enterprise's local server, a local large-scale model appliance, or a dedicated inference node. Audit credentials can be written to the enterprise's internal trusted log repository or appended to audit storage. The enterprise's internal audit department can verify whether a particular inference was executed by a specified model in a trusted environment and whether it has been processed by the enterprise's preset security policies by verifying signatures, comparing digests, and checking the continuity of evidence.
[0102] Through the above methods, the present invention can reuse the same trusted audit mechanism in scenarios such as supplier hosting, customer acceptance, regulatory inspection and local enterprise audit. It enables the verification subject to perform signature verification, digest consistency comparison and traceability verification on specific reasoning behavior based on audit vouchers and trusted evidence storage structures, thereby verifying the authenticity, integrity and environmental trustworthiness of the reasoning behavior, and providing technical basis for subsequent responsibility determination based on environmental measurement information, policy execution status, session association relationship and evidence storage records.
[0103] Another embodiment of the present invention is used to illustrate a system structure corresponding to the above method. For example... Figure 2As shown, the system of the present invention may include an inference request access module, an environment verification module, a policy verification module, an inference execution module, an audit information collection module, a digest generation module, a cryptographic signature module, a trusted evidence storage module, and an audit verification module; in optional embodiments, it may also include a compliance verification and blocking module and a responsibility analysis module. The responsibility analysis module is positioned after the audit verification module and is used to perform responsibility boundary analysis based on the audit verification results, without participating in the generation and writing of audit credentials.
[0104] The inference request access module receives inference requests from user terminals, business systems, or external interfaces, and parses the user identity, task type, session identifier, and call context. The environment verification module remotely verifies the current trusted execution environment instance, runtime image, model version, and plugin components before inference execution, and compares the obtained environment metrics with a preset trusted baseline.
[0105] The audit information acquisition module collects key information supporting post-hoc verification before, during, and after inference, and converts raw inputs, knowledge retrieval, and model outputs into digest representations. The digest generation module generates digest information based on hashing, fingerprinting, digest encoding, or compression. The cryptographic signature module encapsulates environmental metrics, digest information, policy states, and timestamps into audit data packets and signs the audit data packets or their digest values. The trusted evidence storage module stores audit credentials and maintains their integrity verification relationships.
[0106] The audit verification module is used to perform signature verification, digest consistency comparison, environmental metric verification, and evidence structure integrity verification post-event. The responsibility analysis module follows the audit verification module. It receives the signature verification results, digest consistency comparison results, environmental metric verification results, and evidence structure integrity verification results from the audit verification module, and, in conjunction with blocking audit logs, policy execution status, session relationships, and call source identifiers, performs technical analysis on the responsibility boundaries of the platform, operations and maintenance party, caller, or third-party service provider.
[0107] The modules described above can be deployed on the same physical device or distributed across a trusted execution environment, business gateway, audit server, and evidence storage node. As long as the modules can complete remote verification, digest auditing, signature-based evidence storage, and post-verification according to the above process, the technical effects of this invention can be achieved.
[0108] Another embodiment of the present invention illustrates the software and hardware carriers for implementing the method of the present invention. The electronic device may include a processor, a memory, a communication interface, and a bus. The memory is used to store computer programs or computer-executable instructions, and the processor is used to read and execute the computer programs or computer-executable instructions to implement the large-model inference compliance auditing method described in any of the foregoing embodiments.
[0109] In one embodiment, when the processor executes the computer program, it performs at least the following steps: receiving a large model inference request; remotely verifying the trusted execution environment carrying the inference task and obtaining environment measurement information; executing large model inference after the remote verification is successful; collecting summary information and environment measurement information corresponding to the inference process; generating a signature audit certificate; writing the signature audit certificate into a trusted evidence storage structure; and performing signature verification, summary consistency comparison, evidence storage continuity verification, and responsibility analysis as needed.
[0110] The computer-readable storage medium can be a tangible medium capable of storing computer programs or computer-executable instructions, including but not limited to read-only memory, random access memory, flash memory, solid-state drive, hard disk, optical disk, mobile storage device, or other storage media capable of being read by a processor. When the computer program or computer-executable instructions are executed by the processor, the processor implements the steps of the large-model inference compliance auditing method based on a trusted execution environment as described in any of the foregoing embodiments.
[0111] The computer program product may include one or more computer programs, computer instructions, or program code. When the computer program product runs on an electronic device, server, cloud-based trusted execution environment, enterprise local server, or large model inference node, it causes the corresponding device to execute the compliance auditing method steps for large model inference based on a trusted execution environment as described in any of the foregoing embodiments. The computer program product may be provided in the form of an installation package, image package, software development kit, cloud deployment package, online distribution package, or other software product.
[0112] In this embodiment, the electronic device, computer-readable storage medium, and computer program product can all be used to implement... Figure 1 The method flow shown can be used with... Figure 2 The system modules shown work together to achieve remote proof before reasoning, collection of audit information summaries, generation of signature vouchers, trusted storage, record keeping for compliance failures, and post-event verification and traceability. The technical solutions of the computer-readable storage media and computer program products belong to the same inventive concept as the aforementioned method embodiments; for details not described in detail, please refer to the aforementioned method and system embodiments.
[0113] The above description of the structure, features, and effects of the present invention is based on the embodiments shown in the figures. However, the above are only preferred embodiments of the present invention. It should be noted that the technical features involved in the above embodiments and their preferred methods can be reasonably combined and matched by those skilled in the art to form a variety of equivalent solutions without departing from or changing the design concept and technical effects of the present invention. Therefore, the present invention is not limited to the scope of implementation shown in the figures. Any changes made in accordance with the concept of the present invention, or modifications to equivalent embodiments, that do not exceed the spirit covered by the specification and figures, should be within the protection scope of the present invention.
Claims
1. A compliance auditing method for large-scale model inference based on a trusted execution environment, characterized in that, include: Receive large model inference requests and parse the call information corresponding to the large model inference requests; Before performing inference, remote verification is performed on the current execution environment to obtain environmental measurement information corresponding to the current execution environment, and the environmental measurement information is verified against a preset trusted baseline. After successful verification, large model inference is performed in a trusted execution environment; During and / or after the reasoning process, audit information corresponding to the current reasoning process is collected. The audit information includes summary information for characterizing at least one object in the reasoning input, reasoning process, or reasoning output, as well as the environmental measurement information corresponding to the current reasoning. The audit information is combined and encapsulated, and a verifiable audit credential is generated through cryptographic signing. Write the audit credentials into a trusted evidence storage structure that supports integrity verification and traceability; When compliance reviews, dispute resolution, or security incident investigations are required, signature verification, digest consistency verification, and / or evidence structure integrity verification are performed based on the audit credentials in the trusted evidence storage structure.
2. The large-model inference compliance auditing method based on a trusted execution environment according to claim 1, characterized in that, The current execution environment includes at least one of the following: trusted execution environment instance, runtime image, model runtime container, inference plugin component, key state, and security configuration; The environmental metrics information includes metrics, digest values, or identification information used to characterize the trusted execution environment instance, runtime image, model version, inference plugin components, key status, or security configuration status. The audit information further includes at least one of the following: user identity identifier, request time, task type, session identifier, model version, policy number, policy execution status, risk interception status, and knowledge access identifier; The summary information includes at least one of input summary, knowledge retrieval summary and output summary. The input summary, knowledge retrieval summary and output summary are respectively the representation values obtained after hashing, fingerprinting, summarizing or compressing the original input content, knowledge retrieval content and model output content. The audit voucher does not directly store the original plaintext input, knowledge retrieval plaintext and output plaintext.
3. The large-model inference compliance auditing method based on a trusted execution environment according to claim 1, characterized in that, Before performing inference, remote proof of the current execution environment and acquisition of environment metrics are performed, specifically including: Send a proof request carrying a session random number and a challenge value to the remote proof service; Receive a remote proof report, which includes at least the TEE instance identifier, runtime image measurement value, model loading package summary, plugin manifest summary, security configuration summary, timestamp, and the challenge value; The challenge value in the remote proof report is checked for consistency with the session random number, and the remote proof report identifier, proof validity period, session identifier and challenge value are written into the audit information. Before inference begins, the validity period of the remote proof report and the consistency of the status of the running image, plug-in components and security configuration are verified again, and unauthorized hot update operations are prohibited within the inference window.
4. The compliance auditing method for large-scale model inference based on a trusted execution environment according to claim 1, characterized in that, Performing large model inference in a trusted execution environment specifically includes: Perform prompt word assembly, policy execution, output pruning, audit information collection, and cryptographic signature processing in a trusted execution environment; Perform non-sensitive network forwarding, general log brokering, and external knowledge base storage outside the trusted execution environment; When large model weights or some computation layers cannot reside entirely in the trusted execution environment, a hybrid execution approach is adopted: sensitive layer weights, decoding control, and final output confirmation processing are executed inside the trusted execution environment, while non-sensitive computation layers are placed outside the trusted execution environment, and integrity verification or digest confirmation is performed on intermediate results transmitted across boundaries. The process of input serialization, knowledge retrieval parameter construction, output structured field generation, and corresponding summary calculation is completed within the trusted execution environment.
5. The large-model inference compliance auditing method based on a trusted execution environment according to claim 1, characterized in that, The audit information is combined and encapsulated, and a verifiable audit credential is generated using cryptographic signature, including: At least one of the environmental measurement information, the summary information, the timestamp, the session identifier, the policy execution status, and the risk interception status is combined and encapsulated according to a preset data structure to form an audit data packet; The audit data packet or its digest value is signed by a private key, hardware security module, or security key service bound to the trusted execution environment to generate an audit credential containing the audit data packet and the signature value.
6. The large-model inference compliance auditing method based on a trusted execution environment according to claim 5, characterized in that, The audit information is combined and encapsulated, and a verifiable audit credential is generated through cryptographic signing, wherein the generation of the digest information satisfies the following verifiability rules: Input summary: The user input, system prompts, context round number, and tool call parameters are serialized according to a predetermined field order, and then hashed after being uniformly encoded and formatted. Knowledge Request Summary: The hash value is calculated by combining the document identifier, document version number, fragment number, Top-K sorting result, access time, and knowledge source identifier. Output summary: Perform hash operation on the final output text or structured fields, or in the case of streaming output, generate segmented summaries of fixed length and then aggregate them into the overall output summary; In multi-round sessions, the session identifier, round number, and reference summary value of the audit record from the previous round are included in the current round summary calculation to ensure cross-round verifiability.
7. The large-model inference compliance auditing method based on a trusted execution environment according to claim 1, characterized in that, Compliance rule checks are also performed before and / or after inference. When any of the following situations occur: remote proof failure, model version not within the authorized scope, abnormal plugin status, mismatched permission policy, knowledge call scope exceeding the limit, or output result risk level exceeding the threshold, the inference will be refused or the result return will be blocked, and at least one of the following will be written into the blocking audit log: blocking reason, trigger rule identifier, timestamp, current environment measurement information, and user identity identifier.
8. The large-model inference compliance auditing method based on a trusted execution environment according to claim 1, characterized in that, The signature verification includes verifying the signature value using the public key corresponding to the generation of the audit credential. The summary consistency verification includes regenerating summary values from the original materials held by the verification party using the same summary method as that used to generate the summary information, and then comparing them. The evidence storage structure integrity verification includes verifying the summary reference relationship or integrity proof relationship between the target audit record and its associated records.
9. The large-model inference compliance auditing method based on a trusted execution environment according to claim 1, characterized in that, In the event of compliance reviews, dispute arbitrations, or security incidents, technical analysis is conducted to determine the boundaries of responsibility for the platform, operations and maintenance provider, caller, or third-party service provider by combining environmental metrics information, policy execution status, session identifiers, call source identifiers, and relationships in the trusted evidence storage structure within the audit documentation.
10. A large-scale model inference compliance audit system based on a trusted execution environment, employing the large-scale model inference compliance audit method based on a trusted execution environment as described in any one of claims 1 to 9, characterized in that, The system includes: The inference request access module is used to receive large model inference requests and parse the call information corresponding to the large model inference requests. The environment verification module is used to remotely verify the current execution environment before performing inference, obtain the environment measurement information corresponding to the current execution environment, and verify the environment measurement information with a preset trusted baseline. The inference execution module is used to perform large model inference in a trusted execution environment after verification. The audit information collection module is used to collect audit information corresponding to the current reasoning process during and / or after the reasoning process. The audit information includes summary information for characterizing at least one object in the reasoning input, reasoning process or reasoning output, as well as the environmental measurement information corresponding to the current reasoning. The cryptographic signature module is used to combine and encapsulate the audit information and generate a verifiable audit credential through cryptographic signature; The trusted evidence storage module is used to write the audit credentials into a trusted evidence storage structure that supports integrity verification and traceability; The audit verification module is used to perform signature verification, digest consistency verification and / or evidence structure integrity verification based on the audit documents in the trusted evidence storage structure.