WP Manifestindependent plugin directory
manifest / unclassified / wpaigateway

VGT AI Gateway

VGT AI Gateway establishes a sovereign, high-performance mediation layer between a WordPress instance and autonomous AI systems, Large Language Model (LLM) agents, and search crawlers. Modern AI systems (such as OpenAI ChatGPT, Anthropic Claude, Perplexity, and Google Gemini) consume massive bandwidth and token budgets

by VisionGaiaTechnology · github.com/visiongaiatechnology/wpaigateway · website

0stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/visiongaiatechnology/wpaigateway/archive/refs/heads/main.zip

VGT AI Gateway Logo

VGT AI Gateway

Controlled Knowledge Mediation Layer & Multi-Signal Trust Engine for WordPress

Version PHP Version WordPress Version License: AGPL v3 Security Status FastPath Latency External Dependencies

Language Variations:
English · Deutsch · Русский


Overview

VGT AI Gateway establishes a sovereign, high-performance mediation layer between a WordPress instance and autonomous AI systems, Large Language Model (LLM) agents, and search crawlers.

Modern AI systems (such as OpenAI ChatGPT, Anthropic Claude, Perplexity, and Google Gemini) consume massive bandwidth and token budgets attempting to parse unstructured HTML. Standard web pages force crawlers to download megabytes of stylesheets, scripts, cookie banners, navigation menus, and footers just to extract basic entity facts.

VGT AI Gateway decouples human presentation from machine knowledge:

  • Human Visitors receive the standard, unmodified WordPress presentation layer via an ultra-low latency FastPath (<0.2ms).
  • Autonomous AI Agents receive structured, canonical knowledge transformed dynamically into JSON, JSON-LD (Schema.org), Markdown, Plain Text, Semantic HTML, or llms.txt.

Architectural Highlights

Incoming HTTP Request
          │
          ▼
   [ FastPath Check ] ──────────────────────┐
   │ (Detects standard browser)            │ (AI signature / Gateway route)
   ▼                                        ▼
WordPress Core Normal Pipeline       [ Request Classifier ]
(Zero overhead: < 0.2ms)                    │
                                            ▼
                                     [ Trust Engine ]
                                     ├── fcRDNS (IPv4 / IPv6)
                                     ├── Provider IP CIDR Match
                                     └── Header Anomaly Check
                                            │
                                            ▼
                                     [ Policy Engine ]
                                     ├── Match Agent & Purpose
                                     └── Action: ALLOW | BLOCK | GATEWAY_ONLY
                                            │
                                            ▼
                              [ Resource Router & Negotiator ]
                                     ├── Gateway Cache (304 / ETag)
                                     └── Output Transformers
                                         (JSON, JSON-LD, MD, TXT, HTML)

1. Sub-Millisecond FastPath

Human traffic never suffers latency penalties. Incoming requests presenting authentic browser headers (Sec-Ch-Ua, interactive Accept, standard desktop/mobile user agents) immediately exit the gateway pipeline in under 0.2 milliseconds, proceeding directly to standard WordPress execution.

2. Multi-Signal Trust Engine (Anti-Spoofing)

In VGT AI Gateway, a User-Agent header is never accepted as proof of identity. Anyone can forge User-Agent: GPTBot. The Trust Engine scores requests (0–100) using independent verification signals:

  • Forward-Confirmed Reverse DNS (fcRDNS): Dual-stack IPv4 (gethostbynamel) and IPv6 (dns_get_record AAAA) resolution matching authoritative provider hostnames (e.g., *.openai.com, *.anthropic.com, *.googlebot.com).
  • IP CIDR Subnet Matching: Bitwise integer comparison against published provider egress subnets.
  • Header Consistency Analysis: Flags headless browser characteristics pretending to be interactive users, and vice-versa.
  • Spoofing Disqualifier: If a crawler claims to be an authentic bot but fails reverse/forward DNS verification, its trust score drops to 0 (SUSPICIOUS) and triggers an opaque HTTP 403 block.

3. Canonical Knowledge Model (Single Source of Truth)

Information is defined once in a normalized database repository and dynamically projected into any target representation:

  • JSON: Clean envelope schema for programmatic API ingestion.
  • JSON-LD: Valid Schema.org entity graphs (Organization, Product, Service, Person, etc.).
  • Markdown: Optimized token density for LLM context windows.
  • Plain Text: Ultra-lightweight raw factual streams.
  • Semantic HTML: Stripped of CSS/JS bloat with embedded JSON-LD.
  • llms.txt / llms-full.txt: Standardized root index specifications.

4. Granular Purpose-Based Policies

Access can be controlled independently by provider, agent name, and purpose:

  • Search Bots (e.g., OAI-SearchBot, Google-Extended): Real-time indexation.
  • User Fetch (e.g., ChatGPT-User, Claude-User): End-user live web browsing.
  • Training Crawlers (e.g., GPTBot, ClaudeBot): Large-scale dataset scrapers.
  • Default-Deny Content Security: All newly created content is private (AI Visibility = disabled) until explicitly published by an administrator.

5. Sovereign Coexistence

The gateway is built to operate cleanly alongside dedicated security solutions such as GeDefense WP. It modifies zero external files, overrides zero foreign hooks, and requires zero private APIs. If GeDefense drops or bans an IP at the perimeter, the AI Gateway gracefully honors the defense boundary.


Directory Structure

