Animated data flow diagram

AI Agent for Automated CSV PII Sanitization in Google Drive

Version: 1.0.0 | Last Updated: 2025-05-16

Integrates with:

OpenAI Google Drive
Core AI Power
5/10
Automation Level
8/10
Integration Reach
2 systems
Setup Simplicity
6/10
Adaptability
7/10

Overview

Unlock Automated Data Privacy with this AI Agent

This n8n workflow acts as an intelligent AI Agent dedicated to safeguarding your data. It continuously monitors a specified Google Drive folder for new CSV files. When a file appears, the agent downloads it, employs OpenAI's GPT-4o-mini model for its PII detection ability to identify columns containing Personally Identifiable Information, and then meticulously removes these columns. The sanitized, privacy-enhanced CSV is then uploaded to a designated 'processed' folder in your Google Drive, streamlining your data compliance efforts.

Key Features & Benefits

  • AI-Powered PII Detection: Utilizes OpenAI (GPT-4o-mini) for its advanced ability to accurately identify PII columns (e.g., names, emails, phone numbers) within your CSV data.
  • Automated Data Sanitization: Offers the ability to automatically remove identified PII columns, creating a clean and compliant version of your dataset without manual intervention.
  • Seamless Google Drive Workflow: Fully automates the process from watching a Drive folder for new CSVs to uploading the sanitized versions to another.
  • Continuous Vigilance: Can be set to poll frequently (e.g., every minute), ensuring near real-time processing of incoming files.
  • Adaptable AI Core: The OpenAI prompt defining PII can be customized, allowing you to tailor the agent's detection ability to specific data types or internal PII definitions.
  • Boost Compliance Efforts: Directly supports adherence to data privacy regulations like GDPR, CCPA, and HIPAA by effectively scrubbing sensitive information.
  • Significant Time & Resource Savings: Eliminates the tedious and error-prone task of manual PII scrubbing, freeing up your team for higher-value activities.

Use Cases

  • For B2C e-commerce: Anonymize customer datasets from CSV exports before analysis, ensuring marketing analytics don't expose PII.
  • For B2B SaaS: Sanitize user activity logs or feedback CSVs shared between departments, protecting user privacy during internal reviews.
  • Automating the preparation of datasets for machine learning by removing identifiers that could bias models or violate privacy.
  • Streamlining data sharing with third-party analytics partners by pre-processing CSVs to remove PII and ensure compliance.

Prerequisites

  • An n8n instance (Cloud or self-hosted).
  • OpenAI API Key with access to a suitable model (e.g., gpt-4o-mini or gpt-4).
  • Google Drive OAuth2 credentials configured in your n8n instance.
  • Two Google Drive folder IDs: one for input (where new CSVs are placed) and one for output (where sanitized files will be saved).

Setup Instructions

  1. Download the n8n workflow JSON file.
  2. Import the workflow into your n8n instance.
  3. Configure Google Drive Trigger: Select your Google Drive OAuth2 credentials. In the 'Folder To Watch' parameter, provide the ID of the Google Drive folder this agent should monitor for new CSV files.
  4. Verify Google Drive Download Node: Ensure the 'Google Drive' node (for downloading files) is configured with the same Google Drive credentials.
  5. Configure OpenAI Node: Enter your OpenAI API Key. Confirm that 'gpt-4o-mini' (or your preferred model) is selected. You can inspect and customize the system_prompt here if you need to adjust the PII detection criteria.
  6. Configure Upload to Drive Node: Select your Google Drive credentials. In the 'Folder Id' parameter, provide the ID of the Google Drive folder where the sanitized CSV files should be uploaded.
  7. Review Code Node (Optional): The 'Remove PII columns' node contains JavaScript to process the CSV. Default settings handle standard CSVs. If you have uniquely formatted CSVs or specific logic requirements, you may need to adjust this code.
  8. Activate the workflow. Test by uploading a sample CSV file with PII into the monitored Google Drive folder.

Tags:

AI AgentData SanitizationPII RemovalOpenAIGoogle DriveAutomationComplianceData PrivacyCSV Processing

Want your own unique AI agent?

Talk to us - we know how to build custom AI agents for your specific needs.

Request a Consultation