perfecXion.ai

Quick Start Guide

Get perfecX Comply up and running in your organization in under 10 minutes.

Prerequisites

  • Python 3.8+ or Node.js 16+
  • Administrative access to your AI/ML platforms
  • A perfecX Comply API key (sign up at perfecxion.ai)
  • Basic understanding of your compliance requirements (EU AI Act, NIST AI RMF, SOC 2, etc.)

Step 1: Install the SDK

Python

pip install perfecxion-comply

Node.js

npm install @perfecxion/comply

Step 2: Initialize perfecX Comply

Python Example

from perfecxion_comply import ComplianceClient

# Initialize the compliance client
client = ComplianceClient(
    api_key="your-api-key",
    organization_id="your-org-id"
)

# Configure compliance frameworks
client.configure_frameworks([
    "EU_AI_ACT",
    "NIST_AI_RMF",
    "SOC_2_TYPE_II",
    "ISO_42001"
])

# Set up automated scanning
scan_config = {
    "scan_interval": "daily",
    "include_models": ["production/*"],
    "risk_threshold": "medium",
    "auto_remediate": True
}

client.setup_automated_scanning(scan_config)

Node.js Example

import { ComplianceClient } from '@perfecxion/comply';

// Initialize the compliance client
const client = new ComplianceClient({
    apiKey: 'your-api-key',
    organizationId: 'your-org-id'
});

// Configure compliance frameworks
await client.configureFrameworks([
    'EU_AI_ACT',
    'NIST_AI_RMF',
    'SOC_2_TYPE_II',
    'ISO_42001'
]);

// Set up automated scanning
const scanConfig = {
    scanInterval: 'daily',
    includeModels: ['production/*'],
    riskThreshold: 'medium',
    autoRemediate: true
};

await client.setupAutomatedScanning(scanConfig);

Step 3: Register Your AI Models

# Register an AI model for compliance tracking
model = client.register_model({
    "model_id": "customer-churn-predictor",
    "name": "Customer Churn Prediction Model",
    "version": "2.1.0",
    "type": "classification",
    "purpose": "Predict customer churn probability",
    "data_categories": ["customer_behavior", "transaction_history"],
    "deployment_env": "production",
    "risk_category": "medium",
    "metadata": {
        "team": "data-science",
        "framework": "tensorflow",
        "training_date": "2024-01-10"
    }
})

# Perform initial compliance assessment
assessment = client.assess_model(model.id)
print(f"Compliance Score: {assessment.overall_score}/100")
print(f"Violations Found: {len(assessment.violations)}")
print(f"Risk Level: {assessment.risk_level}")

Step 4: Configure Compliance Policies

# Define compliance policies
policies = client.create_policy_set({
    "name": "Production AI Governance",
    "rules": [
        {
            "type": "bias_detection",
            "threshold": 0.05,
            "protected_attributes": ["gender", "race", "age"],
            "action": "alert_and_block"
        },
        {
            "type": "data_privacy",
            "require_anonymization": True,
            "pii_categories": ["email", "phone", "ssn"],
            "retention_days": 90
        },
        {
            "type": "model_drift",
            "drift_threshold": 0.1,
            "check_frequency": "weekly",
            "auto_retrain": True
        },
        {
            "type": "documentation",
            "required_docs": ["model_card", "risk_assessment", "bias_report"],
            "update_frequency": "monthly"
        }
    ]
})

# Apply policies to models
client.apply_policies(
    policy_set_id=policies.id,
    model_filters={"deployment_env": "production"}
)

Step 5: Monitor Compliance Status

Once configured, perfecX Comply provides real-time monitoring through our dashboard:

Compliance Dashboard

Real-time compliance status across all frameworks

Risk Assessment

Automated risk scoring and mitigation recommendations

Audit Reports

Automated generation of compliance documentation

Violation Alerts

Instant notifications for compliance violations

# Generate compliance report
report = client.generate_compliance_report(
    framework="EU_AI_ACT",
    format="pdf",
    include_evidence=True
)

print(f"Report generated: {report.url}")
print(f"Compliance Status: {report.status}")
print(f"Next Audit Date: {report.next_audit_date}")

# Get real-time metrics
metrics = client.get_compliance_metrics()
print(f"Overall Compliance: {metrics.overall_score}%")
print(f"Models in Compliance: {metrics.compliant_models}/{metrics.total_models}")
print(f"Active Violations: {metrics.active_violations}")

MLOps Integration Example

Integrate perfecX Comply with your existing MLOps pipeline:

# Example: MLflow Integration
from mlflow import log_metric, log_param
from perfecxion_comply import MLflowIntegration

# Initialize MLflow integration
px_mlflow = MLflowIntegration(client)

# Automatic compliance checks during model training
with mlflow.start_run():
    # Train your model
    model = train_model(X_train, y_train)
    
    # Automatic bias detection
    bias_report = px_mlflow.check_bias(
        model=model,
        test_data=X_test,
        protected_attrs=['gender', 'race']
    )
    
    # Log compliance metrics
    log_metric("bias_score", bias_report.score)
    log_metric("fairness_score", bias_report.fairness)
    log_param("compliance_framework", "EU_AI_ACT")
    
    # Register model with compliance metadata
    px_mlflow.register_compliant_model(
        model=model,
        model_name="customer_churn_v2",
        compliance_report=bias_report
    )

Need Help?

Our compliance experts are here to help you navigate AI governance requirements.