A Multi-Agent System Framework
Project description
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
- Start Redis
redis-server
- 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)
- 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})
- Run
uv run python -m mas
- 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
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
mas_framework-0.4.4.tar.gz
(229.1 kB
view details)
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 mas_framework-0.4.4.tar.gz.
File metadata
- Download URL: mas_framework-0.4.4.tar.gz
- Upload date:
- Size: 229.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e8d4157b463afedb46008ba964586ffca7ac67ab0c39a889f27ffe7d6c73b328
|
|
| MD5 |
efacdf685567511be3637f0b218b55ed
|
|
| BLAKE2b-256 |
0236f17b6006b726a09567ceb2a95cef97e197ea82a4edb1ef1066aed67b3b8e
|
File details
Details for the file mas_framework-0.4.4-py3-none-any.whl.
File metadata
- Download URL: mas_framework-0.4.4-py3-none-any.whl
- Upload date:
- Size: 74.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e6604824bbc1994b93b44dcdc857c74cb7010100c96028d78c3f1ef08c611a51
|
|
| MD5 |
d8100e54da7223c4d37a12ce1e6944eb
|
|
| BLAKE2b-256 |
219ecba44847f65caf9bda7d51aea82c2f2c55384b63c01e9b66d711bee95812
|