Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

Secure text sanitization library for LLM - replaces sensitive data with tagged placeholders

Notifications You must be signed in to change notification settings

minamorl/securetext

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

securetext

Secure text sanitization library for LLM - replaces sensitive data with tagged placeholders.

Features

  • Detects and replaces sensitive information:
    • Hash values (SHA256, etc.)
    • API tokens / secrets
    • Email addresses
    • Phone numbers
    • Personal names (Japanese & English)
    • IP addresses
    • URLs
    • Credit card numbers
  • Consistent hash for same values
  • Reversible: restore original text with mapping table

Installation

pnpm add securetext

Usage

import { sanitize, restore } from 'securetext';

const original = "山田太郎のメールは[email protected]です";

// Sanitize
const { sanitizedText, mappingTable } = sanitize(original);
// sanitizedText: "[DELETED:PERSON_NAME:f7a3b2]のメールは[DELETED:EMAIL:c9d1e4]です"

// Restore
const restored = restore(sanitizedText, mappingTable);
// restored: "山田太郎のメールは[email protected]です"

License

MIT

About

Secure text sanitization library for LLM - replaces sensitive data with tagged placeholders

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published