Skip to main content
interlace
Plugin: vercel-ai-securityRules

no-training-data-exposure

This rule identifies code patterns where user data might be sent to LLM training endpoints or when training data coll...

Prevents user data from being sent to LLM training endpoints.

📊 Rule Details

PropertyValue
Typeproblem
Severity🟡 HIGH
OWASP LLMLLM03: Training Data Poisoning
CWECWE-359: Privacy Violation
CVSS7.0
Config Defaultoff (recommended), error (strict)

🔍 What This Rule Detects

This rule identifies code patterns where user data might be sent to LLM training endpoints or when training data collection is enabled.

❌ Incorrect Code

// Training enabled
const config = {
  training: true,
};

// Allow training flag
const options = {
  allowTraining: true,
};

// Training endpoint
fetch('https://api.openai.com/v1/fine-tune');

✅ Correct Code

// Training disabled
const config = {
  training: false,
};

// No training endpoint
await generateText({
  model: openai('gpt-4'),
  prompt: userInput,
});

⚙️ Options

OptionTypeDefaultDescription
trainingPatternsstring[]["train","training","finetune","fine-tune","fine_tune"]Patterns suggesting training endpoints

🛡️ Why This Matters

Exposing user data to training can:

  • Privacy violations - User data used without consent
  • Data poisoning - Malicious data taints model
  • Compliance violations - GDPR, CCPA violations
  • IP leakage - Proprietary information exposed

🔄 Changes in the 2026-10-10 FP/FN audit

  • URLs are matched by whole path segment (/v1/fine_tuning/jobs, /api/train/model), not substring: /trainers and /training-schedule are not reported.
  • feedback, improve and learn were removed from the defaults: a thumbs-up/down /api/feedback endpoint and showFeedback: true are product features, not training opt-ins. Flag names are matched by whole word.
  • Now off in recommended: the rule has no tie to a provider setting.
  • Options: the documented defaultOptions now apply. Earlier versions read context.options and silently ran a shorter hard-coded list instead.

Known False Negatives

The following patterns are not detected due to static analysis limitations:

Environment-Based Training Flags

Why: Environment variables are not resolved.

// ❌ NOT DETECTED - Training from env
const options = { training: process.env.ENABLE_TRAINING };

Mitigation: Hardcode training: false. Never use env for training flags.

Training Endpoints in Config

Why: Endpoints from config files are not visible.

// ❌ NOT DETECTED - Endpoint from config
fetch(config.apiEndpoint); // May be fine-tune endpoint

Mitigation: Review API configurations for training endpoints.

Implicit Training via SDK Options

Why: Hidden SDK options enabling training may not be detected.

// ❌ NOT DETECTED - SDK defaults to training
const client = new AIClient(); // training: true by default

Mitigation: Explicitly set training: false in all SDK configs.

📚 References

Use this rule

npm install -D oxlint-plugin-vercel-ai-security
.oxlintrc.json
{  "jsPlugins": ["oxlint-plugin-vercel-ai-security"],  "rules": {    "vercel-ai-security/no-training-data-exposure": "error"  }}
vite.config.ts
import { defineConfig } from 'vite-plus';export default defineConfig({  lint: {    jsPlugins: ['oxlint-plugin-vercel-ai-security'],    rules: {      'vercel-ai-security/no-training-data-exposure': 'error',    },  },});

oxlint-plugin-vercel-ai-security re-exports eslint-plugin-vercel-ai-security/oxlint: the same rules under the same IDs, and no ESLint install. Why oxlint.

Did this rule catch something? Star the repo to get new CWE coverage as we ship it — or follow the AI-code-security benchmarks behind these rules.