Vercel AI SDK: Arcjet works alongside the Vercel AI SDK. Call protect() before streamText() / genera...
return a plain error response instead of calling the AI SDK.
Explore
123,489 skills indexed with the new KISS metadata standard.
return a plain error response instead of calling the AI SDK.
the client gets a broken response. Always call protect() first and return an error before opening the stream.
return the error before opening the stream — don't start streaming and then abort.
independent of the model provider.
filter by conclusion to see blocks
promote to LIVE.
res.status(429).json(...) for Express).
decision.reason.message);
{ status: 403 });
// injection detection
// tokens to deduct for rate limiting
{
// PII scanning
deduct 1 token per message
defaults to IP-based.
directly linking rate limiting to cost. It also allows short bursts while enforcing an average rate
PII leakage
role-play escapes
set one up first with shield() as the base rule. The user will need to register for an Arcjet account at https://app.arcjet.com then use the ARCJET_KEY in their environment variables.
rule types
PII blocking
block PII and sensitive info from leaking in responses
FAS