
Product
Socket Firewall Now Blocks Malicious VS Code and Open VSX Extensions
Socket Firewall blocks malicious VS Code and Open VSX extensions before install, protecting developers from compromised editor marketplaces.
@promptshield/sanitizer
Advanced tools
PromptShield sanitizer that applies safe, deterministic fixes to text based on detected prompt-injection threats such as invisible characters, markdown smuggling, and BOM artifacts.

Deterministic sanitizer for prompt hygiene. Applies safe, idempotent text transformations to remove invisible threats and normalization artifacts.
$ pnpm add @promptshield/sanitizer
import { sanitize, sanitizeStrict } from "@promptshield/sanitizer";
const dirty = "Hello\u200BWorld"; // Contains Zero-Width Space
// Safe sanitize (removes invisible chars)
const clean = sanitize(dirty);
console.log(clean); // "HelloWorld"
// Strict sanitize (also applies NFKC normalization)
const strict = sanitizeStrict("ℍ𝕖𝕝𝕝𝕠");
console.log(strict); // "Hello"
\u200B (ZWSP), \u200C (ZWNJ), \u200D (ZWJ), etc.\uFEFF.\uFE00-\uFE0F (often used to break tokenizers).<!-- hidden payload -->.[](javascript:...).📚 Deep Dives: For the exact execution order of the sanitization pipeline and understanding
applyFixes, see the Documentation section.
This library is licensed under the MIT open-source license.
with 💖 by Mayank Kumar Chaudhari
FAQs
PromptShield sanitizer that applies safe, deterministic fixes to text based on detected prompt-injection threats such as invisible characters, markdown smuggling, and BOM artifacts.
We found that @promptshield/sanitizer demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket Firewall blocks malicious VS Code and Open VSX extensions before install, protecting developers from compromised editor marketplaces.

Research
More than 140 Mastra npm packages were compromised in a supply chain attack that used a typosquatted dependency to deliver a cross-platform infostealer during installation.

Research
/Security News
A new npm package tests AI malware scanners with prompt injection, safety-triggering comments, context flooding, and obfuscated JavaScript.