Updated on December 2, 2024

Identify and mask (Auto-detect)

This method automatically identifies and masks personal/sensitive data within specific sentences.

Endpoint and Authentication: #

To use Protecto.ai’s token-based masking, you need to send a PUT request to the following endpoint:

METHOD: PUT

Endpoint: https://trial.protecto.ai/api/vault/mask

For authentication, include the following token in the request headers:

Headers: {“Authorization”: “Bearer <AUTH_TOKEN>”}

Request Payload: #

Here’s an example of a request payload to mask sensitive data:

Request Payload:
{
"mask":[{"value": " Sarah Connors, a 34-year-old Caucasian woman residing at 12 Elm Street, Springfield, IL 62704, recently enrolled in TrendyShop’s premium membership program. During her visit to the Springfield location, her vehicle with registration number IL-4598-RM was logged into the parking system. Sarah, who holds a driving license numbered DL-IL-1987-20976, also registered her credit card (4532 7896 4512 3456) to enjoy 10% cashback on purchases. Additionally, her phone number (217-555-2020) and email address (sarah.connors88@example.com) "}]}
Parameters for the Request Payload:
· value (string): Sensitive data value that needs to be masked.
Response :
Upon successful masking, you will receive a response with the masked data. Here’s an example of a response:
{
    "data": [
        {
            "value": " Sarah Connors, a 34-year-old Caucasian woman residing at 12 Elm Street, Springfield, IL 62704, recently enrolled in TrendyShop’s premium membership program. During her visit to the Springfield location, her vehicle with registration number IL-4598-RM was logged into the parking system. Sarah, who holds a driving license numbered DL-IL-1987-20976, also registered her credit card (4532 7896 4512 3456) to enjoy 10% cashback on purchases. Additionally, her phone number (217-555-2020) and email address (sarah.connors88@example.com) ",
            "token_value": " <PER>cn1AU jZl3LKd</PER>, a 34-year-old Caucasian woman residing at <ADDRESS>vgeHx WZIN6 O3J53h, 9bB6SiZ8Wc, 7QZ3w nui0T</ADDRESS>, recently enrolled in <ORG>jBC1Djo4FL</ORG>’s premium membership program. During her visit to the <ADDRESS>9bB6SiZ8Wc</ADDRESS> location, her vehicle with registration number <VEHICLE_REG_NO>IL-0BGTpdTpc5-0Bc075EW7f</VEHICLE_REG_NO> was logged into the parking system. <PER>cn1AU</PER>, who holds a driving license numbered <DL_NO>0SJC8AxU6g-IL-0DnFv5CaFl-0RtsISJwCG</DL_NO>, also registered her credit card (<CRD>8166797814</CRD>) to enjoy 10% cashback on purchases. Additionally, her phone number <PHN>(88298-14720-80424</PHN>) and email address (<EMAIL>0VtjFhLugg@0WVgjeNL1w</EMAIL>) ",
            "toxicity_analysis": {
                "toxicity": 0.0006228197016753256,
                "severe_toxicity": 0.00012021268048556522,
                "obscene": 0.0001829451648518443,
                "threat": 0.00011827900016214699,
                "insult": 0.00018096320854965597,
                "identity_attack": 0.00014517351519316435
            },
            "individual_tokens": [
                {
                    "value": "Sarah Connors",
                    "pii_type": "PERSON",
                    "token": "cn1AU jZl3LKd",
                    "prefix": "<PER>",
                    "suffix": "</PER>",
                    "start_pos": 1,
                    "end_pos": 14
                },
                {
                    "value": "12 Elm Street, Springfield, IL 62704",
                    "pii_type": "ADDRESS",
                    "token": "vgeHx WZIN6 O3J53h, 9bB6SiZ8Wc, 7QZ3w nui0T",
                    "prefix": "<ADDRESS>",
                    "suffix": "</ADDRESS>",
                    "start_pos": 58,
                    "end_pos": 94
                },
                {
                    "value": "TrendyShop",
                    "pii_type": "ORG",
                    "token": "jBC1Djo4FL",
                    "prefix": "<ORG>",
                    "suffix": "</ORG>",
                    "start_pos": 117,
                    "end_pos": 127
                },
                {
                    "value": "Springfield",
                    "pii_type": "ADDRESS",
                    "token": "9bB6SiZ8Wc",
                    "prefix": "<ADDRESS>",
                    "suffix": "</ADDRESS>",
                    "start_pos": 182,
                    "end_pos": 193
                },
                {
                    "value": "IL-4598-RM",
                    "pii_type": "VEHICLE_REGISTRATION_NUMBER",
                    "token": "IL-0BGTpdTpc5-0Bc075EW7f",
                    "prefix": "<VEHICLE_REG_NO>",
                    "suffix": "</VEHICLE_REG_NO>",
                    "start_pos": 241,
                    "end_pos": 251
                },
                {
                    "value": "Sarah",
                    "pii_type": "PERSON",
                    "token": "cn1AU",
                    "prefix": "<PER>",
                    "suffix": "</PER>",
                    "start_pos": 288,
                    "end_pos": 293
                },
                {
                    "value": "DL-IL-1987-20976",
                    "pii_type": "DRIVING_LICENSE_NUMBER",
                    "token": "0SJC8AxU6g-IL-0DnFv5CaFl-0RtsISJwCG",
                    "prefix": "<DL_NO>",
                    "suffix": "</DL_NO>",
                    "start_pos": 332,
                    "end_pos": 348
                },
                {
                    "value": "4532 7896 4512 3456",
                    "pii_type": "CREDIT_CARD",
                    "token": "8166797814",
                    "prefix": "<CRD>",
                    "suffix": "</CRD>",
                    "start_pos": 383,
                    "end_pos": 402
                },
                {
                    "value": "(217-555-2020",
                    "pii_type": "PHONE_NUMBER",
                    "token": "(88298-14720-80424",
                    "prefix": "<PHN>",
                    "suffix": "</PHN>",
                    "start_pos": 471,
                    "end_pos": 484
                },
                {
                    "value": "sarah.connors88@example.com",
                    "pii_type": "EMAIL_ADDRESS",
                    "token": "0VtjFhLugg@0WVgjeNL1w",
                    "prefix": "<EMAIL>",
                    "suffix": "</EMAIL>",
                    "start_pos": 505,
                    "end_pos": 532
                }
            ]
        }
    ],
    "success": true,
    "error": {
        "message": ""
    }
}
We identify toxic content while masking. Click on ‘Identify Toxic Content‘ to learn more.
 Response Parameters:
  • data: An array containing the unmasked text along with additional analyses and individual tokens.
    • value: The original masked text.
    • token_value: The unmasked text with sensitive information replaced by tokenized values.
    • toxicity_analysis: Analysis of the toxicity levels in the unmasked text.
      • toxicity: Overall toxicity score.
      • severe_toxicity: Score indicating severe toxicity.
      • obscene: Score indicating obscenity.
      • threat: Score indicating threats.
      • insult: Score indicating insults.
      • identity_attack: Score indicating identity attacks.
    • individual_tokens: An array containing individual tokens extracted from the unmasked text, along with their types and positions.
      • value: The value of the token.
      • pii_type: The type of personally identifiable information (PII) detected (e.g., PERSON, GPE).
      • token: The tokenized representation of the value.
      • prefix: Prefix indicating the start of the token.
      • suffix: Suffix indicating the end of the token.
      • start_pos: Starting position of the token in the original text.
      • end_pos: Ending position of the token in the original text.
  • success: Boolean indicating the success of the request.
  • error: Object containing details of any errors encountered during the request.
    • message: Error message, if any.
Advantage :
This approach is particularly useful when users may not be aware of all the sensitive data present in a given text or when dealing with large volumes of data where manual identification is impractical. Auto-detect masking offers the following advantages:
  1. Effortless Sensitive Data Identification: Users do not need to manually identify and specify sensitive data elements within the text. The system automatically detects patterns and formats indicative of sensitive information, such as names, phone numbers, credit card numbers, etc
  2. Comprehensive Data Protection: Auto-detect masking ensures that all instances of sensitive data within a dataset are masked, providing a comprehensive approach to data security. This is especially valuable for scenarios where users may not be aware of all the potential data types that need protection
  3. Reduced Human Error: Automated detection reduces the risk of human errors that can occur during manual identification and specification of sensitive data. It enhances accuracy and consistency in data protection processes.
  4. Time and Resource Savings: Auto-detect masking saves time and effort, particularly when dealing with large amounts of data. Users do not need to spend time identifying each instance of sensitive data, allowing them to focus on other tasks.

What are your feelings

© All Rights Reserved 2023 | Protecto

Scroll to Top