Skip to Content

Document Compliance Agent (Google)

Overview

Jitterbit provides the Document Compliance Agent (Google) to customers through Jitterbit Marketplace. This agent automates compliance-focused document processing by retrieving PDF files from Google Cloud Storage, extracting their text content using optical character recognition (OCR), and applying AI-powered analysis to detect and remove personally identifiable information (PII), helping organizations meet data privacy requirements without manual document review.

The agent retrieves PDF files from a configured source bucket, authenticates with Google Cloud using a service account and a cached OAuth2 access token, and submits each file to Google Document AI for OCR extraction. An LLM then analyzes the extracted text in two passes: once to identify and store PII data, and again to produce a sanitized version with all PII removed. Both output files are written to an FTP server, the original PDF is copied to a separate Google Cloud Storage archive bucket and deleted from the source, and email notifications are sent to configured recipients when processing errors occur.

The agent performs the following tasks:

  • Authenticates with Google Cloud using a service account JWT and caches the OAuth2 access token for reuse across processing runs.
  • Retrieves a list of PDF files from a configured Google Cloud Storage source bucket.
  • Submits each PDF file to Google Document AI for OCR text extraction and collects the full extracted text.
  • Sends extracted text to an LLM to detect and extract PII data, and writes the output to a file on an FTP server.
  • Sends extracted text to the LLM to produce a cleaned version with all PII removed, and writes the output to a file on an FTP server.
  • Archives processed PDF files to a configured destination Google Cloud Storage bucket and removes the originals from the source bucket.
  • Sends email notifications to configured recipients when processing errors occur.

This document explains how to set up and operate this AI agent. It covers architecture, prerequisites, and steps to install, configure, and operate the AI agent.

AI agent architecture

This AI agent connects Google Cloud Storage, Google Document AI, an LLM, and an FTP server to extract and sanitize text from PDF documents. A typical processing run follows these steps:

  1. The GCP Controller operation checks the cache for a valid OAuth2 access token. If none exists, it triggers the Generate AccessToken operation to authenticate with Google Cloud using the configured service account credentials.
  2. The agent connects to the configured Google Cloud Storage source bucket and retrieves a list of available PDF files.
  3. For each file, the agent submits the PDF to Google Document AI for OCR text extraction and collects the full extracted text.
  4. The agent sends the extracted text to the LLM with a PII-detection prompt. The identified PII data is written as a JSON file to the FTP server.
  5. The agent sends the extracted text to the LLM with a data-cleaning prompt to produce a sanitized version. The cleaned text is written as a JSON file to the FTP server.
  6. The processed PDF is copied to the destination Google Cloud Storage archive bucket, then deleted from the source bucket.
  7. If any step in the pipeline fails, an email notification is sent to configured recipients with details of the error.

Workflow diagram

The following diagram shows the main processing pipeline for the Document Compliance Agent (Google).

--- config: flowchart: padding: 20 nodeSpacing: 80 --- flowchart LR classDef default fill:white, stroke:black, stroke-width:3px, rx:15px, ry:15px JSP@{ shape: hex, label: "
Document Compliance
Agent (Google)" } GCSSRC[fab:fa-google
Google Cloud Storage
Source Bucket] DOCAI[fab:fa-google
Google Document AI] LLM[fas:fa-brain
LLM] FTP[fas:fa-server
FTP Server] GCSARC[fab:fa-google
Google Cloud Storage
Archive Bucket] EMAIL[fas:fa-envelope
Email] JSP <-->|1. List and get PDFs| GCSSRC JSP <-->|2. OCR request / extracted text| DOCAI JSP <-->|3. PII detection prompt / PII data| LLM JSP <-->|4. Clean data prompt / cleaned text| LLM JSP -->|5. Write output files| FTP JSP -->|6. Archive and delete PDF| GCSARC JSP -->|7. Error notification| EMAIL

Prerequisites

You need the following components to use this AI agent.

Harmony components

You must have a Jitterbit Harmony license with access to the following components:

  • Jitterbit Studio
  • Document Compliance Agent (Google) purchased as a license add-on

Supported endpoints

The AI agent connects to the following endpoints. You can accommodate other systems by modifying the project's endpoint configurations and workflows.

Large language model (LLM)

The agent uses Google Vertex AI to access large language models for PII detection and data sanitization. The project is configured to use Gemini 2.5 Flash by default. You can substitute another Vertex AI-supported model by updating the GCP_Model project variable. You must have a Google Cloud project with the Vertex AI API enabled and a service account with the Vertex AI User role.

Google Cloud Storage

The agent uses Google Cloud Storage as both the PDF source and the archive destination. You must have a Google Cloud project with the Cloud Storage API enabled, two Cloud Storage buckets configured (one for incoming PDF files and one for archiving processed files), and a service account with the Storage Object Admin role on both buckets.

Google Document AI

The agent uses Google Document AI for OCR text extraction from PDF files. You must have the Cloud Document AI API enabled in your Google Cloud project, a Document AI processor created, and a service account with the Document AI API User role.

FTP

The agent writes processed output files (PII data and cleaned text) to an FTP server. You must have an FTP server accessible from Jitterbit with valid connection credentials.

