desensitize.yaml 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. name: desensitize
  2. repo: https://github.com/yubingz/hermes-desensitize
  3. sha: 4f6697c1e45bb224e40b556372f33794f9326c0f
  4. subdir: src/hermes_desensitize
  5. description: "Chinese-context desensitization for Hermes chats. Replaces PII and business-sensitive
  6. entities — person names, company names, addresses, file paths, and magnitude figures — with
  7. reversible placeholders before a message reaches the model, then restores them in the reply.
  8. Two layers: an optional local/OpenAI-compatible LLM for semantic entity judgment, plus a
  9. sub-millisecond regex fallback (phone, ID card, email, IP, path) that keeps the conversation
  10. working when the model is unavailable. Disclosure — the semantic layer sends the
  11. pre-redaction text to the configured LLM, because recognising a name requires seeing it:
  12. with the default provider=ollama that is the local Ollama host and nothing leaves the
  13. machine, but provider=openai without an explicit base_url falls back to
  14. https://api.siliconflow.cn/v1 (remote); set base_url, or stay on ollama, to keep it local.
  15. Also rewrites inbound user messages and outbound
  16. assistant replies, so transcript content differs from what you typed; placeholders are
  17. code-generated and may over-match (18-digit ID-card-shaped strings, names that collide with
  18. the public-entity allowlist); company names are matched greedily and a modifier such as
  19. 原北京某某有限公司 is absorbed into the placeholder; magnitude masking drops the numeric
  20. value and only fires on the configured trigger words, so a domain term absent from that list
  21. is left unmasked without warning; the placeholder mapping is held in memory only and never
  22. written to disk."
  23. maintainer: yubingz
  24. tier: community
  25. category: tools
  26. requires_hermes: ">=0.19"
  27. docs_url: https://github.com/yubingz/hermes-desensitize#readme
  28. version: "1.4.1"
  29. readme: true
  30. platforms: []
  31. capabilities:
  32. provides_tools: []
  33. provides_hooks:
  34. - pre_llm_call
  35. - pre_api_request
  36. - transform_llm_output
  37. - post_llm_call
  38. provides_middleware: []
  39. requires_env: []