Skip to main content

MAS Framework

Secure multi-agent runtime:

  • Agents connect over gRPC + mTLS
  • Server owns all Redis access (routing, state, audit, policy)
  • Agents never touch Redis

Use Cases

  • Ship multi-agent systems without widening data access: enforce deny-by-default ACLs and mTLS identity per agent.
  • Meet security and compliance requirements with tamper-evident audit logs and explicit policy decisions.
  • Protect sensitive data in transit using DLP scanning with block/redact rules.
  • Reduce incident blast radius with centralized policy, rate limiting, and circuit breakers.
  • Support multi-team agent development without shared Redis credentials or direct data access.
  • Export distributed traces and metrics with OpenTelemetry for operational visibility.

Architecture

Agent (mTLS)  ─┐
Agent (mTLS)  ─┼─→  MAS Server (gRPC + mTLS)
Agent (mTLS)  ─┘        ├─ AuthN: SPIFFE URI SAN (spiffe://mas/agent/{agent_id})
                         ├─ AuthZ: deny-by-default ACL (+ optional RBAC)
                         ├─ DLP scanning (block/redact)
                         ├─ Rate limiting
                         ├─ Circuit breaker + DLQ
                         ├─ Audit log (Redis Streams, tamper-evident)
                         ├─ OpenTelemetry traces + metrics (optional)
                         └─ Redis Streams for durable delivery + Redis hashes for state

Quick Start

  1. Start Redis
redis-server
  1. Create mas.yaml

Use mas.yaml.example as a template. You must provide:

  • Server cert/key + CA (tls_ca_path, tls_server_cert_path, tls_server_key_path)
  • A client cert/key per agent (tls_cert_path, tls_key_path)
  1. Implement agents

Runner injects server_addr and tls into your agent constructor; accept **kwargs and pass through.

from __future__ import annotations

from pydantic import BaseModel

from mas import Agent, AgentMessage


class Ping(BaseModel):
    value: int


class EchoAgent(Agent[dict[str, object]]):
    def __init__(self, agent_id: str, **kwargs: object) -> None:
        super().__init__(agent_id, **kwargs)

    @Agent.on("ping", model=Ping)
    async def handle_ping(self, message: AgentMessage, payload: Ping) -> None:
        await message.reply("pong", {"value": payload.value + 1})
  1. Run
uv run python -m mas
  1. Tail audit logs (optional)
uv run mas audit tail --last 10
# or: uv run python -m mas audit tail --last 10

Example

End-to-end mTLS + request/reply:

redis-server
cd examples/e2e_ping_pong
bash make_certs.sh
uv run python -m mas

Development

uv sync
uv run ruff check .
uv run ruff format .
uv run pytest
uv run ty check

Download files

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

Source Distribution

mas_framework-0.4.5.tar.gz (231.4 kB view details)

Uploaded Source

Built Distribution

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

mas_framework-0.4.5-py3-none-any.whl (75.5 kB view details)

Uploaded Python 3

File details

Details for the file mas_framework-0.4.5.tar.gz.

File metadata

  • Download URL: mas_framework-0.4.5.tar.gz
  • Upload date:
  • Size: 231.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for mas_framework-0.4.5.tar.gz
Algorithm Hash digest
SHA256 cb762445b3f634f036c6eb2bd605e66dc3fbb624858b10f0f03dc787f1e99756
MD5 7ca28a182fb23986d3f7589a3525c29a
BLAKE2b-256 174e9d2fc2a232cb4cd6eb47b65943f9765b68a1d6265b3d30d409388d5b5b22

See more details on using hashes here.

File details

Details for the file mas_framework-0.4.5-py3-none-any.whl.

File metadata

  • Download URL: mas_framework-0.4.5-py3-none-any.whl
  • Upload date:
  • Size: 75.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for mas_framework-0.4.5-py3-none-any.whl
Algorithm Hash digest
SHA256 139cd77337bc1a38fc7d0a17962a20d40e43fe5eb8512772755a5344589357f3
MD5 13503a771049220f2d9a4b7349ff1bc3
BLAKE2b-256 4c110349fe2109728350ba7dfe792b773f9825ba0069cdf0618b140dd9277bcc

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.4.5 This release

2 files

0.4.4

2 files

0.4.3

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

0.3.4

2 files

0.3.3

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.14

2 files

0.1.13

2 files

0.1.12

2 files

0.1.11

2 files

0.1.10

2 files

0.1.9

2 files

0.1.8

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Supported by

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