Email

The agent sends error notifications via SMTP email. The default configuration uses Gmail (smtp.gmail.com). You must have a sender email account with SMTP access enabled and, if using Gmail, an app password configured.

Installation, configuration, and operation

Follow these steps to install, configure, and operate this AI agent:

  1. Download and install the project
  2. Configure GCP resources
  3. Configure project variables
  4. Test connections
  5. Deploy the project
  6. Review project workflows
  7. Trigger the project workflows

For troubleshooting guidance, see Troubleshooting.

Download and install the project

Follow these steps to install the Studio project for the AI agent:

  1. Log in to the Harmony portal at https://login.jitterbit.com and open Marketplace.

  2. Locate the AI agent named Document Compliance Agent (Google). To locate the agent, use the search bar or, in the Filters pane under Type, select AI Agent to limit the display to AI agents.

  3. Click the agent's Documentation link to open its documentation in a separate tab. Keep the tab open to refer back to after starting the project.

  4. Click Start Project to open a configuration dialog.

    Note

    If you have not yet purchased the AI agent, Get this agent is displayed instead. Click it to open an informational dialog, then click Submit to have a representative contact you about purchasing the AI agent.

    Tip

    The configuration dialog includes a warning not to import the template before applying endpoint customizations. That warning does not apply to this AI agent and can be ignored. Follow the recommended order of steps in this documentation instead.

  5. In the Create a New Project dialog, select an environment where the Studio project will be created, then click Create Project.

  6. After the progress dialog indicates the project is created, use the dialog link Go to Studio or open the project directly from the Studio Projects page.

Configure GCP resources

Before configuring project variables, set up the required Google Cloud Platform resources.

Enable required APIs

  1. Open the Google Cloud Console and select your project.

  2. Open the navigation menu and go to APIs & Services > Library.

  3. Search for and enable each of the following APIs:

    • Cloud Storage API
    • Cloud Document AI API
    • Vertex AI API

Create a service account

  1. In the Google Cloud Console, open IAM & Admin > Service Accounts and click Create Service Account.

  2. Enter a name for the service account, then click Create and Continue.

  3. Assign the following IAM roles to the service account:

    • Storage Object Admin (required for reading, archiving, and deleting files in both Cloud Storage buckets)
    • Document AI API User (required for OCR text extraction)
    • Vertex AI User (required for LLM inference)
  4. Click Done to create the service account.

  5. In the service account list, click the service account you just created. Open the Keys tab, click Add Key > Create new key, select JSON, and click Create. The key file downloads automatically.

  6. Open the downloaded JSON key file and note the following values for use in the project variables:

    • client_email value maps to the GCP_clientEmail project variable.
    • private_key value maps to the GCP_privateKey project variable.
    • private_key_id value maps to the GCP_privateKeyId project variable.

Create Cloud Storage buckets

  1. In the Google Cloud Console, open Cloud Storage > Buckets and click Create.

  2. Create the source bucket where PDF files will be placed for processing. Note the bucket name for the GCP_Get_BucketName project variable.

  3. Create a second bucket to serve as the archive destination for processed files. Note its name for the GCP_Archive_BucketName project variable.

  4. Ensure both buckets are in the same Google Cloud region.

Create a Document AI processor

  1. In the Google Cloud Console, open Document AI > My processors and click Create processor.

  2. Select Document OCR as the processor type.

  3. Enter a name for the processor, select a region, and click Create. Note the region for the GCP_DocumentAI_Location project variable.

  4. After the processor is created, copy the processor ID from the processor details page. Use this value for the GCP_Processor_ID project variable.

Configure project variables

In the Studio project installed from Marketplace, set values for the following project variables.

To configure project variables, use the project's actions menu and select Project Variables to open the configuration drawer.

Google Cloud Platform

Variable name Description
GCP_Project_ID Google Cloud project ID.
GCP_clientEmail Service account email address from the service account JSON key.
GCP_privateKeyId Private key ID from the service account JSON key.
GCP_privateKey Private key from the service account JSON key in PEM format.
GCP_tokenURI OAuth2 token endpoint URI for authenticating with Google Cloud. Use the default value: https://oauth2.googleapis.com/token.
GCP_scope OAuth2 scope for the service account. Use the default value: https://www.googleapis.com/auth/cloud-platform.

Google Document AI

Variable name Description
GCP_DocumentAI_Location Location code for the Document AI API (for example, us).
GCP_Processor_ID Document AI processor ID. See Create a Document AI processor.

Google Vertex AI

Variable name Description
GCP_VertexAI_Location Vertex AI region (for example, us-central1).
GCP_Model Gemini model name used for PII detection and data sanitization (for example, gemini-2.5-flash).
GCP_temperature LLM sampling temperature. Lower values produce more deterministic responses (for example, 0.1).
GCP_maxOutputTokens Maximum number of tokens in the LLM response (for example, 8192).

Google Cloud Storage

Variable name Description
GCP_Get_BucketName Name of the Google Cloud Storage source bucket where PDF files are placed for processing.
GCP_Archive_BucketName Name of the Google Cloud Storage archive bucket where processed files are moved after parsing.

