Integrations

Edge

Comprehensive guide to integrating Cencori Edge with your platforms, edge runtimes, and development tools. Deploy AI protection across your entire stack with minimal configuration.

Overview

Cencori Edge provides pre-built integrations that allow you to add AI request protection at the edge layer of your application. Instead of modifying your application code, Edge integrations intercept requests at the infrastructure level, providing:

  • Zero-code protection: Add security without changing your application
  • Minimal latency: Edge processing adds <50ms to request time
  • Automatic scaling: Protection scales with your edge infrastructure
  • Real-time filtering: Block malicious requests before they reach your AI providers

Supported Integrations

Vercel

Edge Middleware & Marketplace

Supabase

Edge Functions Extension

IDE Plugins

Cursor & VS Code

SDK Integrations

Cencori provides first-class SDK adapters for popular AI frameworks, enabling seamless integration with your preferred tooling.

Vercel AI SDK

Drop-in integration with the Vercel AI SDK. Works with streamText(), generateText(), and useChat().

terminal
app/api/chat/route.ts

Tool Calling (Vercel AI SDK)

tools.ts

TanStack AI

Native adapter for TanStack AI with streaming, structured output, and tool calling support.

terminal
chat.ts

Tool Calling (TanStack AI)

tools-tanstack.ts

Vercel Integration

The Vercel integration allows you to protect all AI requests in your Next.js, SvelteKit, Nuxt, or any Vercel-hosted application using Edge Middleware. Requests are intercepted and processed before reaching your application.

Installation Methods

1Vercel Marketplace (Recommended)

The easiest way to integrate Cencori with your Vercel projects is through the Vercel Marketplace:

  1. Navigate to the Vercel Integrations Marketplace
  2. Search for "Cencori" and click "Add Integration"
  3. Select the projects you want to protect
  4. Authorize the integration with your Cencori account
  5. The integration will automatically configure your projects

Marketplace installation automatically handles environment variables, middleware setup, and preview deploy protection.

2Manual Edge Middleware Setup

For more control, you can manually configure the Edge Middleware in your project:

Step 1: Install the package

terminal

Step 2: Add environment variables

.env.local

Step 3: Create the middleware file

middleware.ts

Step 4: Configure route matching

The middleware matcher determines which routes are processed. Common patterns:

middleware.ts

Preview Deploy Protection

Cencori automatically protects Vercel preview deployments, preventing sensitive data from being exposed in development/staging environments:

middleware.ts

Configuration Options

OptionTypeDescription
apiKeystringYour Cencori API key (required)
projectIdstringYour Cencori project ID (required)
protectedRoutesstring[]Glob patterns for routes to protect
securityobjectEnable/disable security features
onBlockfunctionCustom handler for blocked requests
previewProtectionobjectSettings for Vercel preview deploys

Supabase Integration

The Supabase integration extends Edge Functions with Cencori protection, allowing you to secure AI requests made from your Supabase backend without modifying function code.

Installation

Step 1: Enable the Cencori extension

In your Supabase dashboard, navigate to Database → Extensions and search for "cencori":

SQL Editor

Step 2: Create a protected Edge Function

supabase/functions/ai-chat/index.ts

Step 3: Configure environment secrets

terminal

Edge Function Routing

For applications with multiple Edge Functions, you can configure global routing to protect all AI-related functions:

supabase/functions/_shared/cencori.ts

Using the shared middleware:

supabase/functions/chat/index.ts

Database-Level Protection

You can also use Cencori directly in PostgreSQL functions for database-level AI protection:

SQL Editor

IDE Plugins

Cencori IDE plugins provide real-time security feedback directly in your development environment. Catch security issues before they reach production.

VS Code Extension

Installation

  1. Open VS Code
  2. Go to Extensions (Ctrl+Shift+X / Cmd+Shift+X)
  3. Search for "Cencori"
  4. Click Install

Or install via command line:

terminal

Configuration

Add your credentials to VS Code settings:

settings.json

Features

  • Real-time scanning: Highlights security issues as you type
  • Pre-commit checks: Scans files before git commits
  • Inline suggestions: Provides fix suggestions for common issues
  • Dashboard link: Jump directly to Cencori dashboard for detailed analysis

CursorCursor Extension

The Cursor extension is especially valuable for AI-assisted development, where generated code may inadvertently contain security issues.

Installation

  1. Open Cursor
  2. Go to Extensions
  3. Search for "Cencori"
  4. Click Install

Cursor-Specific Features

  • AI-generated code scanning: Automatically scans code generated by Cursor's AI
  • Composer integration: Checks multi-file changes before applying
  • Chat context awareness: Warns about sensitive data in AI chat context
settings.json

Pre-Deploy Checks

Both IDE extensions can be configured to run comprehensive security checks before deployment:

.cencori.json

CI/CD Integration

Integrate Cencori checks into your CI/CD pipeline for automated security scanning:

GitHub Actions

.github/workflows/cencori.yml

GitLab CI

.gitlab-ci.yml

Troubleshooting

Middleware Not Triggering

Ensure your matcher config in middleware.ts includes the routes you want to protect. Verify with console logging.

Environment Variables Not Loading

For Vercel, ensure variables are set in the project settings. For local development, verify your .env.local file is in the project root.

High Latency

Edge processing should add <50ms. If experiencing higher latency, check your region configuration and ensure you're using the nearest Cencori edge endpoint.

False Positives

Adjust sensitivity settings in your configuration. You can also add patterns to the allowlist in your Cencori dashboard.

Next Steps