Artificial intelligence message sanitization
Methods, systems, and apparatus, including computer programs encoded on computer storage media, for sanitizing artificial intelligence prompts. One of the methods includes receiving a message a) for an external system and b) that comprises two or more phrases; for at least one phrase from the two or more phrases: determining a context of the phrase in the message; determining, using the context, whether modification of the phrase will likely maintain an intent of the message; determining whether to permit unedited transmission of the message to the external system using a result of at least one of one or more determinations whether modification of the phrase will likely maintain the intent of the message; and performing one or more actions using a result of the determination whether to permit unedited transmission of the message to the external system.
1 . One or more non-transitory computer storage media encoded with instructions that, when executed by one or more computers, cause the one or more computers to perform operations comprising:
receiving a message for an external system;
determining, by a sensitive data detection engine, a prompt context of the message using data from one or more other messages transmitted as part of the same group of messages as the message;
determining, by a sensitive data detection engine and using the prompt context of the message, whether the message likely includes sensitive data;
determining, by the sensitive data detection engine, whether to permit unedited transmission of the message to the external system using a result of the determination whether the message likely includes the sensitive data using the prompt context of the message; and
performing one or more actions using a result of the determination whether to permit unedited transmission of the message to the external system.
2 . The computer storage media of claim 1 , wherein:
determining whether to permit unedited transmission of the message to the external system comprises determining whether to generate a second message for the external system using a result of the determination whether to permit unedited transmission of the message to the external system; and
performing one or more actions uses a result of the determination whether to generate the second message for the external system.
3 . The computer storage media of claim 2 , wherein performing the one or more actions comprises:
generating a second message for the external system using the result of the determination whether to generate a second message for the external system;
providing, to the external system, the second message;
receiving, from the external system, a response;
determining whether to update the response using the result of the determination whether to permit unedited transmission of the message to the external system; and
providing instructions that cause presentation of data for the response using a second result of the determination whether to update the response.
4 . The computer storage media of claim 2 , wherein determining whether to generate a second message for the external system comprises:
determining whether the message can likely be sanitized;
selecting, from a group comprising a local generative artificial intelligence system and at least one external generative artificial intelligence system, a generative artificial intelligence system,
the local generative artificial intelligence system not being provided sanitized messages; and
in response to selecting the generative artificial intelligence system, providing the second message to the generative artificial intelligence system.
5 . The computer storage media of claim 2 , the operations comprising:
determining, for a phrase from two or more phrases include in and using a phrase context that indicates a context of the phrase in the message, that modification of the phrase will likely maintain an intent of the message;
generating the second message by replacing one or more instances of the phrase with a replacement phrase;
updating a response received from the external system by replacing instances of the replacement phrase with the phrase; and
providing instructions that cause presentation of the response that includes the phrase instead of the replacement phrase.
6 . The computer storage media of claim 3 , wherein generating the second message for the external system using the result of the determination whether to permit unedited transmission of the message to the external system comprises:
in response to determining that modification of a phrase from the message will likely maintain an intent of the message, providing, to a sanitization model, the phrase as input;
in response to providing the phrase as input, receiving, from the sanitization model, a replacement phrase for the phrase that does not include sensitive data; and
generating, using a context, the second message that replaces at least some instances of the phrase with the replacement phrase.
7 . The computer storage media of claim 6 , wherein providing the phrase as input comprises providing, as input to the sanitization model, the phrase, a sensitivity score for the phrase, and an importance score for the phrase.
8 . The computer storage media of claim 1 , the operations comprising:
determining a phrase context of a phrase in the message; and
determining, by the sensitive data detection engine and using the phrase context of the phrase in the message, a meaning of the phrase, wherein:
determining whether to permit unedited transmission of the message to the external system uses the result of the determination whether the message likely includes the sensitive data using the prompt context of the message and the meaning of the phrase in the message.
9 . The computer storage media of claim 1 , wherein determining whether to permit unedited transmission of the message to the external system comprises:
determining, using a classification model that receives the message as input, a classification of a phrase from two or more phrases included in the message;
determining, using a model that receives the message as input, whether the phrase satisfies one or more sensitivity criteria for the classification; and
determining whether to permit unedited transmission of the message to the external system using the prompt context and a third result of the determination whether the phrase satisfies one or more sensitivity criteria for the classification.
10 . The computer storage media of claim 9 , wherein determining whether the phrase satisfies the one or more sensitivity criteria comprises determining whether the phrase satisfies one or more of a first sensitive content criterion for the classification or a second sensitive intent criterion for the classification.
11 . The computer storage media of claim 9 , the operations comprising, for the phrase from the two or more phrases:
determining, using a phrase context for the phrase in the message, an importance of the phrase in the message, wherein:
determining whether to permit unedited transmission of the message to the external system uses the prompt context, the importance of the phrase in the message and the third result of the determination whether the phrase satisfies one or more sensitivity criteria for the classification.
12 . The computer storage media of claim 11 , comprising:
for each of one or more phrases included in the two or more phrases from the message:
determining, using the phrase context, an importance score that represents the importance of the corresponding phrase in the message; and
determining, using the model, a sensitivity score that indicates whether the corresponding phrase satisfies one or more sensitivity criteria for the classification, the importance score being a different score than the sensitivity score, wherein:
determining whether to permit unedited transmission of the message to the external system uses, for each of the one or more phrases, a combination of the importance score and the sensitivity score.
13 . The computer storage media of claim 8 , the operations comprising, for the phrase from the message:
determining, using the phrase context, an importance of the phrase in the message, wherein:
determining whether to permit unedited transmission of the message to the external system uses the prompt context of the message, the phrase context of the phrase, and the importance of the phrase in the message.
14 . The computer storage media of claim 1 , the operations comprising:
determining, using a classification or an intent for a phrase from the message and that that was generated using an a computer-implemented artificial intelligence model, whether the phrase should be analyzed using a sanitization process and the phrase likely includes sensitive data; and
determining a context for the phrase in the message in response to determining that the phrase should be analyzed using the sanitization process, wherein determining whether the message likely includes sensitive data uses the prompt context and the context for the phrase.
15 . The computer storage media of claim 1 , wherein performing the one or more actions comprises blocking transmission of the message to the external system.
16 . The computer storage media of claim 15 , wherein performing the one or more actions comprises blocking transmission of any data for the message to the external system.
17 . The computer storage media of claim 1 , wherein the message comprises at least one of a prompt, an email, or a text message.
18 . The media of claim 1 , wherein determining the prompt context of the message uses data from one or more of i) a same chat as the message, or ii) one or more other messages transmitted as part of the same network session as the message.
19 . The media of claim 1 , wherein the message is sensitive in a first context and is not sensitive in a second, different context.
20 . The media of claim 1 , wherein the message comprises a phrase that is sensitive in a first context and is not sensitive in a second, different context.
21 . A system comprising one or more computers and one or more storage devices on which are stored instructions that are operable, when executed by the one or more computers, to cause the one or more computers to perform operations comprising:
receiving a message for an external system;
determining, by a sensitive data detection engine, a prompt context of the message using data from one or more other messages transmitted as part of the same group of messages as the message;
determining, by a sensitive data detection engine and using the prompt context of the message, whether the message likely includes sensitive data;
determining, by the sensitive data detection engine, whether to permit unedited transmission of the message to the external system using a result of the determination whether the message likely includes the sensitive data using the prompt context of the message; and
performing one or more actions using a result of the determination whether to permit unedited transmission of the message to the external system.
22 . A computer-implemented method comprising:
receiving a message for an external system;
determining, by a sensitive data detection engine, a prompt context of the message using data from one or more other messages transmitted as part of the same group of messages as the message;
determining, by a sensitive data detection engine and using the prompt context of the message, whether the message likely includes sensitive data;
determining, by the sensitive data detection engine, whether to permit unedited transmission of the message to the external system using a result of the determination whether the message likely includes the sensitive data using the prompt context of the message; and
performing one or more actions using a result of the determination whether to permit unedited transmission of the message to the external system.
23 . The method of claim 22 , comprising:
determining a phrase context of a phrase in the message; and
determining, by the sensitive data detection engine and using the phrase context of the phrase in the message, a meaning of the phrase, wherein:
determining whether to permit unedited transmission of the message to the external system uses the result of the determination whether the message likely includes the sensitive data using the prompt context of the message and the meaning of the phrase in the message.