FTP

Variable name Description
FTP_Host FTP server hostname.
FTP_UserName FTP username.
FTP_Password FTP password.
FTP_File_Path FTP destination folder path (for example, /PDF_Parser/).

Email

Variable name Description
SMTP_Host SMTP server hostname for sending error notifications (for example, smtp.gmail.com).
SMTP_Username SMTP username.
SMTP_Password SMTP password. For Gmail, generate an app password in your Google Account security settings.
Email_From_Recipients Sender email address for error notification messages.
Email_To_Recipients Recipient email address(es) for error notification messages.

Agent

Variable name Description
debug Set to 1 to enable debug logging or 0 to disable it.

Test connections

Test the endpoint configurations to verify connectivity using the defined project variable values.

To test connections, go to the design component palette's Project endpoints and connectors tab, hover over each endpoint, and click Test.

Deploy the project

Deploy the Studio project.

To deploy the project, use the project's actions menu and select Deploy.

Review project workflows

The Studio project contains one workflow that implements the Document Compliance Agent (Google) processing pipeline.

GCP PDF Parser

Operation Description
GCP Controller Checks the cache for a valid access token and initializes the processing pipeline.
Generate AccessToken Authenticates with Google Cloud using service account credentials and retrieves an OAuth2 access token.
Read List of PDFs from Google Cloud Storage Retrieves a list of available PDF files from the source Cloud Storage bucket.
Extract data from PDF using Google Document_AI Submits a PDF file to Google Document AI for OCR text extraction.
Extract PII data using Google Vertex_AI Sends extracted text to the LLM to detect and extract PII data, then writes the result to the FTP server.
Extract Non_PII data using Google Vertex_AI Sends extracted text to the LLM to produce a PII-free sanitized version, then writes the result to the FTP server.
Send File to FTP Writes a processed JSON payload to the configured FTP server destination.
Copy PDFs from Google Cloud Storage Copies the processed PDF from the source bucket to the archive bucket.
Delete PDFs from Google Cloud Storage Deletes the processed PDF from the source bucket after it has been archived.
Error Notification Sends an email notification with error details when a processing failure occurs.
GCP Controller

The GCP Controller operation serves as the entry point for the workflow. It checks the cache for an existing OAuth2 access token. If a valid token is found, the workflow proceeds directly to reading PDF files from Cloud Storage. If no token exists, the operation triggers Generate AccessToken to obtain one before continuing.

Generate AccessToken

The Generate AccessToken operation authenticates the agent with Google Cloud using the configured service account credentials. It builds a JWT from the service account's private key, signs it, and exchanges it with the Google OAuth2 token endpoint to retrieve an access token. The token is cached for reuse in subsequent operations.

Read List of PDFs from Google Cloud Storage

The Read List of PDFs from Google Cloud Storage operation sends an authenticated HTTP request to the Cloud Storage API to retrieve a list of PDF filenames in the source bucket. The operation iterates through the returned list, triggering the extraction pipeline for each file.

Extract data from PDF using Google Document_AI

The Extract data from PDF using Google Document_AI operation submits the PDF file to the Google Document AI API using the configured processor. The API returns the extracted text content, which the operation stores for use in the subsequent LLM analysis steps.

Extract PII data using Google Vertex_AI

The Extract PII data using Google Vertex_AI operation sends the extracted document text to the configured Gemini model via the Vertex AI API with a prompt to identify and extract personally identifiable information. The LLM response is parsed and cleaned, then passed to the Send File to FTP operation for delivery to the configured FTP destination.

Extract Non_PII data using Google Vertex_AI

The Extract Non_PII data using Google Vertex_AI operation sends the extracted document text to the Gemini model via the Vertex AI API with a prompt to produce a sanitized version with all PII removed. The cleaned response is passed to the Send File to FTP operation for delivery to the configured FTP destination.

Send File to FTP

The Send File to FTP operation writes the processed JSON payload to the FTP server at the path configured by the FTP_File_Path project variable. This operation is called once for PII output and once for non-PII output for each processed PDF file.

Copy PDFs from Google Cloud Storage

The Copy PDFs from Google Cloud Storage operation uses the Cloud Storage API to copy the processed PDF from the source bucket to the archive bucket, creating a permanent record of the processed file.

Delete PDFs from Google Cloud Storage

The Delete PDFs from Google Cloud Storage operation sends an authenticated DELETE request to the Cloud Storage API to remove the processed PDF from the source bucket after it has been successfully archived, preventing it from being reprocessed on subsequent runs.

Error Notification

The Error Notification operation constructs an error email with the workflow name, timestamp, and error details, then sends it to the addresses configured in the Email_To_Recipients project variable. After sending the notification, the operation raises the error to halt further execution.

Trigger the project workflows

To run the Document Compliance Agent (Google), deploy and run the GCP Controller operation. In Studio, hover over the operation and click the Deploy and Run icon in the top-right corner of the operation tile.

To automate the pipeline, configure operation schedules on the GCP Controller operation to run at your preferred frequency.

Troubleshooting

If you encounter issues, review the operation logs for detailed troubleshooting information.

For additional assistance, contact Jitterbit support.