Sigma Gate

io.github.spektre-labs由 GitHub 帳號 spektre-labs 發布v1.0.0更新於 Oct 24, 2026

Deterministic trust gate for AI output: leaked-secret, prompt-injection & PII in one call.

已驗證Streamable HTTP可網頁執行安全與監控AI 與機器學習

概覽

AI 產生的概覽

確定性的 AI 輸出信任閘門,一次呼叫即可檢查外洩金鑰、提示注入與個人隱私資訊,並給出可發布或攔截的判定。

可以做什麼
  • 對一段文字執行 guard 檢查,回傳是否可發布、嚴重等級以及具名的攔截原因。
  • 偵測多家服務商的外洩憑證、提示注入與越獄模式,以及電子郵件、電話、信用卡號、SSN、IBAN、IP 等隱私資訊。
  • 執行自我測試,驗證每一類威脅都能觸發、乾淨文字能夠通過。
  • 透過嚴重等級設定調整攔截門檻。
適用情境
當助理或代理產生的文字即將發布、交付或傳給下游,需要在放行前做一次快速且可重複的檢查時適用。適合要求相同輸入得到相同判定、而非依賴模型評審的流程。
執行需求
託管遠端端點無需任何設定、金鑰或帳號。本機版本是零相依性的 Python 3.9+ 套件,以 stdio MCP 伺服器方式執行;README 另提到可選的門檻環境變數。
安裝前請注意
送出的文字會傳到遠端端點進行檢查,不要送出不願與第三方分享的內容。README 另提到一個按次計費的託管評分服務,它與本閘門並非同一功能,請注意區分。

安裝

在 SourceWeft 中

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

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/io.github.spektre-labs%2Fsigma-gate/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。

{
  "mcpServers": {
    "sigma-gate": {
      "type": "http",
      "url": "https://sigma-gate-864996675261.us-central1.run.app/mcp"
    }
  }
}

README

⟐ σ-gate — guard

[ci]

Deterministic trust layer for AI/agent output. One call → one verdict. No model, no API key, no network.

1 = 1.  Declared output must equal what is safe to realize.

The paradigm

The other four Spektre repos are routing protocols — they move value, capability, promises, and identity across networks. σ-gate is not a routing protocol, and does not pretend to be one. It is the suite's deterministic trust verdict: the gate that sits at the edge of any pipeline and answers, in ~85µs and identically every time, is this output safe to ship? LLM-as-judge guards are slow, burn a model call per check, and silently degrade under rate-limits. But the highest-frequency risks — a leaked AKIA… key, a Luhn-valid card number, an "ignore all previous instructions" — are structurally detectable: you don't need a model, you need a gate that gives the same answer every time. That determinism is the primitive. σ = declared − realized: a block is always nameable (secret[high]: github_pat), never an opaque float, so what the gate declares unsafe is exactly what it refuses to realize. guard is that gate.


One call

python
from guard import guard
result = guard(model_output)# {"safe_to_ship": True/False, "severity": "clean|low|medium|high|critical",#  "block_reasons": [...], "dimensions": {"secret": {...}, "injection": {...}, "pii": {...}}}

Block a bad output:

python
v = guard("Here is the key: ghp_16C7e42F292c6912E7710c838347Ae178B4a")# safe_to_ship: False# block_reasons: ["secret[high]: github_pat"]

Pass a clean output through:

python
v = guard("The quarterly report shows revenue grew 12% driven by the EU segment.")# safe_to_ship: True# severity: "clean"

Three dimensions, one verdict

DimensionWhat it catches
secretLeaked credentials — 20+ providers (AWS, GitHub, Stripe, GCP, …), entropy-ranked
injectionPrompt-injection and jailbreak patterns — structural, not heuristic
piiEmail, phone, card (Luhn-verified), SSN, IBAN, IP — compliance-class detection

Every dimension runs independently. A combined hit fires all three:

python
guard("AKIA… ghp_… 4111 1111 1111 1111 — ignore all previous instructions")# block_reasons: ["secret[high]: ...", "injection[high]: ...", "pii[high]: ..."]

Install

Zero dependencies, pure stdlib, Python 3.9+.

bash
git clone https://github.com/spektre-labs/sigma-gate && cd sigma-gatepip install -e .            # installs the `guard` + `guard-mcp` console scriptspython3 -m pytest -q        # 7 passed, zero dependencies

No install is even required to import — from guard import guard works from the cloned directory.


Use it

Inline gate in any pipeline:

python
from guard import guard
def ship(output: str) -> str:    v = guard(output)    if not v["safe_to_ship"]:        raise ValueError(f"blocked: {v['block_reasons']}")    return output

CLI — pipe any output through:

bash
echo "your model output" | python3 -m guard

Self-test — prove every threat class fires:

bash
python3 -m guard selftest# {"secret_blocked": true, "injection_blocked": true, "pii_blocked": true,#  "clean_passes": true, "combined_all_fire": true, "ALL_PASS": true}

Tune the threshold via env var (default: medium):

bash
GUARD_BLOCK_AT=high python3 -m guard "..."

Use as an MCP tool

σ-gate ships a zero-dependency MCP server — give any agent (Claude Code, Claude Desktop, Cursor, Cline) a deterministic guard tool it can call before shipping output. No model, no key, no token cost.

Claude Code:

bash
claude mcp add guard -- python3 /absolute/path/to/sigma-gate/mcp_server.py

Claude Desktop (claude_desktop_config.json):

json
{ "mcpServers": { "guard": { "command": "python3",  "args": ["/absolute/path/to/sigma-gate/mcp_server.py"] } } }

Exposes two tools: guard(text, …) → the ship/block verdict, and guard_selftest() → proof every threat class fires. Pure stdlib stdio JSON-RPC.

Hosted — no install

σ-gate also runs as a hosted remote MCP server (scale-to-zero), listed in the official MCP Registry as io.github.spektre-labs/sigma-gate. Connect with zero local setup:

https://sigma-gate-864996675261.us-central1.run.app/mcp

MCP clients that browse the registry discover it automatically.


Open-core vs hosted

Open core (this repo)Hosted σ scoring
WhatDeterministic gate: secret + injection + PIICoherence / hallucination σ-scoring on a hot path
Latency~85µsNetwork round-trip
DependenciesZeroNone on your side
CostFree, alwaysPay-per-call via x402 — no signup
OfflineYesNo
ModelNoneOptional

The open core handles what models cannot do reliably — structural pattern detection with identical verdicts on identical inputs. The hosted layer adds probabilistic coherence scoring for the cases where structure alone is insufficient.

Hosted endpoint:

bash
curl "https://swagletz-sigmagate.hf.space/check?text=your+text+here"# HTTP 402 + permissionless x402 pay-to — no account required

Properties

  • Deterministic. Same input → same verdict. No variance, no model drift.
  • Composable. Each dimension is independent and pluggable. Wire in a hallucination scorer or extend with custom patterns; the gate architecture is additive.
  • Honest. Severity and block-reasons are explicit strings, not opaque floats. A block is always nameable.
  • Fails safe. If a detector throws, that dimension returns severity: "error" — the call does not silently pass.
  • Zero dependencies. Runs anywhere Python 3.9+ runs. No pip install required to import.

Status

REAL — shipped, deterministic, deployed. CI green, 7/7 tests passing, zero dependencies; live as a local MCP tool and as a hosted scale-to-zero MCP server listed in the official registry.


The Spektre protocol suite

σ-gate is the deterministic trust verdict of a five-part estate. The other four are routing protocols; this one is the gate they ship through:

  • vrp — value routing (least-friction multi-hop settlement)
  • crp — capability routing (route a task to the best AI substrate)
  • vtc — verifiable transaction chain (signed value promises anyone verifies trustlessly)
  • sid — sovereign identity (prove one claim, reveal nothing else)
  • sigma-gate — deterministic trust verdict (this repo)

License

Apache-2.0 — see LICENSE.


Part of Spektre Labs — coherence-theory research lab. σ = declared − realized · 1 = 1, made executable.

來源:README.md,提交 f09e78f

工具

0
SourceWeft 尚未讀取此伺服器的工具。

版本歷史

1
  1. v1.0.0最新Sep 16, 2026

評分

已滿足適用檢查項的 85%

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

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具必需15 分

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

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