

- More endpoints and credentials to secure.
- Greater chance of misinterpretation or conflicting objectives between agents.
- Shared memory and tooling increase blast radius for compromise.
- Harder to enforce consistent ethical rules and safety constraints across agents.
Design multi‑agent systems defensively
MAS failures can cascade across the system. Defensive design focuses on prevention, containment, and rapid detection:
- Create scoped memory (per-session or per-task isolation) and TTL for context.
- Sign and authenticate every message between agents.
- Apply least-privilege RBAC for tools, APIs, and data access.
- Run untrusted code in sandboxes and enforce runtime limits.
- Require layered verification or human approval for high-risk side effects.
- Maintain comprehensive, structured audit logs for observability and incident response.


- Strict session isolation and per-session encryption keys.
- Memory redaction, TTL (time-to-live) expiration, and automatic purging of ephemeral data.
- Behavioral monitoring and anomaly detection for agent outputs.
- Provenance tracking so downstream agents can weight or ignore low‑quality sources.

- Issue per-agent credentials (API keys, tokens, service accounts).
- Use mutual TLS or signed tokens (for example, JWT) for inter-agent authentication. See Cloudflare’s guide to mutual TLS: https://www.cloudflare.com/learning/ssl/what-is-mutual-tls/ and JWT: https://jwt.io/.
- Apply role-based access control (RBAC) and least privilege: only grant the permissions required for an agent’s role.
- Enforce strict agent boundaries and monitor for privilege escalation patterns.

- Encrypt sensitive data in transit and at rest.
- Avoid persistent storage of sensitive context unless needed for compliance or audit.
- Implement memory redaction, TTL expiration, and session-based isolation.
- Remove or redact tokens, credentials, and personal identifiers before persisting shared context.
- Log access events with user/agent identifiers for accountability.
- Codify system-level ethical constraints (forbidden content, safety thresholds, privacy boundaries).
- Implement centralized checks or an arbiter/supervisor agent that enforces constraints.
- Use weighted-scoring, voting, or supervisor overrides to resolve conflicts between agents.
- Route ambiguous or high‑risk outputs to human reviewers.
- Add bias and fairness audits at pipeline stages.
- Track sources and provenance so downstream agents can consider origin quality.
- Use diverse datasets and enforce source diversity rules for research agents.
- Introduce human review for sensitive decisions and continuously monitor for distributional drift.
- Execute untrusted code in sandboxes with runtime and resource limits.
- Enforce message length, API call, and retry limits.
- Escalate uncertain or high-risk actions to human operators or higher‑trust agents.
- Monitor in real time and retain structured logs for incident forensics.
- Use encrypted channels (TLS) and sign messages where applicable.
- Authenticate every sender and validate authorization for requested actions.
- Prefer structured schemas (JSON + JSON Schema) to detect malformed input and reduce ambiguity.
- Sanitize payloads to defend against prompt injection and message overflow.
This checklist is an operational guide — adapt it to your domain and regulatory needs. For high-impact systems, prioritize human-in-the-loop gates, stronger isolation, and frequent security reviews.
