As AI systems increasingly handle sensitive data, maintaining data compliance is essential to protect user privacy, prevent unauthorised data exposure, and adhere to legal regulations such as GDPR, HIPAA, and CCPA. Failure to comply with these standards can lead to data breaches, legal consequences, and erosion of user trust.

Follow this guide to ensure your AI application adheres to data compliance by using following evaluations:


1. Data Privacy Compliance

Assesses whether content aligns with key privacy regulations such as GDPR and HIPAA, ensuring adherence to data protection standards. This evaluation is crucial for identifying and mitigating risks related to sensitive data exposure and regulatory non-compliance.

Click here to read the eval definition of Data Privacy Compliance

a. Using Interface

Required Parameters

  • Input: The content to be evaluated for privacy compliance.

Output: Returns a status such as “Passed” (indicating full compliance with privacy regulations) or “Failed” (indicating privacy violations that require remediation).

a. Using Python SDK

from fi.evals import EvalClient
from fi.testcases import TestCase
from fi.evals.templates import DataPrivacyCompliance

evaluator = EvalClient(
    fi_api_key="your_api_key",
    fi_secret_key="your_secret_key",
    fi_base_url="https://api.futureagi.com"
)

test_case = TestCase(
    input=(
        "Patient John Doe (SSN: 123-45-6789) was admitted on 01/15/2024. "
        "Contact details: john.doe@email.com, (555) 123-4567. "
        "Credit card ending in 4321 was charged $500 for services."
    )
)

template = DataPrivacyCompliance(
    config={
        "check_internet": False
    }
)

response = evaluator.evaluate(eval_templates=[template], inputs=[test_case])
response.eval_results[0].metrics[0].value[0]

2. Personally Identifiable Information (PII)

Identifies specific types of personally identifiable information (PII) within text to prevent unauthorised exposure of sensitive data.

Unlike broader Data Privacy Compliance, which ensures overall adherence to privacy regulations, PII Detection focuses on detecting personal data elements such as names, addresses, phone numbers, and financial details.

Click here to read the eval definition of PII

a. Using Interface

Required Parameters

  • Input: The text content to be analysed for PII.

Output: Returns a classification of “Pass” (indicating no PII detected) or “Failed” (indicating the presence of PII, requiring redaction or further processing for compliance).

b. Using SDK

from fi.evals import EvalClient
from fi.testcases import TestCase
from fi.evals.templates import PII

evaluator = EvalClient(
    fi_api_key="your_api_key",
    fi_secret_key="your_secret_key",
    fi_base_url="https://api.futureagi.com"
)

test_case = TestCase(
    text=(
        "Patient John Doe (SSN: 123-45-6789) was admitted on 01/15/2024. "
        "Contact details: john.doe@email.com, (555) 123-4567. "
        "Credit card ending in 4321 was charged $500 for services."
    )
)

template = PII()

response = evaluator.evaluate(eval_templates=[template], inputs=[test_case])
print(response.eval_results[0].failure)
print(response.eval_results[0].reason)