Skip to main content

🛡️ MAS-Sentry-Toolkit

PyPI Python License OWASP CI codecov Downloads

Unified offensive-security toolkit for Multi-Agent Systems — from MQTT-based IoT swarms to MCP-driven LLM agents. Aligned with OWASP Top 10 for Agentic Applications (2026) and powered by ABFP behavioral fingerprinting.

Why MAS-Sentry

The MAS security landscape changed twice in 2024–2026:

  1. Anthropic's Model Context Protocol (MCP) became the de-facto standard for LLM agent tooling — and brought a fresh class of architectural vulnerabilities (STDIO RCE affecting 200K+ servers, tool poisoning, indirect prompt injection).
  2. OWASP released the Top 10 for Agentic Applications (Dec 2025) — formalising ASI01–ASI10 risks.

Existing tools cover either classical IoT messaging (MQTT/AMQP) or LLM-agent risks. MAS-Sentry covers both under one threat model.

What's inside

Module Targets Maps to
protocols/mqtt Mosquitto, EMQX, HiveMQ, VerneMQ IoT/Robotic MAS
protocols/amqp RabbitMQ, ActiveMQ Enterprise MAS
protocols/mcp Anthropic MCP servers (STDIO / HTTP+SSE / streamable HTTP) LLM agent tooling
protocols/a2a Google A2A inter-agent protocol Agent-to-agent comms
agents/abfp Any pub/sub agent Behavioral fingerprinting
agentic/asi01-10 LangChain / CrewAI / AutoGen / MCP hosts OWASP Agentic Top 10
threat_modeling All findings STRIDE + ASI + CWE + CVE refs
reporting All scans HTML / PDF / SARIF / JUnit / HackerOne preset

🔬 ABFP — Agent Behavioral Fingerprinting Protocol

The core research contribution. Builds a unique fingerprint per agent across five dimensions:

Dimension Measured
📡 Topic Graph Pub/sub topology and pattern
⏱️ Timing Cadence Inter-publish interval, latency, burst signature
📦 Payload Signature Size distribution, encoding, schema entropy
🔗 Interaction Graph Agent-to-agent communication direction and frequency
🧠 State Inference FSM state inferred from message sequence

Phases: passive learning → fingerprint build → active probing → anomaly scoring → STRIDE-mapped threat report.

Enables: rogue agent detection, impersonation attacks, privilege escalation detection, zero-day interaction-vuln discovery, forensic attribution without credentials.

OWASP Agentic Top 10 (2026) coverage

ID Risk Module
ASI01 Agent Goal Hijack agentic/goal_hijack
ASI02 Tool Misuse & Exploitation agentic/tool_misuse
ASI03 Identity & Privilege Abuse agentic/identity_abuse
ASI04 Memory Poisoning agentic/memory_poisoning
ASI05 Cascading Failure agentic/cascade
ASI06 Untraceable Actions agentic/action_audit
ASI07 Resource Exhaustion agentic/resource_exhaustion
ASI08 Supply Chain agentic/supply_chain
ASI09 Human-Agent Trust Exploit agentic/trust_exploit
ASI10 Rogue Agent agentic/rogue_agent (ties to ABFP)

Full mapping in THREAT_MODEL.md.

Quick start

pipx install mas-sentry-toolkit
mas-sentry doctor
mas-sentry mqtt scan --target 192.168.1.10
mas-sentry mcp scan --target stdio://./vuln-server --checks all
mas-sentry abfp scan --target mqtt://broker.lab --duration 60
mas-sentry agentic scan --target http://langchain-app.lab --asi all
mas-sentry a2a scan --target http://agent.lab
mas-sentry a2a mesh --manifest mesh.json

Run the included vulnerable lab:

docker compose -f lab/docker-compose.yml up -d
mas-sentry mqtt scan --target localhost:1883
mas-sentry mcp scan --target stdio://lab/vuln-mcp/server.py

⚖️ Legal & Scope

Active modules require explicit scope confirmation. Use only on assets you own or have written authorization to test. Designed for legal contexts: HackerOne / Bugcrowd / Intigriti / Immunefi programs and internal red-team engagements. See SECURITY.md.

The authors and MASec Lab LLC accept no liability for any misuse of this software or for damage arising from its use. Responsibility for operating within applicable laws and within an authorized scope rests solely with the user.

Heuristic findings

ABFP behavioral fingerprinting, impersonation and rogue-agent scoring are probabilistic signals derived from observed traffic. They may produce false positives and false negatives and do not constitute proof that an agent is or is not compromised. Treat scores as leads for human review, not verdicts. The software is provided "as is", without warranty, as set out in the AGPL-3.0 license.

License

GNU Affero General Public License v3.0 or later. The author retains copyright and may grant commercial licenses separately.

ABFP — Quick demo

# 1. Start the lab broker (Mosquitto + 3 sample agents)
docker compose -f lab/docker-compose.yml up -d

# 2. Run a 60-second ABFP passive scan (writes a behavioral baseline snapshot)
mas-sentry abfp scan --target mqtt://localhost:1883 --duration 60

# 3. Re-scan later against the baseline to flag topology drift and impersonation
mas-sentry abfp scan --target mqtt://localhost:1883 --duration 60 --baseline reports/abfp_snapshot.json

# 4. Open the generated HTML report
xdg-open reports/abfp.html

Output snapshot:

+-----------------------+-------+----------+
| Agent                 | Score | Severity |
+-----------------------+-------+----------+
| inferred_sensors      |   12  |  INFO    |
| factory_robot_r17     |   78  |  HIGH    |
+-----------------------+-------+----------+

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mas_sentry_toolkit-0.8.0.tar.gz (298.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mas_sentry_toolkit-0.8.0-py3-none-any.whl (181.8 kB view details)

Uploaded Python 3

File details

Details for the file mas_sentry_toolkit-0.8.0.tar.gz.

File metadata

  • Download URL: mas_sentry_toolkit-0.8.0.tar.gz
  • Upload date:
  • Size: 298.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for mas_sentry_toolkit-0.8.0.tar.gz
Algorithm Hash digest
SHA256 041e3e2e85fbdc2301826349a929b85981474fca9b2a52adc6f170c9448c6417
MD5 4037a45d99699ceaafc56c0a93fd6518
BLAKE2b-256 7dd5401565de6ce2d50b2808293f268c9ceec05533b0543fb8644427f0044477

See more details on using hashes here.

Provenance

The following attestation bundles were made for mas_sentry_toolkit-0.8.0.tar.gz:

Publisher: release.yml on evkir/mas-sentry-toolkit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mas_sentry_toolkit-0.8.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mas_sentry_toolkit-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 edd9baf339c15e0fed1b0ac9670a886a3b76965adce5c1795c0c95101dc4ce28
MD5 4a29508158aeaddcb8977044c1132ca1
BLAKE2b-256 a9bcecd8ef44a6a7ebf839e3dd81f27b1ba80e1ce5f5da8ae26db9667bc5766e

See more details on using hashes here.

Provenance

The following attestation bundles were made for mas_sentry_toolkit-0.8.0-py3-none-any.whl:

Publisher: release.yml on evkir/mas-sentry-toolkit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page