| name | securing-mas |
| description | Apply OWASP MAESTRO 7-layer security framework to MAS designs |
| compatibility | Designed for Claude Code |
| metadata | {"argument-hint":["component-or-feature"],"allowed-tools":"Read, Grep, Glob, WebSearch, WebFetch"} |
Securing Multi-Agent Systems
Target: $ARGUMENTS
When to Use
Trigger this skill when:
- Conducting security reviews of agent systems
- Threat modeling for multi-agent architectures
- Reviewing plugin implementations for security
- Designing security controls for pipelines
References
MUST READ:
docs/archive/best-practices/mas-security.md
MAESTRO 7-Layer Security Check
For each new component, verify across all 7 layers:
Layer 1: Model Layer
Layer 2: Agent Logic Layer
Layer 3: Integration Layer
Layer 4: Monitoring Layer
Layer 5: Execution Layer
Layer 6: Environment Layer
Layer 7: Orchestration Layer
Security Checklist for Plugins
Before marking implementation as complete:
Input Validation
Output Safety
Resource Management
Observability
External Dependencies
Common Vulnerabilities
Prompt Injection (Layer 1)
Vulnerable:
prompt = f"Evaluate: {user_input}"
Secure:
result = agent.run(EvalContext(text=user_input))
Type Confusion (Layer 2)
Vulnerable:
def evaluate(self, context: dict) -> dict:
return {"score": context["data"]}
Secure:
def evaluate(
self, context: EvalContext
) -> EvalResult:
return EvalResult(score=context.compute())
Resource Exhaustion (Layer 5)
Vulnerable:
def evaluate(self, context):
while True:
process(context)
Secure:
def evaluate(self, context):
with timeout_context(self.settings.timeout):
return process(context)
Secret Leakage (Layer 6)
Vulnerable:
api_key = "sk-1234..."
Secure:
api_key = os.environ["API_KEY"]
Threat Matrix Template
For each new feature, document threats:
| Layer | Component | Threat | Sev | Mitigation |
|---|
| 1 | LLM caller | Prompt inj. | HIGH | Structured out |
| 2 | Plugin | Type confusion | MED | Validation |
| 3 | API | Svc downtime | MED | Degradation |
| 4 | Logs | Log injection | MED | Structured log |
| 5 | Runner | Resource exh. | HIGH | Timeouts |
| 6 | Infra | Secret exposure | HIGH | Env vars |
| 7 | Registry | Hijacking | MED | Static import |
Security Testing
Test security controls explicitly:
def test_input_validation():
"""Layer 2: Reject invalid inputs."""
plugin = MyPlugin(settings)
with pytest.raises(ValidationError):
plugin.evaluate(EvalContext(score=999))
def test_timeout_enforcement():
"""Layer 5: Prevent infinite execution."""
plugin = MyPlugin(settings)
with pytest.raises(TimeoutError):
plugin.evaluate(EvalContext(data="loop"))
def test_error_message_safety():
"""Layer 2: Don't leak internal state."""
plugin = MyPlugin(settings)
result = plugin.evaluate(
EvalContext(data="trigger_error")
)
assert "secret" not in result.error.lower()
Further Reading