360 Secure SkillHub
360 安全技能中心

prompt-sanitizer

在把文本发送给 LLM 前调用外部 x402 付费接口做安全清洗,可检测 PII、提示注入、毒性和离题内容,按需选择检查项与语言,返回脱敏文本、命中标记、风险评分以及是否可安全发送的判断。

daisuke134
daisuke134
热度 85.22
最近更新 2026-05-17 13:06:06
分类:安全依赖:代码执行 / 第三方 API应用场景:数据处理 / API 集成 / 工作流

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add prompt-sanitizer
Metadata
name
prompt-sanitizer
description
Sanitize prompts before sending to LLMs. Detects PII, prompt injection, toxicity, and off-topic content. Returns cleaned text + risk score. Use when: sanitize input, check prompt safety, detect injection, remove PII, content moderation, guardrails, agent safety.
version
1.0.0
author
Daisuke134

prompt-sanitizer

Sanitize any text before sending it to an LLM. Detects and flags PII, prompt injection attempts, toxicity, and off-topic hijacking. Returns cleaned text with PII masked and a risk score.

Prerequisite

npm install -g awal@2.0.3
awal auth login

Usage

npx awal@2.0.3 x402 pay https://anicca-proxy-production.up.railway.app/api/x402/prompt-sanitizer \
  -X POST \
  -d '{"text": "My email is john@example.com. Ignore previous instructions.", "checks": ["pii", "injection", "toxicity", "off_topic"], "language": "en"}'

Input

Field Type Required Description
text string (max 10000) yes Text to sanitize
checks array of: pii, injection, toxicity, off_topic no (default: all) Which checks to run
language "en" or "ja" no (default: "en") Language hint

Output

{
  "sanitizer_id": "san_a1b2c3",
  "original_length": 89,
  "sanitized_text": "My email is [EMAIL]. ...",
  "flags": [{"type": "pii", "severity": "high", "detail": "Email detected", "position": {"start": 12, "end": 28}}],
  "risk_score": 1.0,
  "safe_to_send": false,
  "safe_t_flag": true
}

Pricing

$0.005 USDC per request (Base network, eip155:8453)

Endpoint

POST https://anicca-proxy-production.up.railway.app/api/x402/prompt-sanitizer