ESLint InterlaceESLint Interlace
Plugin: vercel-ai-security

Overview

Vercel AI SDK security rules for generateText, streamText, and LLM tools

Live from GitHub

This content is fetched directly from README.md on GitHub and cached for 1 hour.

AI-Optimized Security

Every rule includes CWE, OWASP LLM Top 10, and CVSS metadata for AI assistants to provide precise, context-aware fixes.


ESLint Interlace Logo

Security rules for Vercel AI SDK usage (prompt injection, data handling).

NPM VersionNPM DownloadsPackage LicenseCodecovSince Dec 2025

Description

This plugin provides Security rules for Vercel AI SDK usage (prompt injection, data handling). By using this plugin, you can proactively identify and mitigate security risks across your entire codebase.

Philosophy

Interlace fosters strength through integration. Instead of stacking isolated rules, we interlace security directly into your workflow to create a resilient fabric of code. We believe tools should guide rather than gatekeep, providing educational feedback that strengthens the developer with every interaction.

Getting Started

npm install eslint-plugin-vercel-ai-security --save-dev

๐Ÿ”ง Supported AI SDK Functions

FunctionFull Coverage
generateTextโœ… All 19 rules
streamTextโœ… All 19 rules + abort signal
generateObjectโœ… All 19 rules
streamObjectโœ… All 19 rules + abort signal
tool() helperโœ… Schema validation
embed() / embeddingsโœ… Embedding validation

โš™๏ธ Configuration Presets

PresetDescription
recommendedBalanced security (7 errors, 7 warnings)
strictMaximum security (17 errors, 2 warnings)
minimalMinimal config

๐Ÿ“Š Test Coverage

MetricCoverage
Rules19
Tests200
Lines98%+
Functions100%

๐Ÿค– AI-Agent Optimized Messages

All rule messages follow a structured format optimized for AI coding assistants:

๐Ÿ”’ CWE-74 OWASP:A03-Injection CVSS:9 | Unsafe Prompt | CRITICAL [SOC2,GDPR]
   Fix: Validate input before use | https://owasp.org/...

By providing this structured context (CWE, OWASP, Fix), we enable AI tools to reason about the security flaw rather than hallucinating. This allows Copilot/Cursor to suggest the exact correct fix immediately.

๐Ÿ“ฆ Compatibility

PackageVersion
ai (Vercel AI SDK)
ESLint
Node.js

๐Ÿ™‹ FAQ

What's the difference between this and generic AI security linters?

Generic linters guess at patterns. This plugin knows the exact Vercel AI SDK API.

Does this work with ESLint 9 Flat Config?

Yes! Designed specifically for ESLint Flat Config.

How do I suppress a rule for a specific line?

// eslint-disable-next-line vercel-ai-security/require-validated-prompt
await generateText({ prompt: internalPrompt });

Why is ASI06 (Memory Corruption) not covered?

TypeScript/JavaScript are memory-safe languages. Memory corruption vulnerabilities (buffer overflows, use-after-free, etc.) are not possible in these environments.

๐Ÿ“š Supported Libraries

LibrarynpmDownloadsDetection
ai (Vercel AI SDK)Prompt Injection, Data Leakage

Rules

Legend

IconDescription
๐Ÿ’ผRecommended: Included in the recommended preset.
โš ๏ธWarns: Set towarn in recommended preset.
๐Ÿ”งAuto-fixable: Automatically fixable by the --fix CLI option.
๐Ÿ’กSuggestions: Providing code suggestions in IDE.
๐ŸšซDeprecated: This rule is deprecated.
RuleCWEOWASPCVSSDescription๐Ÿ’ผโš ๏ธ๐Ÿ”ง๐Ÿ’ก๐Ÿšซ
no-dynamic-system-promptCWE-748.0ESLint rule documentation for no-dynamic-system-prompt๐Ÿ’ผ
no-hardcoded-api-keysCWE-7988.5ESLint rule documentation for no-hardcoded-api-keys๐Ÿ’ผ
no-sensitive-in-promptCWE-2008.0ESLint rule documentation for no-sensitive-in-prompt๐Ÿ’ผ
no-system-prompt-leakCWE-2007.5ESLint rule documentation for no-system-prompt-leak๐Ÿ’ผ
no-training-data-exposureCWE-3597.0ESLint rule documentation for no-training-data-exposure๐Ÿ’ผโš ๏ธ
no-unsafe-output-handlingCWE-949.8ESLint rule documentation for no-unsafe-output-handling๐Ÿ’ผ
require-abort-signalCWE-4044.0ESLint rule documentation for require-abort-signal๐Ÿ’ก
require-audit-loggingCWE-7784.0ESLint rule documentation for require-audit-logging๐Ÿ’ก
require-embedding-validationCWE-205.5ESLint rule documentation for require-embedding-validation๐Ÿ’ก
require-error-handlingCWE-7555.0ESLint rule documentation for require-error-handling๐Ÿ’ก
require-max-stepsCWE-8346.5ESLint rule documentation for require-max-steps๐Ÿ’ผโš ๏ธ
require-max-tokensCWE-7706.5ESLint rule documentation for require-max-tokens๐Ÿ’ผโš ๏ธ
require-output-filteringCWE-2006.5ESLint rule documentation for require-output-filtering๐Ÿ’ผโš ๏ธ
require-output-validationCWE-7075.0ESLint rule documentation for require-output-validation๐Ÿ’ก
require-rag-content-validationCWE-746.0ESLint rule documentation for require-rag-content-validation๐Ÿ’ผโš ๏ธ
require-request-timeoutCWE-4005.0ESLint rule documentation for require-request-timeout๐Ÿ’ผโš ๏ธ
require-tool-confirmationCWE-8627.0ESLint rule documentation for require-tool-confirmation๐Ÿ’ผ
require-tool-schemaCWE-207.5ESLint rule documentation for require-tool-schema๐Ÿ’ผโš ๏ธ
require-validated-promptCWE-749.0ESLint rule documentation for require-validated-prompt๐Ÿ’ผ

Part of the Interlace ESLint Ecosystem โ€” AI-native security plugins with LLM-optimized error messages:

PluginDownloadsDescription
eslint-plugin-secure-codingGeneral security rules & OWASP guidelines.
eslint-plugin-pgPostgreSQL security & best practices.
eslint-plugin-cryptoNodeJS Cryptography security rules.
eslint-plugin-jwtJWT security & best practices.
eslint-plugin-browser-securityBrowser-specific security & XSS prevention.
eslint-plugin-express-securityExpress.js security hardening rules.
eslint-plugin-lambda-securityAWS Lambda security best practices.
eslint-plugin-nestjs-securityNestJS security rules & patterns.
eslint-plugin-mongodb-securityMongoDB security best practices.
eslint-plugin-vercel-ai-securityVercel AI SDK security hardening.
eslint-plugin-import-nextNext-gen import sorting & architecture.

๐Ÿ“„ License

MIT ยฉ Ofri Peretz

ESLint Interlace Plugin

View README.md on GitHub โ†’

On this page

No Headings