Sigma Gate

io.github.spektre-labsPublished by GitHub account spektre-labsv1.0.0Updated Oct 24, 2026

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

VerifiedStreamable HTTPWeb executableSecurity & MonitoringAI & ML

Overview

AI-generated overview

A deterministic trust gate that checks AI output for leaked secrets, prompt injection and PII in one call and returns a ship-or-block verdict.

What you can do
  • Run a guard check on a piece of text and get back a safe-to-ship verdict, a severity level and named block reasons.
  • Detect leaked credentials across many providers, prompt-injection and jailbreak patterns, and PII such as email, phone, card numbers, SSN, IBAN and IP.
  • Run a self-test that proves each threat class fires and clean text passes.
  • Tune the blocking threshold through a severity setting.
When to use it
Useful when an assistant or agent produces text that will be shipped, published or passed downstream and you want a fast, repeatable check before releasing it. Suited to pipelines that need identical verdicts on identical input rather than a model-based judge.
Requirements
The hosted remote endpoint needs no setup, key or account. The local variant is a Python 3.9+ package with zero dependencies, run as a stdio MCP server; the README also mentions an optional threshold environment variable.
Before you install
The text you submit is sent to the remote endpoint for checking, so avoid sending content you would not share with a third party. The README mentions a separate hosted scoring service that is pay-per-call, which is not the same as this gate; do not confuse the two.

Installation

In SourceWeft

  1. Open Sigma Gate in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Web executable via Streamable HTTP. Remote servers run from the web runtime once configured in a workspace.

Use with an agent

Paste this prompt into Claude Code, Codex, Cursor or another agent — or into SourceWeft chat. The agent reads this server's install guide, shows you its publisher, endpoint and sign-in, and adds it to your client once you agree. Keys never go into a command.

Read https://sourceweft.com/mcp/io.github.spektre-labs%2Fsigma-gate/install.md and connect the MCP server it describes to my client. Before changing any config, show me its publisher, endpoint and sign-in method and wait for my OK. Never put an API key in a command or in a file I would commit; ask me where it should come from.

Read the install guide the agent follows

Other MCP clients

Add this to your client's mcpServers config.

{
  "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.

Source: README.md at commit f09e78f

Tools

0
SourceWeft has not read this server's tools yet.

Version history

1
  1. v1.0.0LatestSep 16, 2026

Score

85% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 daysRequired25 pts
  • Auth declaredRequired10 pts
  • Tools listedRequired15 pts

    Answer tools/list without a credential, or ship a package that starts in a sandbox without one.

  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts