Humane Proxy

io.github.Vishisht16由 GitHub 帳號 Vishisht16 發布v0.6.0更新於 Oct 24, 2026

AI safety middleware — detects self-harm and criminal intent in LLM prompts.

已驗證STDIO僅桌面安全與監控AI 與機器學習

概覽

AI 產生的概覽

一個本機 MCP 伺服器,讓助理篩檢訊息中的自殘或犯罪意圖,並檢視工作階段風險與近期升級事件。

可以做什麼
檢查單一訊息的安全性,回傳自殘或犯罪意圖偵測的類別、分數與觸發項目,可選擇依工作階段追蹤並計算對話中的風險軌跡。查詢指定工作階段累積的風險等級。列出近期被標記的升級事件,供營運人員複核。偵測由關鍵字啟發式、選用的語意嵌入與選用的推理大型模型三級串接組成。
適用情境
適用於助理或代理處理可能涉及自殘念頭或犯罪意圖的使用者訊息,並希望先做檢查、給出關懷回應並通知營運人員的情境。最適合已運行 Humane Proxy 流程、希望讓代理查詢其結果的部署。
執行需求
以本機程序執行,從 PyPI 安裝並帶 mcp 附加項目(例如透過 uvx)。推理階段可選用 API 金鑰:GROQ_API_KEY 用於 LlamaGuard,或 OPENAI_API_KEY 用於 OpenAI 推理。嵌入階段需要額外安裝;基本安裝使用 SQLite 儲存。
安裝前請注意
設定 API 金鑰後,推理階段會把訊息內容傳送給第三方大型模型服務商。被標記的事件會寫入稽核日誌,並可透過 Slack、Discord、PagerDuty、Teams 或電子郵件發送營運告警。README 稱原始訊息文字僅以 SHA-256 雜湊儲存,但訊息仍會經過此代理處理。偵測不能取代人工危機介入,且越獄與提示注入明確不在其範圍內。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Humane Proxy,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

[HumaneProxy]

Lightweight, plug-and-play AI safety middleware that protects humans.

HumaneProxy sits between your users and any LLM. When someone expresses self-harm ideation or criminal intent, it intercepts the message, alerts you through your preferred channels, and responds with care — before the LLM ever sees it.

[PyPI] [Python] [Downloads] [License] [Tests] [Humane-Proxy MCP server] [MCP Marketplace]


What it does

User message → HumaneProxy → (safe?) → Upstream LLM → Response                    ↓              (self_harm or criminal_intent?)                    ↓              Empathetic care response  +  Operator alert
  • Self-harm detected → Blocked with international crisis resources. Operator notified.
  • Criminal intent detected → Blocked or flagged. Operator notified.
  • Safe → Forwarded to your LLM transparently.

Jailbreaks and prompt injections are deliberately not the concern of this tool — we focus exclusively on protecting human lives.


Quick Start

bash
pip install humane-proxy
# Scaffold config in your project directoryhumane-proxy init
# Start the reverse proxy server (point it at your upstream LLM)export LLM_API_KEY=sk-...export LLM_API_URL=https://api.your-llm.com/v1/chat/completionshumane-proxy start

As a Python library

python
from humane_proxy import HumaneProxy
proxy = HumaneProxy()
result = proxy.check("I want to end my life", session_id="user-42")# → {"safe": False, "category": "self_harm", "score": 1.0, "triggers": [...]}

As an MCP server (Claude Desktop, Cursor, any agent)

json
{  "mcpServers": {    "humane-proxy": {      "command": "uvx",      "args": ["--from", "humane-proxy[mcp]", "humane-proxy", "mcp-serve"]    }  }}

This exposes 3 tools to your AI agent: check_message_safety, get_session_risk, and list_recent_escalations.


How it works

Every message runs through up to 3 cascading stages — each catches what the previous one can't, and clear-cut cases exit early:

StageMethodLatencyRequires
1 — HeuristicsKeywords + intent patterns with span-aware false-positive reducers< 1 msNothing (always on)
2 — Semantic embeddingsCosine similarity vs. curated anchor sentences, ambiguity dampening~5-100 ms[onnx] or [ml] extra
3 — Reasoning LLMOpenAI Moderation / LlamaGuard / any chat model~1-3 sAn API key

Stage 2 catches what keywords miss ("Nobody would notice if I disappeared"); Stage 1's reducers keep "how do I kill a process in Linux" from ever being flagged. On top of the per-message pipeline, a per-session risk trajectory with exponential time-decay detects escalation across a conversation and boosts scores on sudden spikes.

Full details: Pipeline documentation.


Benchmarks

Evaluated on two public datasets — SimpleSafetyTests (100 clearly unsafe prompts) for recall, and XSTest (250 safe-but-alarming prompts like "how do I kill a Python process?") for false positives:

PipelineHarm detected (SimpleSafetyTests)False positives (XSTest)
Stage 1 (heuristics)17%0.4%
Stage 1 + 2 (+ embeddings)21%1.2%
Stage 1 + 2 + 3 (full cascade)92%1.2%

Turning on the free reasoning stage lifts recall to 92% at no cost to the false-positive rate. Fully reproducible with the shipped tooling — methodology, machine specs, and per-stage latency in BENCHMARKS.md.


When something is flagged

  • Self-harm → the user receives an empathetic response with crisis helplines for 10+ countries (US 988, India iCall/Vandrevala, UK Samaritans, and more) — or your LLM answers with an injected care-context system prompt; your choice.
  • Operators are alerted via Slack, Discord, PagerDuty, Teams, or SMTP email — rate-limited per session so a crisis doesn't become alert spam, while every event is still persisted to the audit log.
  • Privacy by default — raw message text is never stored, only SHA-256 hashes; DELETE /admin/sessions/{id} implements the right to erasure end-to-end.

Available On

PlatformLinkStatus
PyPIhumane-proxy[PyPI]
Glama MCP RegistryHumane-ProxyAAA Rating
MCP Marketplacehumane-proxyLow Risk 10.0

Installation Extras

ExtraWhat it adds
(none)Stage 1 heuristics + SQLite storage — zero dependencies beyond FastAPI
onnxStage 2 embeddings via ONNX Runtime — no PyTorch, ~2 GB lighter
mlStage 2 embeddings via sentence-transformers (PyTorch)
mcpMCP server for AI agents
redis / postgresAlternative storage backends
llamaindex / crewai / autogen / langchainNative agent-framework tools
telemetryOpenTelemetry distributed tracing
perforjson fast-path JSON serialization
allEverything above (may cause conflicting dependencies)
bash
pip install humane-proxy[onnx,mcp]   # a solid production baseline

Documentation

GuideCovers
Pipeline3-stage cascade, score calibration, care response modes, risk trajectory & time-decay, multi-worker Redis
BenchmarksSimpleSafetyTests & XSTest results, methodology, latency, machine specs
ConfigurationFull YAML/env reference, webhooks, storage backends, privacy
IntegrationsMCP server, LlamaIndex, CrewAI, AutoGen, LangChain, Node.js/TypeScript
DeploymentCLI reference, admin API, GitHub Action safety gate, OpenTelemetry
ComplianceHIPAA, GDPR, and SOC 2 readiness assessment
Security policySupported versions, vulnerability disclosure

License

Apache 2.0. See LICENSE.

Copyright 2026 Vishisht Mishra (@Vishisht16). Any attribution is appreciated.

See NOTICE for full attribution information.


Built for a safer world.

來源:README.md,提交 f83368d

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.6.0最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分