vgt-ai-gateway/
├── vgt-ai-gateway.php        # Core entry point & environment verification
├── uninstall.php             # Clean uninstaller with retention preference
├── readme.txt                # WordPress plugin repository descriptor
├── README.md                 # English GitHub documentation
├── README.de.md              # German GitHub documentation
├── README.ru.md              # Russian GitHub documentation
│
├── src/
│   ├── Core/                 # Autoloader, Config, FailSafe circuit breaker, Plugin
│   ├── Detection/            # FastPath, RequestClassifier, SignatureMatcher
│   ├── Providers/            # OpenAI, Anthropic, Perplexity, Google, Generic
│   ├── Trust/                # TrustEngine, TrustScore, fcRDNS, CIDR, Header signals
│   ├── Knowledge/            # Entities, Repositories, Graph Relations, Freshness
│   ├── Policy/               # PolicyEngine, PolicyRule, AccessAction, Decisions
│   ├── Transformers/         # JSON, JSON-LD, Markdown, Text, HTML, llms.txt
│   ├── Routing/              # GatewayRouter, ContentNegotiator, ResourceMapper
│   ├── Cache/                # GatewayCache (Version-token invalidation, 304 ETag)
│   ├── Analytics/            # AnalyticsRecorder (Shutdown batch write), PrivacyManager
│   ├── Database/             # Idempotent Schema DDL, MigrationRunner
│   ├── Admin/                # AdminController, ImportExportController
│   ├── I18n/                 # 5-Language Matrix (DE, EN, RU, ES, IT dictionaries)
│   ├── Rest/                 # AdminRestApiController, PublicAiRestApiController
│   ├── WordPress/            # MetaBoxManager, RobotsTxtHandler
│   └── Exceptions/           # AppException, ValidationException, SecurityException
│
├── admin/
│   ├── css/vgt-ai-admin.css  # Dark-first admin theme (Zero CDNs, local only)
│   ├── js/vgt-ai-admin.js    # DOM-only client (Zero innerHTML, X-WP-Nonce protected)
│   └── views/                # 11 modular tab templates
│
└── tests/
    └── run_tests.php         # 10-suite unit, integration & line-ceiling test runner

Public Endpoints & Content Negotiation

The gateway registers clean virtual endpoints handled internally without redirect chains:

Endpoint Supported Formats Description
/llms.txt Text / Markdown Curated root index for LLM crawlers
/llms-full.txt Text / Markdown Comprehensive inlined knowledge index
/ai/ or /ai/index Negotiated (JSON, MD, TXT, HTML) Primary entity catalog
/ai/index.json JSON Direct JSON catalog
/ai/index.md Markdown Direct Markdown catalog
/ai/index.txt Plain Text Direct Plain Text catalog
/ai/products.json JSON Active product offerings
/ai/services.json JSON Active professional services
/ai/projects.json JSON Active portfolio entries
/ai/contact.json JSON Official communication metadata
/ai/resources/{slug} Negotiated (JSON, MD, TXT, HTML) Single canonical entity view

Content Negotiation Example

Clients can specify format preference via extensions or the standard Accept header:

# Request Markdown
curl -H "Accept: text/markdown" https://example.com/ai/resources/my-product

# Request JSON-LD / JSON
curl -H "Accept: application/json" https://example.com/ai/resources/my-product

Installation & Setup

Prerequisites

  • PHP: 8.1 or higher (strict types enforced)
  • WordPress: 6.0 or higher
  • Web Server: Apache, Nginx, or LiteSpeed with pretty permalinks enabled

Installation Steps

  1. Clone or download the repository into your WordPress plugins directory:
    cd wp-content/plugins/
    git clone https://github.com/visiongaiatechnology/wpaigateway.git vgt-ai-gateway
  2. Navigate to Plugins in the WordPress Administration Panel.
  3. Locate VGT AI Gateway and click Activate.
  4. Database tables (wp_vgt_ai_knowledge, wp_vgt_ai_relations, wp_vgt_ai_analytics) are created automatically via idempotent migration.

Administration Dashboard

Access the dedicated AI Gateway menu in the WordPress dashboard:

  • Overview: Real-time traffic breakdown, live knowledge count, active providers, and enforced blocks.
  • Knowledge Base: Full CRUD management of canonical resources, Schema.org type selection, and preview links.
  • Providers & Agents: Catalog of registered providers, user-agent patterns, and verified domains.
  • Access Policies: Priority matrix to allow, restrict to gateway only, or block specific agents and purposes.
  • Resource Routing: Map regular front-end URLs (e.g., /pricing/) directly to structured AI resources.
  • Traffic Analytics: 30-day interaction history, resource demand charts, cache hit ratios, and masked IPs.
  • llms.txt Manager: Live generator, title/summary customization, and one-click preview.
  • Import / Export: Portability module supporting JSON schemas up to 5MB with strict path-jail validation.
  • Security & Trust Simulator: Real-time evaluation tool to test any custom User-Agent and IP against fcRDNS and CIDR filters.
  • Diagnostics (Section 48): System integrity inspection, DB table record counters, rewrite rule status, and cache tokens with zero credential leakage.
  • Global Settings: Master gateway switch, IP anonymization toggles, retention policies (7/30/90 days), and uninstallation options.

Security Architecture

  1. Zero innerHTML Usage: The admin JavaScript client relies exclusively on textContent, setAttribute, replaceChildren, and DOM node creation. No string-to-HTML injection vectors exist.
  2. XSS & Script Breakout Protection: All JSON-LD outputs use JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_APOS | JSON_HEX_QUOT. Script tags within title or content cannot break out of inline `