AI interactive data protection method and system based on security context protocol
By introducing security context services and protocols, the generation of secure references/tokens replace sensitive data, the data security and compliance issues in the AI interaction process are solved, and the secure storage and access control of sensitive data is realized, improving data security and compliance.
Patent Information
- Application Number
- CN202510686752.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-27
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2045-05-27
AI Technical Summary
The prior art has security risks in data transmission, processing and storage during AI interaction, especially the leakage and compliance issues of sensitive context data, which are difficult to meet data protection regulations.
Introduce Security Context Services (SCS) and Security Context Protocol (SCP) to replace sensitive data by generating security references/tokens, and implement secure storage, retrieval and access control of sensitive data to ensure the security of data during transmission and processing.
It greatly reduces the risk of sensitive data leakage, improves data security and compliance, supports fine-grained access control and dynamic desensitization, and meets data protection regulations.
Smart Images

Figure CN120200863B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data security technology, and in particular to a method and system for protecting AI interactive data based on a security context protocol. Background Art
[0002] With the rapid development of artificial intelligence (AI) technology, especially the widespread use of large language models (LLMs) in various applications, AI systems need to access a large amount of contextual information to achieve coherent, personalized, and effective interactions, such as user conversation history, personally identifiable information (PII), preferences, session state and intermediate data, and real-time information retrieved from external systems. However, existing technologies for processing this contextual information pose significant data security risks, mainly manifested in the following aspects:
[0003] Transmission risk: Although channel encryption technologies such as TLS / SSL can be used, data may still exist in plain text when processed at the endpoint (client, gateway, AI model server), increasing the risk of data leakage when the intermediate node is attacked.
[0004] Processing risks: AI models (especially closed-source models provided by third parties) are exposed to complete contextual data when processing requests. Their internal data processing and storage policies may be uncontrolled, posing the risk of data misuse or accidental leakage.
[0005] Storage risk: If context information is improperly stored (e.g., logging, caching), it may result in sensitive data being persisted in insecure locations.
[0006] Compliance risk: Directly transmitting and processing contextual information containing PII makes it difficult to meet the requirements of data minimization, purpose limitation, and user consent under data protection regulations such as GDPR and CCPA.
[0007] Coarse access control: It is difficult to implement fine-grained access control on context information, and the entire context block is often exposed to multiple components in the processing flow.
[0008] Therefore, there is an urgent need for a new technical solution that can minimize the exposure of sensitive contextual data within the system (especially when transmitting and submitting to AI models) while ensuring the effectiveness of AI interaction, thereby improving the data security and compliance of AI applications. Summary of the Invention
[0009] Based on this, the embodiments of the present application provide an AI interaction data protection method and system based on a security context protocol to solve the security risk problems in the transmission and processing of AI interaction context data in the prior art.
[0010] In a first aspect, a method for protecting AI interaction data based on a security context protocol is provided, the method comprising:
[0011] The client application sends a user request to the application gateway, carrying a session identifier;
[0012] After receiving the request, the gateway queries the policy engine for the context scope and security processing policy required for this interaction based on the request type and target AI model;
[0013] The gateway uses the session identifier to request the required context data from the security context service and pass the policy instructions;
[0014] After verifying the gateway's permissions, the SCS retrieves the complete context data and processes it according to the policy instructions;
[0015] The gateway assembles the user's current input and the security context data block obtained from the SCS into a final request based on the SCP protocol format and sends it to the AI model;
[0016] After receiving the request, the AI model processes it based on the information received;
[0017] The AI model returns the processing result, the gateway receives the response and updates the session context as needed; the gateway interacts with the SCS again to request an updated context; the SCS verifies the permission and updates the stored full context;
[0018] The gateway returns the final response of the AI model to the client application, completing the entire interaction process.
[0019] Optionally, after receiving the request, the gateway queries the policy engine for the context scope and security processing policy required for this interaction, including:
[0020] The gateway parses the user request, extracting the request type, target AI model information, and session identifier;
[0021] The gateway constructs a query request based on the extracted information. The query request includes the session identifier, request type, and target AI model identifier.
[0022] The gateway sends a query request to the policy engine, requesting the context data scope and security processing policy related to this interaction;
[0023] Based on the query request, the policy engine returns the scope of contextual data required for this interaction, including but not limited to user historical conversation records, user personal identity information, user preferences, session status and intermediate data, as well as real-time user-related information retrieved from external systems, and corresponding security processing policies.
[0024] Optionally, the gateway uses the session identifier to request the required context data from the Security Context Service (SCS) and pass policy instructions, including:
[0025] The gateway constructs a request message based on the context data scope and security processing policy returned by the policy engine. The request message includes a session identifier, the required context data scope, and security processing policy instructions.
[0026] The gateway sends the constructed request message to the SCS via a secure communication channel to request context data associated with the session identifier;
[0027] The SCS receives the request message sent by the gateway and parses the session identifier, context data range and security processing policy instructions therein.
[0028] Optionally, after verifying the gateway's permissions, the SCS retrieves the complete context data and processes it according to policy instructions, including:
[0029] The SCS verifies the gateway identity in the received request message and confirms that the gateway has the authority to request context data;
[0030] After verification, SCS retrieves the complete context data related to the session from its stored context data based on the session identifier, including the user's historical conversation records, user personal identity information, user preferences, session status and intermediate data, and real-time information related to the user retrieved from external systems;
[0031] SCS classifies and processes the retrieved context data based on policy instructions. For non-sensitive data that is allowed to be passed directly, it is retained as is. For sensitive data that needs to be protected, the original data is not returned, but one or more security references / tokens are generated and placed in the context field of the response. For data that the policy requires to be completely filtered, it is directly removed. For data that needs to be desensitized, the desensitized data is returned.
[0032] Optionally, the gateway assembles the user's current input and the security context data block obtained from the SCS into a final request according to the SCP protocol format and sends it to the AI model, including:
[0033] The gateway receives the "security context" data block returned by the SCS, which contains a reference / token and non-sensitive / masked data;
[0034] The gateway integrates the user's current input and the security context data block according to the format specified by the SCP protocol to form a complete request message. The context field of the request message structuredly contains non-sensitive data, desensitized data, and references / tokens pointing to sensitive data in the SCS.
[0035] The gateway sends the integrated request message to the AI model through a secure communication channel for processing by the AI model.
[0036] Optionally, the AI model returns a processing result, and the gateway receives the response and updates the session context as needed. The gateway interacts with the SCS again to request an updated context. After verifying the permissions, the SCS updates the stored full context, including:
[0037] After the AI model completes processing, it returns the processing results to the gateway as a response;
[0038] The gateway receives the AI model's response and determines whether the conversation context needs to be updated based on the response content, such as adding the new user input and AI response to the conversation history.
[0039] If an update is required, the gateway constructs a request message containing the update content, which includes the session identifier and the context data that needs to be updated;
[0040] The gateway sends the constructed update request message to the SCS again through the secure communication channel;
[0041] The SCS receives the update request from the gateway, verifies the gateway identity in the received request message, and confirms that the gateway has the authority to update the context data;
[0042] After the verification is successful, the SCS updates the stored complete context data related to the session identifier based on the session identifier and the context data in the update request.
[0043] In a second aspect, a security context protocol-based AI interactive data protection system is provided, comprising:
[0044] The client application is used to send user requests to the application gateway and carry the session identifier;
[0045] The gateway is used to query the policy engine for the context scope and security processing policy required for this interaction based on the request type and target AI model after receiving the request; use the session identifier to request the required context data from the security context service and pass the policy instructions; after the SCS verifies the gateway's permissions, it retrieves the complete context data and processes it according to the policy instructions; according to the SCP protocol format, it assembles the user's current input with the security context data block obtained from the SCS into a final request and sends it to the AI model; the gateway receives the response from the AI model module and updates the session context as needed, interacts with the SCS again, and requests to update the context; after verifying the permissions, the SCS updates the stored complete context; and returns the final response of the AI model to the client application, completing the entire interaction process;
[0046] The AI model module is used to receive a request, process the information received, and return the processing results.
[0047] In a third aspect, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the AI interactive data protection method described in any one of the first aspects is implemented.
[0048] In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the AI interactive data protection method described in any one of the first aspects is implemented.
[0049] In a fifth aspect, a computer program product is provided, on which a computer program is stored. When the computer program is executed by a processor, the AI interactive data protection method described in any one of the first aspects is implemented.
[0050] The beneficial effects of the technical solutions provided in the embodiments of the present application include at least:
[0051] Enhanced data security: This significantly reduces the chances of raw sensitive data being transmitted over the network and directly processed by AI models. Sensitive data is securely isolated in a trusted SCS.
[0052] Reduced leakage risk: Even if the AI model service or transmission link is compromised, the attacker can only obtain meaningless references / tokens or non-sensitive / masked data, while the original sensitive data remains safe.
[0053] Better compliance: It is easier to meet data protection regulations (such as GDPR's data minimization and purpose limitation principles) because you can control exactly what data is processed and how.
[0054] Fine-grained access control: Through the policy engine and SCS, refined access control and dynamic desensitization of contextual data based on roles and purposes can be achieved.
[0055] Flexibility and Scalability: SCS can be deployed and scaled as a standalone service, and security policies can be flexibly configured and updated without affecting the AI model itself. It can support integration with different internal or third-party AI models and apply a unified security policy.
[0056] Auditability: SCS and the policy engine provide detailed contextual access and processing logs to facilitate security auditing and tracking. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] To more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for the embodiments or the description of the prior art. Obviously, the drawings described below are merely exemplary, and those skilled in the art can derive other implementation drawings based on the provided drawings without inventive effort.
[0058] Figure 1 A flowchart of the steps of the AI interactive data protection method provided in an embodiment of the present application;
[0059] Figure 2 A schematic diagram of the interaction process provided in an embodiment of the present application;
[0060] Figure 3 An architecture diagram of an AI interactive data protection system based on a security context protocol provided in an embodiment of the present application;
[0061] Figure 4 This is an example diagram of the context data structure in the SCP protocol provided in an embodiment of the present application;
[0062] Figure 5 A schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0063] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0064] In the description of the present invention, the terms "comprise", "have" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or apparatus comprising a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may also include other steps or units that are not explicitly listed but are inherent to these processes, methods, products or apparatuses, or steps or units that are added based on further optimization schemes conceived by the present invention.
[0065] Currently, artificial intelligence models (such as large language models (LLMs)) play an increasingly important role in various applications. In order to achieve coherent, personalized, and effective interactions, these models often need to access a large amount of contextual information, including but not limited to:
[0066] User historical conversation records, user personally identifiable information (PII), user preferences, session state and intermediate data, and real-time user-related information retrieved from external systems (databases, APIs).
[0067] Existing technologies typically package this contextual information (or a summary of it) directly in the request sent to the AI model. This approach poses significant data security risks:
[0068] Transmission risk: Although channel encryption such as TLS / SSL can be used, data may still exist in plain text when processed by endpoints (client, gateway, AI model server), increasing the risk of data leakage when intermediate nodes are attacked.
[0069] Processing risks: AI models (especially closed-source models provided by third parties) are exposed to complete contextual data when processing requests. Their internal data processing and storage policies may be uncontrolled, posing the risk of data misuse or accidental leakage.
[0070] Storage risk: If context information is improperly stored (e.g., logging, caching), it may result in sensitive data being persisted in insecure locations.
[0071] Compliance risk: Directly transmitting and processing contextual information containing PII makes it difficult to meet the requirements of data minimization, purpose limitation, and user consent required by data protection regulations such as GDPR and CCPA.
[0072] Coarse access control: It is difficult to implement fine-grained access control on context information, and the entire context block is often exposed to multiple components in the processing flow.
[0073] Therefore, there is an urgent need for a new technical solution that can minimize the exposure of sensitive contextual data within the system (especially when transmitting and submitting to AI models) while ensuring the effectiveness of AI interaction, thereby improving the data security and compliance of AI applications.
[0074] The present invention relates to the fields of artificial intelligence (AI), data security, and computer network communications, and in particular to a system, method, and communication protocol for securely managing and transmitting contextual information and preventing sensitive data leakage during the interaction process of AI systems (especially conversational AI and large-scale language model applications).
[0075] This invention aims to address the security risks associated with the transmission and processing of AI interaction context data in existing technologies, providing a system and method that effectively protects sensitive information, reduces the risk of data leakage, and meets compliance requirements. To address these issues, the present invention proposes a system and method for protecting AI interaction data based on the Secure Context Protocol (SCP). SCP here refers to the security-enhancing MCP concept. Its core concept is to introduce a trusted, independent Secure Context Service (SCS) and define a new context protocol (SCP). This protocol uses secure references / tokens to replace the original sensitive data fragments when transmitting context. The SCS is responsible for the secure storage, retrieval, on-demand desensitization / filtering, and access control of sensitive data.
[0076] Please refer to Figure 1 , which shows a flowchart of an AI interactive data protection method based on a security context protocol provided by an embodiment of the present application. The method may include the following steps:
[0077] Step 1: The client application sends a user request to the application gateway, carrying a session identifier.
[0078] The client application receives user input, such as text, voice, or other forms of interaction requests. The client application encapsulates the user input into a request message and appends a session identifier (Session ID), which uniquely identifies the current interaction session. The request message is sent to the application gateway over the network, typically using HTTPS or other secure communication protocols to ensure data confidentiality and integrity during transmission. For example, the client application can be a mobile application, a web application, or an interactive interface on a smart device.
[0079] Step 2: After receiving the request, the gateway queries the policy engine for the context scope and security processing policy required for this interaction based on the request type and target AI model.
[0080] The application gateway receives requests from client applications and parses the user input and session identifier in the request. Based on the request type (e.g., query, command, conversation) and the target AI model (e.g., a specific conversational AI model or a large language model), the gateway determines the scope of contextual information to be queried. The gateway constructs a query request containing the session identifier, request type, and target AI model identifier and sends it to the policy engine. Based on pre-set policy rules, the policy engine returns the scope of contextual data and security processing policy required for this interaction, such as which data requires desensitization and which data requires reference / token generation.
[0081] Step 3: The gateway uses the session identifier to request the required context data from the security context service and passes the policy instructions.
[0082] Based on the context data scope and security processing policy returned by the policy engine, the application gateway constructs a request message containing the session identifier and policy directives. The gateway sends this request message to the Security Context Service (SCS), requesting the context data associated with the session identifier. This request message is sent over a secure communication channel to ensure data security. Upon receiving the request message, the SCS parses it and extracts the session identifier and policy directives.
[0083] Step 4: After verifying the gateway's permissions, the SCS retrieves the complete context data and processes it according to the policy instructions.
[0084] The Security Context Service (SCS) verifies the gateway identity in the received request to confirm that the gateway has permission to request context data. Once verified, the SCS retrieves the complete context data related to the session from its stored context data based on the session identifier. This includes the user's historical conversation history, the user's personally identifiable information (PII), user preferences, session state and intermediate data, and real-time user-related information retrieved from external systems. The SCS classifies the retrieved context data based on policy instructions: non-sensitive data that is allowed to be passed directly is retained as is; sensitive data that requires protection, such as PII and sensitive conversations, is not returned with the original data, but one or more security references / tokens are generated and placed in the context field of the response; data that the policy requires to be completely filtered is directly removed; and data that requires desensitization, such as partially masked phone numbers, is returned with the desensitized data. The processed "Security Context" data block is returned to the gateway.
[0085] Step 5: The gateway assembles the user's current input and the security context data block obtained from the SCS into a final request based on the SCP protocol format and sends it to the AI model.
[0086] The application gateway receives the "Security Context" data block returned by the SCS, which contains references / tokens and non-sensitive / masked data. The gateway integrates the user's current input with the "Security Context" data block according to the format specified by the SCP protocol to form a complete request message. The context field of this request message structuredly contains non-sensitive data, masked data, and references / tokens pointing to sensitive data in the SCS. The gateway sends this integrated request message to the AI model via a secure communication channel for processing. For example, the request message can use protocol formats such as JSON-RPC 2.0, gRPC, or HTTP RESTful API.
[0087] Step 6: After receiving the request, the AI model processes it based on the information received.
[0088] The AI model receives the request message from the gateway and parses the user input and the "security context" data block. The AI model processes the parsed information and generates a corresponding response. Because the context data in the request only contains non-sensitive data, desensitized data, and references / tokens that cannot be directly parsed, the AI model cannot access the original sensitive information, thus ensuring data security. The AI model's processing can include natural language understanding, dialogue management, knowledge retrieval, and other processes, depending on the AI model's design and functionality.
[0089] Step 7: The AI model returns the processing result, the gateway receives the response and updates the context of the session as needed; the gateway interacts with the SCS again to request an updated context; after verifying the permissions, the SCS updates the stored full context.
[0090] After the AI model completes processing, it returns the processing result to the gateway as a response. The gateway receives the response from the AI model and determines whether the context of the session needs to be updated based on the response content, such as adding new user input and AI replies to the conversation history. If an update is required, the gateway constructs a request message containing the update content. The request message contains the session identifier and the context data that needs to be updated. The gateway sends the constructed update request message to the SCS again through the secure communication channel. The SCS receives the gateway's update request, verifies the gateway identity in the received request, and confirms that the gateway has the authority to update the context data. After the verification is successful, the SCS updates the stored complete context data related to the session identifier based on the session identifier and the context data in the update request.
[0091] Step 8: The gateway returns the final response of the AI model to the client application, completing the entire interaction process.
[0092] The application gateway encapsulates the processing results returned by the AI model into a response message and sends it back to the client application over the network. The client application receives the response message and displays it to the user, completing the entire interaction process. The response message typically uses the same protocol format as the request, such as JSON or XML, to ensure that the client application can correctly parse and process the response content.
[0093] In summary, if Figure 2 The following is a schematic diagram of the interaction process provided by the embodiment of the present application (taking one interaction as an example):
[0094] 1. Request initiation: The client application sends a user request (for example, new user input) to the application gateway, along with a session identifier (SessionID).
[0095] 2. Context requirements analysis: The gateway receives the request and, based on the request type and target AI model, queries the policy engine for the context scope required for this interaction and the corresponding security processing strategy (for example, requiring the last five rounds of conversation history, requiring the user's nickname but masking the user's real name).
[0096] 3. Security context acquisition: The gateway uses the session ID to request the required context data from the Security Context Service (SCS) and passes the policy instructions obtained from the policy engine.
[0097] 4. SCS processing and response:
[0098] The SCS verifies the gateway's permissions and retrieves the complete context data based on the session ID.
[0099] Process the context data according to the policy instructions:
[0100] For non-sensitive data that is allowed to be passed directly, leave it as is.
[0101] For sensitive data that needs to be protected (such as PII, sensitive conversations), SCS does not return the original data. Instead, it generates one or more security references / tokens and places these references / tokens in the context field of the response.
[0102] For data that the policy requires to be completely filtered, remove it directly.
[0103] For data that needs to be desensitized (such as blocking part of the number), the desensitized data is returned.
[0104] The SCS returns the processed "security context" data block containing the reference / token and non-sensitive / masked data to the gateway.
[0105] Constructing AI request: The gateway assembles the user's current input and the "security context" data block obtained from the SCS (the sensitive part has been replaced by a reference / token) into the final request according to the SCP protocol format and sends it to the AI model.
[0106] 5. SCP protocol features: Its context field structured contains non-sensitive data, desensitized data, and references / tokens pointing to sensitive data in the SCS.
[0107] 6. AI Model Processing: The AI model receives the request. Because the context in the request only contains non-sensitive data, masked data, and references / tokens that cannot be directly parsed, the AI model itself cannot access the original sensitive information. It processes the information it receives.
[0108] 7. Response and Context Update: The AI model returns a response. After receiving the response, the gateway may need to update the conversation context (for example, adding the new user input and AI response to the conversation history). The gateway interacts with the SCS again to request a context update. After verifying permissions, the SCS securely updates the stored full context.
[0109] 8. Return to the client: The gateway returns the final response of the AI to the client application.
[0110] Please refer to Figure 3 , which shows the architecture diagram of the AI interactive data protection system provided by the embodiment of the present application. The system may include:
[0111] The system mainly includes the following components:
[0112] Client Application: The front-end interface through which users interact with the AI system.
[0113] Application Gateway / Orchestrator: Receives client requests, interacts with the security context service and AI model, and assembles and parses messages according to the SCP protocol.
[0114] like Figure 4 The following diagram shows an example of the context data structure in the SCP protocol, specifically the Secure Context Service (SCS):
[0115] Core trusted component: Responsible for securely storing, managing, and retrieving the user's complete contextual data (conversation history, user profile, session state, etc.).
[0116] Data storage: Use encryption to store contextual data and implement strict access control.
[0117] Reference / Token Generation and Parsing: Generates unique, secure reference identifiers or temporary tokens for contextually sensitive data fragments (e.g., PII, specific historical records). Under authorized conditions, the reference / token can be parsed back to the original data (or a desensitized / filtered version thereof).
[0118] Policy execution: Based on the instructions of the policy engine, the contextual data to be provided is filtered, anonymized, or only the necessary non-sensitive parts are provided.
[0119] Lifecycle management: Manage the storage period and secure deletion of contextual data.
[0120] Policy Engine:
[0121] Define data access and processing policies (for example, which roles / services can access which types of contextual data, what kind of anonymization is required during access, and which data is prohibited from being sent to specific AI models).
[0122] Provide decision support to the Gateway / Orchestrator and SCS.
[0123] AI Model: Performs core AI reasoning tasks. This can be an internally deployed model or a third-party model.
[0124] Specifically, the system may include:
[0125] The client application is used to send user requests to the application gateway and carry the session identifier;
[0126] The gateway is used to query the policy engine for the context scope and security processing policy required for this interaction based on the request type and target AI model after receiving the request; use the session identifier to request the required context data from the security context service and pass the policy instructions; after the SCS verifies the gateway's permissions, it retrieves the complete context data and processes it according to the policy instructions; according to the SCP protocol format, it assembles the user's current input with the security context data block obtained from the SCS into a final request and sends it to the AI model; the gateway receives the response from the AI model module and updates the session context as needed, interacts with the SCS again, and requests to update the context; after verifying the permissions, the SCS updates the stored complete context; and returns the final response of the AI model to the client application, completing the entire interaction process;
[0127] The AI model module is used to receive a request, process the information received, and return the processing results.
[0128] Reference / Token Mechanism: You can use UUIDs, cryptographic hashes, or time-sensitive tokens based on JWTs as secure references. SCS internally maintains a mapping between references / tokens and actual data. For example, JWT tokens contain metadata (validity period, access scope, digital signature).
[0129] SCS implementation: Can be based on a secure database (such as a NoSQL or relational database with encrypted storage) and cache. Requires a strong authentication and authorization mechanism (such as OAuth2, mTLS).
[0130] Policy engine implementation: You can use OPA (Open Policy Agent) or a custom rule engine.
[0131] Protocol carrier: The context structure defined by SCP can be carried on multiple protocols, such as JSON-RPC 2.0, gRPC (using Protobuf to define the message structure), HTTP RESTful API, etc. The core lies in the way its data content is constructed (using references / tokens).
[0132] Performance considerations: The performance of SCS is crucial. The efficiency of data retrieval, token generation / parsing, and policy execution needs to be optimized. Caching mechanisms can be used to reduce latency.
[0133] Context Compression / Summary: This solution can be combined with context compression or summarization techniques. When returning the "security context," the SCS can first compress / summarize the non-sensitive portion or history, then perform reference / token replacement. The gateway then places the result portion (or a subset of it) into the context field of the SCP request sent to the AI model.
[0134] In one embodiment, an electronic device is provided. The electronic device may be a computer, and its internal structure diagram may be as follows: Figure 5 As shown. The electronic device includes a processor, a memory and a network interface connected via a system bus. The processor of the device is used to provide computing and control capabilities. The memory of the device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to protect data based on AI interactive data of a security context protocol. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, it implements an AI interactive data protection method based on a security context protocol.
[0135] Those skilled in the art will understand that Figure 5The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0136] In one embodiment of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned AI interactive data protection method based on the security context protocol are implemented.
[0137] In one embodiment of the present application, a computer program product is provided, including a computer program / instructions, which, when executed by a processor, implements the steps of the above-mentioned AI interactive data protection method based on the security context protocol.
[0138] The computer-readable storage medium and computer program product provided in this embodiment have similar implementation principles and technical effects to those of the above-mentioned method embodiments, and are not described in detail here.
[0139] Those skilled in the art will understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in M forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (SyMchliMk), DRAM (SLDRAM), memory bus (RaMbus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0140] The technical features of the above-mentioned embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above-mentioned embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0141] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the patent application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present patent application shall be determined by the appended claims.
Claims
1. A method for protecting AI interactive data based on a security context protocol, characterized in that: The method comprises: The client application sends a user request to the application gateway, carrying a session identifier; After receiving the request, the gateway queries the policy engine for the context scope and security processing policy required for this interaction based on the request type and target AI model; The gateway uses the session identifier to request the required context data from the security context service SCS and pass the policy instructions; After verifying the gateway's permissions, the SCS retrieves the complete context data and processes it according to the policy instructions; The gateway assembles the user's current input and the security context data block obtained from the SCS into a final request based on the SCP protocol format and sends it to the AI model; After receiving the request, the AI model processes it based on the information received; The AI model returns the processing result, the gateway receives the response and updates the session context as needed; the gateway interacts with the SCS again to request an updated context; the SCS verifies the permission and updates the stored full context; The gateway returns the final response of the AI model to the client application, completing the entire interaction process.
2. The AI interactive data protection method according to claim 1, characterized in that: After receiving the request, the gateway queries the policy engine for the context scope and security processing policy required for this interaction, including: The gateway parses the user request, extracting the request type, target AI model information, and session identifier; The gateway constructs a query request based on the extracted information. The query request includes the session identifier, request type, and target AI model identifier. The gateway sends a query request to the policy engine, requesting the context data scope and security processing policy related to this interaction; Based on the query request, the policy engine returns the scope of contextual data required for this interaction, including but not limited to user historical conversation records, user personal identity information, user preferences, session status and intermediate data, as well as real-time user-related information retrieved from external systems, and corresponding security processing policies.
3. The AI interactive data protection method according to claim 1, characterized in that: The gateway uses the session identifier to request the required context data from the security context service SCS and passes policy instructions, including: The gateway constructs a request message based on the context data scope and security processing policy returned by the policy engine. The request message includes a session identifier, the required context data scope, and security processing policy instructions. The gateway sends the constructed request message to the SCS via a secure communication channel to request context data associated with the session identifier; The SCS receives the request message sent by the gateway and parses the session identifier, context data range and security processing policy instructions therein.
4. The AI interactive data protection method according to claim 1, characterized in that: After verifying the gateway's permissions, the SCS retrieves the complete contextual data and processes it according to the policy instructions, including: The SCS verifies the gateway identity in the received request message and confirms that the gateway has the authority to request context data; After verification, SCS retrieves the complete context data related to the session from its stored context data based on the session identifier, including the user's historical conversation records, user personal identity information, user preferences, session status and intermediate data, and real-time information related to the user retrieved from external systems; SCS classifies and processes the retrieved context data based on policy instructions. For non-sensitive data that is allowed to be passed directly, it is retained as is. For sensitive data that needs to be protected, the original data is not returned, but one or more security references / tokens are generated and placed in the context field of the response. For data that the policy requires to be completely filtered, it is directly removed. For data that needs to be desensitized, the desensitized data is returned.
5. The AI interactive data protection method according to claim 1, characterized in that: The gateway assembles the user's current input and the security context data block obtained from the SCS into a final request based on the SCP protocol format and sends it to the AI model, including: The gateway receives the "security context" data block returned by the SCS, which contains the reference / token and non-sensitive / masked data; The gateway integrates the user's current input and the security context data block according to the format specified by the SCP protocol to form a complete request message. The context field of the request message structuredly contains non-sensitive data, desensitized data, and references / tokens pointing to sensitive data in the SCS. The gateway sends the integrated request message to the AI model through a secure communication channel for processing by the AI model.
6. The AI interactive data protection method according to claim 1, characterized in that: The AI model returns the processing results, and the gateway receives the response and updates the session context as needed; The gateway interacts with the SCS again to request context update; After verifying permissions, the SCS updates the full context of the storage, including: After the AI model completes processing, it returns the processing results to the gateway as a response; The gateway receives the AI model's response and, based on the response content, determines whether the conversation context needs to be updated. It then adds the new user input and AI response to the conversation history. If an update is required, the gateway constructs a request message containing the update content, which includes the session identifier and the context data that needs to be updated; The gateway sends the constructed update request message to the SCS again through the secure communication channel; The SCS receives the update request from the gateway, verifies the gateway identity in the received request message, and confirms that the gateway has the authority to update the context data; After the verification is successful, the SCS updates the stored complete context data related to the session identifier based on the session identifier and the context data in the update request.
7. An AI interactive data protection system based on a security context protocol, characterized in that: The system comprises: The client application is used to send user requests to the application gateway and carry the session identifier; The gateway is used to query the policy engine for the context scope and security processing policy required for this interaction based on the request type and target AI model after receiving the request; use the session identifier to request the required context data from the security context service SCS and pass the policy instructions; after the SCS verifies the gateway's permissions, it retrieves the complete context data and processes it according to the policy instructions; according to the SCP protocol format, it assembles the user's current input with the security context data block obtained from the SCS into a final request and sends it to the AI model; the gateway receives the response from the AI model module and updates the session context as needed, interacts with the SCS again, and requests to update the context; after verifying the permissions, the SCS updates the stored complete context; and returns the final response of the AI model to the client application, completing the entire interaction process; The AI model module is used to receive a request, process the information received, and return the processing results.
8. An electronic device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the method for protecting AI interactive data according to any one of claims 1 to 6 is implemented.
9. A computer-readable storage medium, characterized in that A computer program is stored thereon, and when the computer program is executed by a processor, the AI interactive data protection method as described in any one of claims 1 to 6 is implemented.
10. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instruction is executed by a processor, the AI interactive data protection method described in any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Data management method and system, data service gateway and storage medium
CN115934202A
Session interaction method and device, electronic equipment and storage medium
CN118413505A
Cited By
AI content security and compliance control system
CN121880536A