@tpmjs/tools-data-classification-heuristic
Classifies data sensitivity using heuristics to detect PII (personal identifiable information), financial data, health data, and other sensitive patterns. Returns classification level (public/internal/confidential/restricted), detected signals, and confidence score.
Test @tpmjs/tools-data-classification-heuristic (dataClassificationHeuristic) with AI-powered execution
0/2000 characters
Install this tool and use it with the AI SDK
npm install @tpmjs/tools-data-classification-heuristicpnpm add @tpmjs/tools-data-classification-heuristicyarn add @tpmjs/tools-data-classification-heuristicbun add @tpmjs/tools-data-classification-heuristicdeno add npm:@tpmjs/tools-data-classification-heuristicimport { dataClassificationHeuristic } from '@tpmjs/tools-data-classification-heuristic';import { generateText } from 'ai';
import { openai } from '@ai-sdk/openai';
import { dataClassificationHeuristic } from '@tpmjs/tools-data-classification-heuristic';
const result = await generateText({
model: openai('gpt-4o'),
tools: { dataClassificationHeuristic },
prompt: 'Your prompt here...',
});
console.log(result.text);Available configuration options
textstringThe text content to analyze for sensitive data patterns
Schema extracted: 1/1/2026, 8:17:38 AM
Classifies data sensitivity using pattern-based heuristics to detect PII, financial data, health data, and other sensitive information.
npm install @tpmjs/tools-data-classification-heuristic
import { dataClassificationHeuristic } from '@tpmjs/tools-data-classification-heuristic'; const result = await dataClassificationHeuristic.execute({ text: "Contact John Doe at john.doe@example.com or call 555-123-4567. SSN: 123-45-6789" }); console.log(result); // { // classification: 'restricted', // signals: [ // { type: 'Email', severity: 'medium', description: 'Email address detected', matches: 1 }, // { type: 'Phone', severity: 'medium', description: 'Phone number detected', matches: 1 }, // { type: 'SSN', severity: 'critical', description: 'Social Security Number detected', matches: 1 } // ], // confidence: 0.8, // summary: { // totalSignals: 3, // highestSeverity: 'critical', // categories: ['PII'] // } // }
interface DataClassification { classification: 'public' | 'internal' | 'confidential' | 'restricted'; signals: Array<{ type: string; pattern: string; severity: 'low' | 'medium' | 'high' | 'critical'; description: string; matches?: number; }>; confidence: number; // 0-1 scale summary: { totalSignals: number; highestSeverity: string; categories: string[]; }; }
MIT
Downloads/month
38
Quality Score