Skip to main content

VerityNgn Setup Guide

Complete guide to setting up VerityNgn with Google Cloud authentication.

Prerequisites

  • Python 3.12+
  • Google Cloud account
  • Google Cloud project with billing enabled

Installation

1. Clone Repository

2. Install Dependencies

Using Conda (Recommended):
Using pip:

Authentication Setup

VerityNgn requires Google Cloud authentication for Vertex AI (Gemini). Choose one of the following methods: Best for: Automated workflows, production deployments, CI/CD

Step 1: Create Service Account

  1. Go to Google Cloud Console
  2. Select your project at the top of the page
  3. Click “Create Service Account”
    • Name: verityngn-service
    • Description: Service account for VerityNgn video verification
    • Click “Create and Continue”

Step 2: Grant Required Permissions

Add these roles:
  • ✅ Vertex AI User (required for Gemini multimodal analysis)
  • ✅ Storage Object Admin (optional, if using GCS)
Click “Continue” → “Done”

Step 3: Create & Download JSON Key

  1. Click on your new service account in the list
  2. Go to “Keys” tab
  3. Click “Add Key” → “Create new key”
  4. Select JSON format
  5. Click “Create”
  6. The JSON file will download automatically

Step 4: Configure Environment

Option A: Place in project directory (easiest) Save the JSON file as one of:
  • service-account.json
  • credentials.json
  • verityindex-key.json
The app will find it automatically! Option B: Set environment variable
To persist across sessions, add to ~/.zshrc:

Step 5: Set Project ID

Create a .env file in the project root:
Add your project ID:
Best for: Local development, interactive use

Step 1: Install Google Cloud SDK

macOS:
Linux:

Step 2: Authenticate

Step 3: Set Project Environment Variables

Create .env file:

Google Custom Search API (for evidence gathering)

  1. Go to Google Cloud Console → APIs & Services → Credentials
  2. Click “Create Credentials” → “API Key”
  3. Copy the API key
  4. Create Custom Search Engine:
  5. Add to .env:
Without this: System works but has limited verification capabilities.

YouTube Data API v3 (for enhanced counter-intelligence)

  1. Go to Google Cloud Console → APIs & Services → Library
  2. Search for “YouTube Data API v3”
  3. Click “Enable”
  4. Go to Credentials → “Create Credentials” → “API Key”
  5. Copy the API key
Add to .env:
Without this: System uses yt-dlp fallback (slower but functional).

Configuration

Environment Variables Reference

Create/edit .env file in project root:

Verification

Test Authentication

Quick test:
Expected output:
Full workflow test:

Troubleshooting

Error: “Could not automatically determine credentials”

Solution 1: Use service account method
  1. Download service account JSON
  2. Place in project root as service-account.json
  3. Restart application
Solution 2: Use gcloud auth

Error: “Reauthentication is needed”

OAuth2 credentials expired. Switch to service account or re-run:

Error: “Permission denied” for Vertex AI

Grant Vertex AI User role to your service account:

Error: “Google Search API key not configured”

This is optional. System works without it but has limited verification. To fix: See Google Custom Search API section.

Error: “ModuleNotFoundError”

Reinstall dependencies:

Next Steps


Security Best Practices

  1. Never commit credentials to git:
  2. Restrict service account permissions:
    • Only grant necessary roles
    • Use separate service accounts for dev/prod
  3. Rotate keys regularly:
    • Delete old service account keys
    • Create new keys every 90 days
  4. Use environment-specific credentials:
    • Development: application-default credentials
    • Production: service account with minimal permissions

Last Updated: October 28, 2025
Version: 2.0