4 min readUpdated Mar 2, 2026

aiComplianceCheck Documentation

Purpose

The aiComplianceCheck logic is designed to perform an AI-powered compliance check on a set of data rows. It evaluates each row against user-defined compliance policies, returning a verdict of either "PASS" or "FAIL" along with associated notes for each row. This functionality is particularly important for businesses that need to adhere to regulatory standards and ensure data privacy.

Settings

The aiComplianceCheck logic is configurable through several settings, each having a specific role and impact on its behavior. The following settings are available:

1. Policies

2. Prompt Template

3. Batch Size

4. Focus Column

How It Works

The aiComplianceCheck logic processes data in the following manner:

  1. Data Input: It first unwraps the incoming data and checks for its validity (ensuring it's an array).
  2. Policy Validation: If no policies are defined, all rows automatically pass.
  3. AI Integration: It retrieves a preferred AI integration configuration using the context provided, which is critical for processing compliance checks.
  4. Batch Processing: The logic splits the data into batches, ensuring that no batch exceeds 50 rows, and processes each batch through the AI to determine compliance based on the defined policies.
  5. Result Collection: After processing each batch, results are aggregated into pass and fail categories based on AI responses.
  6. Error Handling: If AI integration fails or there are errors during processing, rows are reported as failing with descriptive notes.

Data Expectations

The aiComplianceCheck logic expects the following data format:

Use Cases & Examples

Use Case 1: Data Privacy Compliance

A healthcare provider needs to ensure that no records contain personally identifiable information (PII) before sharing data sets with research institutions.

Use Case 2: Family-Safe Content

An online content platform wants to ensure that all uploaded content is appropriate for users of all ages, implementing compliance checks before content goes live.

Example Configuration for Use Case 1

To implement the first use case, where the provider must check for PII, the aiComplianceCheck could be configured as follows:

json
{
    "policies": [
        {
            "label": "No PII",
            "description": "Data must not contain exposed PII"
        }
    ],
    "promptTemplate": "Please review the following data rows for PII compliance.",
    "batchSize": 5,
    "focusColumn": "sensitive_info"
}

In this example: