πŸ”¬ Analyze compliant documents with PromptLock Guard, Claude, and Google Sheets

⚑ 21 views Β· πŸ”¬ Document Extraction & Analysis

Description

Quick overview

Screen contracts, intake forms, and reports for HIPAA, GDPR, and PCI data β€” plus always-on prompt-injection detection β€” before Claude summarizes them. Clean documents pass through, risky ones get flagged for review or blocked, and every document gets an audit row in a Google Sheet.

How it works

  1. Receives a POST request to a webhook containing either a PDF upload or a JSON body with a text field.
  2. Extracts text from PDFs or uses the provided JSON text as-is.
  3. Sends the document text to PromptLock Guard to screen for regulated-data and prompt-injection risk, failing closed on screening errors.
  4. If the document is allowed or redacted, sends the cleaned text to Anthropic Claude and returns a structured JSON analysis in the webhook response.
  5. If the document is flagged, sends a Gmail notification email for human review instead of sending the content to the AI model.
  6. If the document is blocked (or screening is unavailable), returns a JSON webhook response indicating the block/unverified reason.
  7. Appends a per-document audit row (timestamp, action taken, risk score, and compliance status) to a DocAuditLog tab in Google Sheets.

Setup

  1. Install the n8n-nodes-promptlock-guard community node and add your PromptLock API key credentials (free API key at promptlock.io).
  2. Add Anthropic API credentials and confirm the Claude model and request headers meet your Anthropic account requirements.
  3. Add Gmail OAuth2 credentials and set the recipient address in the human review email step.
  4. Add Google Sheets OAuth2 credentials and replace YOUR_SPREADSHEET_ID with your spreadsheet URL/ID, ensuring a DocAuditLog sheet/tab exists.
  5. Copy the webhook URL from n8n and configure your uploader/system to POST either a PDF file or { "text": "..." } to the analyze-document endpoint.

Requirements

Customization

Additional info

Built by the author of PromptLock Guard, a verified community node in n8n’s integrations directory. Every lane was tested against the live API before submission: clean documents, PII-heavy documents, PDF extraction, and the fail-closed path with the screening API unreachable. Prompt-injection screening is always on regardless of framework selection β€” pattern rules plus a DeBERTa v3 classifier β€” so a poisoned document can’t instruct the model.

πŸ”— Nodes Used

Google Sheets, HTTP Request, Webhook, Gmail, Extract from File

πŸ“₯ Import

Download workflow.json and import into n8n: Workflow menu β†’ Import from File

πŸ“– Importing guide Β· πŸ”‘ Credential setup