Repository navigation
Releases
Mobius Guard v0.3.1
- Container images on GitHub's registry, published by each release from 0.3.1:
ghcr.io/gantrly/mobius-guard:VERSION(the proxy) and:VERSION-onnx(with onnxruntime
for Fortress-XS or Fortress-Base), each with build provenance and an SBOM
(deploy.md). - Fortress-Base against other detectors
(results): on the final halves,
next to Fortress-XS, PIGuard, ProtectAI v2, Horizon-Labs guard-base and keyword rules.
Fortress-Base catches the most injections inside emails (68.5%) and documents (70.5%)
among the detectors that did not train on them, blocks 6.0% of real developer messages
and at most 3.4% of harmless disguised text. The README, the model cards and this page
show one comparison for both Fortress models. - Corrected: Fortress-XS's comparison. PIGuard trained on BIPIA's training split (it is
in PIGuard's published training set), so its BIPIA score is marked and the averages use
the 8 families none of the detectors trained on: Fortress-XS 72.3%, PIGuard 42.9%,
ProtectAI v2 32.3% (previously 66.0%, 44.1% and 28.8% over 9). "Level with PIGuard on
the non-obfuscated families" no longer holds: on the three plain families none trained
on, ProtectAI v2 leads. - Evaluation:
horizon-guard-baseas a comparison-only detector, run in 2,048-token
windows as its card says;scripts/release_charts.py --basefor Fortress-Base's charts,
with trained-on sets marked;docs/datasets.mdlists what each compared detector
trained on. - Demo: the in-browser demo runs Fortress-Base as well as Fortress-XS, with the text's
role (a user's message, or a document or tool output) as Mobius Guard passes it.
Install
pip install mobiusguard==0.3.1 # the proxy
pip install mobiusguard-redact==0.3.1 # the streaming redactor on its ownThe wheels attached here are the ones on PyPI; check where they were built with
gh attestation verify <file> -R gantrly/mobius-guard.
What's Changed
Features
- Container images on each release; Fortress-Base in the demo; scores in the model cards by @imtiaj-007 in #42
Documentation
- Docs for 0.3: Fortress-Base and red-teaming everywhere by @imtiaj-007 in #39
- Fortress-Base against other detectors; Fortress-XS comparison corrected by @imtiaj-007 in #40
- One comparison for both Fortress models by @imtiaj-007 in #41
Dependencies
- Bump transformers, regex, boto3, sentencepiece, hypothesis and ruff by @imtiaj-007 in #37
- Bump the actions group across 1 directory with 5 updates by @dependabot[bot] in #34
- Bump astral-sh/uv from 0.13.7 to 0.13.10 by @dependabot[bot] in #32
Full Changelog: v0.3.0...v0.3.1
Mobius Guard v0.3.0
- Fortress-Base (model card,
decision 0024): a larger, opt-in classifier
(DeBERTa-v3-base) next to Fortress-XS, for documents, email and developer traffic:
classifier = "fortress-base", pinned at its Hugging Face commit. On held-out data it
catches 68.5% of LLMail-Inject (Fortress-XS 47.4%) and 70.5% of BIPIA inside documents
(12.9%), at 2.9× the CPU time (525 ms at 512 tokens). Fortress-XS stays the default.
The proxy reads each text with its role in front ([user]or[tool]) for a model whose
fortress.jsonasks for it (decision 0020), and
takes the tool-result threshold from that file. - Evaluation: distillation (decision 0022):
teacher-scoreswrites a teacher's logits for every training item and extra text, and
train --teacher-scores --alpha --temperature --extra-traintrains a student on labels
and the teacher's soft targets. - Evaluation:
export --quantize int8-ffn2-floatkeeps each layer's second feed-forward
MatMul and the activation-by-activation MatMuls in float32. Plain INT8 broke
DeBERTa-v3-base (correlation 0.92 with PyTorch); this agrees at 0.999. The default,
int8, is unchanged. - Evaluation:
model-metawrites a released model'sfortress.jsonfrom its score
runs: thresholds per role and per view at 0.1%, 1% and 5% false positives, with the
unreliable ones listed. - Evaluation: 95% intervals by unit (decision 0023):
metrics.jsonaddsci95_units, a bootstrap over attacks or near-duplicate clusters, and
the gate uses it. Rows that share an attack no longer count as independent. Sets of
independent rows are unchanged. - Evaluation: larger held-out sets (decision 0021):
llmail_full(all of LLMail phase 2),bipia_embedded(BIPIA's test attacks inside its
documents) andwildchat_dev_test(real developer messages), andtrain --base deberta-v3-base --micro-batch Nfor a larger teacher on a 24 GB GPU. - Red-teaming (
mobiusguard-eval redteam, guide,
decision 0014): attack a configuration with
garak's prompt-injection probes in 26 mutated forms, each as a user message and as a
tool result; resumable runs with one row per attempt and no attack text; findings
grouped by near-duplicate cluster and mutation; a sealed holdout; and a gate that
refuses a patch which blocks more harmless text.run,summary,findings,seal,
verify-holdout,gate. - Adaptive attacks (
mobiusguard-eval redteam adapt, decision 0016):
PyRIT's PAIR rewrites each prompt up to 10 times, guided by the guard's verdict and
score, against one or more configs; a second model judges whether a rewrite that got
through still asks for the same thing. Prompts from the sealed holdout are refused; runs
resume; reports carry counts only (adapt-summary). - Fortress-XS scores every view of a text (decision 0015):
the normalised text and decoded base64 as well as the original, as the rules already did,
so look-alike letters, invisible characters and spaced-out letters hide less from it. Its
attack threshold for this is 3.1107, set on the same ordinary messages as its own 2.7634,
so it blocks no more of them. A text with a second view costs one more classifier call.
On the red team's sealed holdout, 20.6% of attempts got through instead of 25.4%, but
leetspeak alone and injections inside documents got through more often
(results).
policy.classifier_views = "original"keeps the old behaviour. - Input normalisation catches three more disguises (found by the first red-team run):
invisible characters hidden between spaced-out letters, base64 whose text hides
invisible characters, and base64 runs spaced out, given look-alike letters or invisible
characters after encoding. Rules now see the hidden text; harmless text is unchanged. mobiusguard-eval[pyrit]: PyRIT's prompt converters as extra mutations, limited to
ones that turn text into text and call no model or service.examples/ollama-fortress.toml: the local-model example with Fortress-XS on.scripts/live_check.pycan send held-out emails (LIVE_ITEMS) and time the proxy
(LIVE_OVERHEAD). Results with Fortress-XS:
the proxy adds about 9 ms, and Fortress-XS blocks some harmless developer-style messages
(keys, databases, tokens, tool calls), now listed in its model card's limits.- Fortress-XS v1 blocks most harmless text written in a disguise. Measured 2026-11-24
on 1,000 harmless messages: 94% are blocked once spaced out letter by letter, 79% in
leetspeak and 17% with invisible characters. It caught spaced-out attacks by blocking
everything spaced, not by reading them
(results). Fortress-Base blocks
3–3.4% of the same kinds of text
(decision 0017). - Harness, for training and gating Fortress models
(decision 0017):augment: disguised training copies of attack and harmless items at the same rate,
and group weights;extend-suite: harmless disguised test sets and the developer messages added to a copy
of the suite;gate: pass or fail of a candidate model against a baseline;local-views:DIR: scores a trained model on every view of a text, as the proxy does.- Training reads a per-item loss weight.
policy.classifier_long = "windows"(off by default,
decision 0018): a text over 512 tokens
is scored in overlapping windows, and the highest score counts, so an injection near the
end of a long document is seen. Each extra window costs one more classifier call. It stays
off until its effect on false positives is measured.policy.classifier_threshold_tool: an attack threshold for tool results. The same words
are a request when the user writes them and an injection inside a document, so a
document can be judged against a threshold set on harmless documents. Unset, tool results
use the same threshold as before.scripts/dev_check.py: scores the eight developer messages of the 2026-11-07 live check
with any Fortress model or export.
Install
pip install mobiusguard==0.3.0 # the proxy
pip install mobiusguard-redact==0.3.0 # the streaming redactor on its ownThe wheels attached here are the ones on PyPI; check where they were built with
gh attestation verify <file> -R gantrly/mobius-guard.
What's Changed
Detection and redaction
- Fortress-Base in the proxy, red-teaming and evaluation v4 (v0.3) by @imtiaj-007 in #35
Full Changelog: v0.2.0...v0.3.0
Mobius Guard v0.2.0
- Fortress-XS, Mobius Guard's own classifier. An 81 MB INT8 ONNX model
(gantrly/fortress-xs, Apache-2.0) with two
outputs: attack (prompt injection and jailbreaks, also inside documents and tool results)
and harmful (requests for harmful content). At 1% false positives on ordinary messages it
catches 66% of attacks on average over 9 held-out families, against PIGuard's 44% and
ProtectAI v2's 29%. It takes 183 ms at 512 tokens on 4 CPU threads, where they take
1,151 ms. Weak spots, published with it: plain-language indirect injection (BIPIA 15%)
and harmless prompts that only sound harmful (the harmful output flags 48% of them).
Results. - A demo that runs in your browser:
huggingface.co/spaces/gantrly/fortress-xs.
It uses the same INT8 file with onnxruntime-web, so text never leaves the page. pip install "mobiusguard[onnx]"andclassifier = "fortress-xs": onnxruntime and
tokenizers, no torch. The model downloads at a pinned commit, or loads from
classifier_dirfor offline installs.- New policy settings:
classifier_action(block or log): the attack output blocks at the model's own
threshold by default;harmful(block, log or off): log by default;harmful_threshold.- A threshold in the config still wins.
- PIGuard and ProtectAI v2 behave as before: scores are logged until
classifier_thresholdis set.
- Each checked text is scored on its own, so a text always gets the same score. The INT8
model quantizes a batch as a whole, so a text's score could move by up to 0.55 with the
other texts of the same request. - The audit log, spans and
mobiusguard checkadd the harmful score (harmful) and
flagged: the scores over a threshold, including those that only log. mobiusguard-evaltrains and exports the classifier:train-databuilds the training set from 24 licensed sources, with suite-overlap
filters, contrast pairs and twins kept in one split;judgecleans labels with two LLM judges and per-source rules;trainfine-tunes with resume points;exportwrites ONNX and INT8 with a parity gate.- The suite adds XSTest unsafe and OR-Bench toxic as harmful-request families.
score --limittakes a random subset, not the first items.
- The README and the proxy's PyPI page linked to a private repository; they now link to
the Gantrly organisation.
Install
pip install mobiusguard==0.2.0 # the proxy
pip install mobiusguard-redact==0.2.0 # the streaming redactor on its ownThe wheels attached here are the ones on PyPI; check where they were built with
gh attestation verify <file> -R gantrly/mobius-guard.
What's Changed
Detection and redaction
- Fortress-XS: Mobius Guard's own classifier, in the proxy (v0.2) by @imtiaj-007 in #24
Full Changelog: v0.1.2...v0.2.0
Mobius Guard v0.1.2
- Fix: of two IBANs written in groups of four with only a space between them, the second
was not redacted; nor was the second of two such American Express numbers (#20). The
first number's match ran on into the second and was cut back to pass its check, but the
search then went on from inside the second number. It now goes on from the end of the
accepted number, in one-shot and streaming redaction alike. mobiusguardandmobiusguard-evalnow requiremobiusguard-redact>=0.1.2, so upgrading
the proxy brings this fix.- README: the PyPI badge reads the version from PyPI's JSON and is cached for 10 minutes;
the standard PyPI badge is cached for 6 hours, so it showed the old version after a release. - PyPI pages: fuller descriptions for all three packages (what each does, measured numbers,
links to the docs, changelog, security policy and releases), with sharper summaries,
keywords and classifiers.
Install
pip install mobiusguard==0.1.2 # the proxy
pip install mobiusguard-redact==0.1.2 # the streaming redactor on its ownThe wheels attached here are the ones on PyPI; check where they were built with
gh attestation verify <file> -R gantrly/mobius-guard.
What's Changed
Detection and redaction
- Redact the second of two numbers one space apart (#20); PyPI badge that updates by @imtiaj-007 in #22
Full Changelog: v0.1.1...v0.1.2
Mobius Guard v0.1.1
- SECURITY.md: response times, coordinated disclosure, safe harbour, scope and supported
versions. OpenSSF Best Practices badge in the README. servenames the upstream, not the variable, when a held key's variable is not set.- The redactor no longer rescans all the held text on every chunk while a possible secret
is open, such as a private key whose END line hasn't arrived yet. Each pattern resumes
where its last scan left off. With 6,000–8,000 characters held, a chunk takes 3.5 ms
instead of 66 ms with all patterns (#17). The output is unchanged. - The benchmark measures this case:
benchmarks/redact_stream.py --held. mobiusguardandmobiusguard-evalnow requiremobiusguard-redact>=0.1.1, so upgrading
the proxy brings this fix.- Dependencies in the lockfile updated to their latest releases; no known
vulnerabilities. - Releases: each GitHub release also carries its build provenance as files, a Sigstore
bundle and an in-toto envelope, so a download can be checked offline
(gh attestation verify <file> --bundle …). The provenance now covers only the wheels
and sdists (0.1.0's also listed a stray.gitignore). Uploads use
pypa/gh-action-pypi-publish, which adds PEP 740 attestations on PyPI. - A fuzz target for the redactor (
fuzz/redactor.py, Atheris), run on pull requests that
touch the redactor and weekly.
Install
pip install mobiusguard==0.1.1 # the proxy
pip install mobiusguard-redact==0.1.1 # the streaming redactor on its ownThe wheels attached here are the ones on PyPI; check where they were built with
gh attestation verify <file> -R gantrly/mobius-guard.
What's Changed
Security
- Security policy in full, Unreleased changelog, OpenSSF Best Practices badge by @imtiaj-007 in #15
Detection and redaction
- Redactor: resume scans while text is held (#17); release provenance files, fuzzing, dependency updates by @imtiaj-007 in #19
Features
- Faster CI: run the tests in parallel by @imtiaj-007 in #16
Dependencies
- Bump astral-sh/uv from 0.11.16 to 0.13.7 by @dependabot[bot] in #5
- Bump astral-sh/setup-uv from 7.6.0 to 10.3.3 in the actions group across 1 directory by @dependabot[bot] in #11
- Bump the dev-tools group across 1 directory with 3 updates by @dependabot[bot] in #13
Full Changelog: v0.1.0...v0.1.1
Mobius Guard v0.1.0
The first release.
mobiusguard-redact
- Streaming redaction: secrets and personal data are rewritten in text that arrives in
chunks, with the same output however the text is split (property-tested at every split
point), about one word of delay, and at most 8,192 characters held back. - 24 curated patterns (API keys and tokens, private keys, connection-string passwords,
bearer tokens, emails, payment cards with Luhn, IBAN with mod-97, US SSN, Aadhaar with
Verhoeff, PAN, international phone numbers) and all 221 gitleaks v8.30.1 rules with their
entropy, allowlist and keyword checks. - Private keys: the block ends at its END line, so the text after a key flows on at once;
a key cut off before its END line (a model reaching its token limit) is still redacted. - gitleaks' curl rules follow a command onto the next line only after a continuation
character, so the lines after the word "curl" are no longer held back. - Tolerates the ways models garble what they echo: tokens a few characters longer or
shorter (Stripe keys too), values wrapped in quotes or markdown, passwords in URLs without a host. - Keyword prefilter: 177 gitleaks rules run only where one of their keywords is present or
arriving (same output, checked on every public text in the evaluation).
mobiusguard
- Proxy for OpenAI Chat Completions, OpenAI Responses and Anthropic Messages, streamed or
not, in front of any compatible upstream. - Request check on user messages and tool results: normalisation (invisible characters,
look-alike letters, spaced-out letters, leetspeak, base64), eight named rules with
severities, an optional PIGuard or ProtectAI v2 classifier, and a policy that blocks with
HTTP 403 in each API's own error format. Fails closed. - Streaming redaction of replies and tool-call arguments, per choice, output item and
content block. - Audit log (one JSON line per request, no prompt text by default) and OpenTelemetry spans.
- Forwarded or held API keys, with client tokens; start-up warnings for risky key settings.
mobiusguard serve,mobiusguard check, and a container image.
mobiusguard-eval
- Provenance ledger of 11 pinned public datasets with licences and known training use.
- Suite builder with near-duplicate clusters and five obfuscation families; recall at a
fixed false-positive rate from thresholds set on ordinary traffic, AUC, Wilson intervals
and CPU latency. - Baselines: keyword rules, TF-IDF trained leave-one-source-out, ProtectAI v2, PIGuard.
- Redactor evaluation: firing rates on public text, synthetic and garbled secrets in real
messages, near misses. - Every step checkpointed;
mobiusguard-eval pipelineresumes where it stopped.
Install
pip install mobiusguard==0.1.0 # the proxy
pip install mobiusguard-redact==0.1.0 # the streaming redactor on its ownThe wheels attached here are the ones on PyPI; check where they were built with
gh attestation verify <file> -R gantrly/mobius-guard.
What's Changed
Security
- GitHub: CodeQL, Scorecard, DCO check, pinned actions, release with provenance by @imtiaj-007 in #4
Features
- Release on merge: tag a ready version automatically by @imtiaj-007 in #14
Documentation
- Release 0.1.0 by @imtiaj-007 in #12
Dependencies
- Bump actions/checkout from 5 to 7 by @dependabot[bot] in #1
- Bump astral-sh/setup-uv from 6 to 7 by @dependabot[bot] in #2
- Update hatchling requirement from >=1.26 to >=1.32.4 in the dev-tools group across 1 directory by @dependabot[bot] in #3
New Contributors
- @dependabot[bot] made their first contribution in #1
- @imtiaj-007 made their first contribution in #4
Full Changelog: https://github.com/gantrly/mobius-guard/commits/v0.1.0