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 分