Skip to content
Dashboard

Protecting AI apps from bots and bad actors with Vercel and Kasada

CTO, Vercel

Showcasing threat vectors for AI workloads and how we secure the Vercel AI SDK Playground.

Protect your AI workloads.

Learn how Vercel and Kasada work together to prevent abuse in your AI apps.

See the Template

Copy link to headingNew risks, old attack vectors

Copy link to headingVercel's AI SDK Playground: A case study in bot mitigation

Copy link to headingThe challenge

Copy link to headingIntegrating Kasada: A turnkey solution

Chart showing continued steady human traffic even as bot traffic increased.Chart showing continued steady human traffic even as bot traffic increased.
Chart showing continued steady human traffic even as bot traffic increased.

Copy link to headingHow it works

middleware.js
import { NextResponse } from 'next/server';
import { kasada } from '@lib/kasada-api';
export default async function middleware(request) {
const { error, context } = await kasada.classify(request);
// If Kasada was down or another failure occurred, fail open so users aren't impacted
if (error) {
console.error(`Kasada failed open with error: ${error}`);
return NextResponse.next();
}
// If the request is a Bad Bot, block this request and return a customizable response
if (context.response) {
return kasada.prepareResponse(context.response, context);
}
// No Bad bot detected, proceed to the next route handler
return NextResponse.next();
}

Copy link to headingOngoing collaboration to shield AI applications

Industry-leading security.

Learn more about Vercel's robust security and DDoS mitigation for your critical applications.

Talk with an Expert

Ready to deploy?