Open-source framework for AI-layer security testing — finds AI-agent weaknesses and writes the regression tests that close them.
Project description
Mylonite
Point it at your AI agent; it finds a real weakness and writes the regression test that closes it forever — in your repo, gating your CI.
Mylonite is an open-source framework for AI-layer security testing. It targets the AI/agentic part of an application — the system prompt, tools, RAG pipeline, agent planner — and emits validated regression tests that gate CI. It deliberately does not test the surrounding traditional code; that work belongs to SAST/DAST tools.
See ROADMAP.md for the architecture, scope, and direction, and the documentation site for guides and reference.
Status: the full
scan → generate → validate → gatepipeline works end to end, against the bundled Quarry twins and your own MCP app (--target-file). v0.6.0 shipped thescan → gating PRflow (mylonite gate+ a reusable GitHub Action); v0.7.0–0.7.2 added the control-efficacy oracle (which safeguard is load-bearing), differential-by-default on real targets, gating metamorphic robustness, SARIF / GitHub code scanning, and proven-fix diffs in the PR. v0.7.3 adds stateful memory-poisoning (scan --memory), cross-model durability (validate --models), and a machine-readable JSON bundle (report --json). See CHANGELOG.md.pip install myloniteinstalls the CLI from PyPI; the Quarry demo target (mcp-kitchen-sink) is not yet published, so the offline demo walkthrough is still clone-first.
Try it in 60 seconds
(Once installed.) The real zero-second funnel is the GIF — watch Mylonite find four exploits against a deliberately vulnerable agent, offline, with no API key:
The mylonite demo playground running against the Quarry and its guarded
twin. (How this GIF is recorded.)
Install the CLI — mylonite is on PyPI:
pip install mylonite
The mylonite demo walkthrough below also needs the Quarry's
deliberately-vulnerable agent (mcp-kitchen-sink), which is not published —
so the demo is still clone-first with two editable installs. Requires
Python 3.11–3.13 — litellm (the model-agnostic LLM layer) has no 3.14
wheels yet, so create your virtualenv with a 3.11–3.13 interpreter. The CLI
prints a clear note if it detects 3.14+.
git clone https://github.com/Abidemialade/mylonite.git
cd mylonite
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
pip install -e ./reference_targets/mcp_kitchen_sink
mylonite demo
git clone https://github.com/Abidemialade/mylonite.git
cd mylonite
python -m venv .venv
.venv\Scripts\Activate.ps1
pip install -e ".[dev]"
pip install -e ./reference_targets/mcp_kitchen_sink
mylonite demo
No API key needed — the demo replays recorded model behavior; add
--live to re-run for real.
The demo runs the real scan twice — once against the deliberately vulnerable reference agent ("the Quarry") and once against its guarded twin — and prints a safety banner, a weakness table, and the headline result:
SAFETY: in-process, loopback-only, no network egress.
W1 Tool-description smuggling OWASP LLM01 · ASI01 · AML.T...
W2 Poisoned-note → action OWASP LLM01 · ASI02 · AML.T...
W3 Unrestricted web_fetch OWASP LLM06 · ASI02 · AML.T...
W4 Unconfirmed send_email OWASP LLM06 · ASI05 · AML.T...
4 exploits on vulnerable, 0 on guarded
mode: replay (offline)
The Quarry runs entirely in-process and never binds to a network. Full walkthrough: docs/quarry.md.
Once you've seen it, point scan at a real target:
mylonite scan mcp:fetch --authorize fetch
(needs an LLM API key + uv installed)
From scan to a gating PR
mylonite gate runs the whole magic moment — find an exploit, write a regression
test, validate it against the differential oracle, and (opt-in) open a PR that
gates CI on it:
mylonite gate reference:vulnerable # find -> test -> validate -> print the PR command
mylonite gate --target-file target.yaml --authorize your-scope --open-pr # ...and open it
gate writes a validated regression test under .mylonite/gate/ plus two CI
workflows (a cheap per-PR gate + nightly discovery), then prints (or, with
--open-pr, opens) a PR carrying the finding, its OWASP/ASI/ATLAS/NIST tags, the
validation evidence, and a human-applied suggested fix. Full guide:
docs/ci-gating.md. Behind a corporate network, see
docs/enterprise-networking.md.
What works today (v0.7.3)
mylonite gate <target>— the end-to-end magic moment: scan → generate → validate → optionally open a gating PR. Writes the regression test and two CI workflow templates under.mylonite/gate/. Add--open-prto push a branch and open the PR viagh. Use--target-file target.yamlfor a custom MCP app.mylonite scan <target>— the async exploit-finding loop. Targets:reference:vulnerable/reference:guarded(the bundled Quarry twins), plus real open-source MCP servers —mcp:filesystem:<sandbox>,mcp:fetch, andmcp:github:<owner/repo>(these need an LLM API key,uv/uvx, and an explicit--authorize). Custom MCP apps: pass--target-file target.yaml --authorize <scope>. Depth modes:--adaptive(a strategist refines the injection until it lands),--synthesize(tool-chaining to a sink; works on--target-filetoo), and--memory(stateful cross-turn memory poisoning — the "zombie agent" shape).mylonite generate [SCAN_PATH]— emit apytestregression test from a confirmed exploit (offline, no LLM). Pass--latestto auto-pick the newest scan, or--target-filewhen the scan was against a custom target. Emitted tests carry OWASP/ASI/ATLAS/NIST tags (NIST auto-derived) and the attack tier.mylonite validate <generated-dir>— run the differential-oracle validator live (real LLM, Haiku) to prove the test is meaningful: it must fail on the vulnerable twin and pass on the guarded one across a flakiness filter and survive the gating metamorphic rewrites. Pass--target-filefor custom targets (re-drives the real app);--fastskips the differential leg for a faster, weaker gate. The control-efficacy oracle runs by default on a real target — it holds the model constant and proves the control, not the model, carries the security (a synthetic guarded twin); add--adaptiveto grade whether it holds under an adaptive attacker.mylonite validate --models a,b,c— cross-model durability: re-prove the differential across model versions and flag any where the weakness re-emerges, so a fix doesn't silently break on a model upgrade.mylonite ablate <target>— the control-ablation matrix: scores each safeguard's marginal contribution (load-bearing vs. security-theater), with--redundancyto find controls another control already covers and--max-seedsto probe multiple seeds per weakness.mylonite report <dir>— render a scan/validation as a terminal trust panel, a self-contained HTML dashboard (--html), SARIF 2.1.0 for GitHub code scanning (--sarif), or a machine-readable JSON bundle (--json) for dashboards/SIEM — all carrying the differential proof and the OWASP/ASI/ATLAS/NIST tags.mylonite demo— zero-config, offline, deterministic playground that replays committed LLM fixtures to find four exploits on the Quarry and none on its guarded twin.--livere-runs for real (needs a key).mylonite doctor— diagnose provider connectivity before a live scan; classifies failures as auth / TLS / network / rate-limit with a concrete remedy.mylonite init-target— scaffold atarget.yamlfor a custom MCP app by launching it once (no LLM call), listing its tools, and writing a commented starter with suggestedweakness_classes,seed_arm, andeffect_probetemplate.mylonite taxonomy list— the bundled threat taxonomy: OWASP LLM Top 10 (2025), OWASP Agentic Security Initiative (2026), MITRE ATLAS, and NIST AI RMF, all as data files with provenance.- Custom MCP targets via
--target-file— declare your MCP server'scommand,weakness_classes,seed_arm, andeffect_probein a YAML file; Mylonite drives indirect injection and validates effect end-to-end. - Versioned extension contracts + plugins — five Python Protocols (attack modules, target adapters, test generators, validators, compliance mappers) with reference implementations and entry-point-based plugin loading.
Documentation
Full docs site: abidemialade.github.io/mylonite
(or mkdocs serve from a checkout). Highlights:
- Quickstart · Test your own app — install and point it at your MCP server.
- Weakness classes · Attack modes — what's tested and how attacks work.
- The validation engine — the differential oracle (the moat).
- Reading the results · CLI reference · target.yaml.
- CI gating · Architecture · Plugin authoring.
- ROADMAP.md · CONTRIBUTING.md · GOVERNANCE.md · SECURITY.md.
Responsible use
Mylonite reproduces working weaknesses in AI agents. Use it only against
targets you control or are contractually authorized to test. The scan
command refuses to run against real targets without an explicit --authorize
flag naming the target. The bundled vulnerable reference agent runs
in-process and binds to nothing.
Full policy: SECURITY.md.
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mylonite-0.7.3.tar.gz.
File metadata
- Download URL: mylonite-0.7.3.tar.gz
- Upload date:
- Size: 327.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cfaa4a4d119771f37006805fa09bc751e3889d20115f3af73bc9d8ee4b9c0095
|
|
| MD5 |
7d5b358cb165bdab356a305a75a5a885
|
|
| BLAKE2b-256 |
e8ed6f19aaf075321418848b4aa1808d4e2fa63d60abee55d714f45fa0847abd
|
Provenance
The following attestation bundles were made for mylonite-0.7.3.tar.gz:
Publisher:
release.yml on Abidemialade/mylonite
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mylonite-0.7.3.tar.gz -
Subject digest:
cfaa4a4d119771f37006805fa09bc751e3889d20115f3af73bc9d8ee4b9c0095 - Sigstore transparency entry: 1912331352
- Sigstore integration time:
-
Permalink:
Abidemialade/mylonite@4b0dd8bc9be4a846040a680709b154639f918c96 -
Branch / Tag:
refs/tags/v0.7.3 - Owner: https://github.com/Abidemialade
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@4b0dd8bc9be4a846040a680709b154639f918c96 -
Trigger Event:
push
-
Statement type:
File details
Details for the file mylonite-0.7.3-py3-none-any.whl.
File metadata
- Download URL: mylonite-0.7.3-py3-none-any.whl
- Upload date:
- Size: 360.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
182c18c14839ff012b32421273bcccbffa372882bdcc372276aa75d19e8f2e53
|
|
| MD5 |
6cd448d5e4091927d7303fc05e157ae7
|
|
| BLAKE2b-256 |
f960c5cfb96aaa3fe7f20a52df555c2c35ac6cd633640f3151babd748121ddc5
|
Provenance
The following attestation bundles were made for mylonite-0.7.3-py3-none-any.whl:
Publisher:
release.yml on Abidemialade/mylonite
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mylonite-0.7.3-py3-none-any.whl -
Subject digest:
182c18c14839ff012b32421273bcccbffa372882bdcc372276aa75d19e8f2e53 - Sigstore transparency entry: 1912331477
- Sigstore integration time:
-
Permalink:
Abidemialade/mylonite@4b0dd8bc9be4a846040a680709b154639f918c96 -
Branch / Tag:
refs/tags/v0.7.3 - Owner: https://github.com/Abidemialade
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@4b0dd8bc9be4a846040a680709b154639f918c96 -
Trigger Event:
push
-
Statement type: