assess_agent_security
Assess an AI agent's security posture based on the OWASP Agentic AI Top 10 framework. Supply details on key controls like input validation, output filtering, and privilege management to get a structured risk analysis.
Instructions
Full OWASP Agentic AI Top 10 security assessment.
Behavior: This tool is read-only and stateless — it produces analysis output without modifying any external systems, databases, or files. Safe to call repeatedly with identical inputs (idempotent). Free tier: 10/day rate limit. Pro tier: unlimited. No authentication required for basic usage.
When to use: Use this tool when you need structured analysis or classification of inputs against established frameworks or standards.
When NOT to use: Not suitable for real-time production decision-making without human review of results.
Args: agent_name (str): The agent name to analyze or process. has_input_validation (bool): The has input validation to analyze or process. has_output_filtering (bool): The has output filtering to analyze or process. has_tool_allowlist (bool): The has tool allowlist to analyze or process. has_least_privilege (bool): The has least privilege to analyze or process. has_context_isolation (bool): The has context isolation to analyze or process. has_action_logging (bool): The has action logging to analyze or process. has_auth_between_agents (bool): The has auth between agents to analyze or process. has_resource_limits (bool): The has resource limits to analyze or process. has_dependency_scanning (bool): The has dependency scanning to analyze or process. has_alignment_testing (bool): The has alignment testing to analyze or process. api_key (str): The api key to analyze or process.
Behavioral Transparency: - Side Effects: This tool is read-only and produces no side effects. It does not modify any external state, databases, or files. All output is computed in-memory and returned directly to the caller. - Authentication: No authentication required for basic usage. Pro/Enterprise tiers require a valid MEOK API key passed via the MEOK_API_KEY environment variable. - Rate Limits: Free tier: 10 calls/day. Pro tier: unlimited. Rate limit headers are included in responses (X-RateLimit-Remaining, X-RateLimit-Reset). - Error Handling: Returns structured error objects with 'error' key on failure. Never raises unhandled exceptions. Invalid inputs return descriptive validation errors. - Idempotency: Fully idempotent — calling with the same inputs always produces the same output. Safe to retry on timeout or transient failure. - Data Privacy: No input data is stored, logged, or transmitted to external services. All processing happens locally within the MCP server process.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| agent_name | Yes | ||
| has_input_validation | No | ||
| has_output_filtering | No | ||
| has_tool_allowlist | No | ||
| has_least_privilege | No | ||
| has_context_isolation | No | ||
| has_action_logging | No | ||
| has_auth_between_agents | No | ||
| has_resource_limits | No | ||
| has_dependency_scanning | No | ||
| has_alignment_testing | No | ||
| caller | No | ||
| api_key | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- server.py:138-138 (registration)Tool registration via @mcp.tool() decorator on FastMCP instance
@mcp.tool() - server.py:139-248 (handler)Core handler: assesses agent against OWASP Top 10 for Agentic AI (10 controls), computes risk rating (LOW/MEDIUM/HIGH/CRITICAL) and returns JSON assessment report
def assess_agent_security( agent_name: str, has_input_validation: bool = False, has_output_filtering: bool = False, has_tool_allowlist: bool = False, has_least_privilege: bool = False, has_context_isolation: bool = False, has_action_logging: bool = False, has_auth_between_agents: bool = False, has_resource_limits: bool = False, has_dependency_scanning: bool = False, has_alignment_testing: bool = False, caller: str = "", api_key: str = "", ) -> str: """Full OWASP Agentic AI Top 10 security assessment. Behavior: This tool is read-only and stateless — it produces analysis output without modifying any external systems, databases, or files. Safe to call repeatedly with identical inputs (idempotent). Free tier: 10/day rate limit. Pro tier: unlimited. No authentication required for basic usage. When to use: Use this tool when you need structured analysis or classification of inputs against established frameworks or standards. When NOT to use: Not suitable for real-time production decision-making without human review of results. Args: agent_name (str): The agent name to analyze or process. has_input_validation (bool): The has input validation to analyze or process. has_output_filtering (bool): The has output filtering to analyze or process. has_tool_allowlist (bool): The has tool allowlist to analyze or process. has_least_privilege (bool): The has least privilege to analyze or process. has_context_isolation (bool): The has context isolation to analyze or process. has_action_logging (bool): The has action logging to analyze or process. has_auth_between_agents (bool): The has auth between agents to analyze or process. has_resource_limits (bool): The has resource limits to analyze or process. has_dependency_scanning (bool): The has dependency scanning to analyze or process. has_alignment_testing (bool): The has alignment testing to analyze or process. api_key (str): The api key to analyze or process. Behavioral Transparency: - Side Effects: This tool is read-only and produces no side effects. It does not modify any external state, databases, or files. All output is computed in-memory and returned directly to the caller. - Authentication: No authentication required for basic usage. Pro/Enterprise tiers require a valid MEOK API key passed via the MEOK_API_KEY environment variable. - Rate Limits: Free tier: 10 calls/day. Pro tier: unlimited. Rate limit headers are included in responses (X-RateLimit-Remaining, X-RateLimit-Reset). - Error Handling: Returns structured error objects with 'error' key on failure. Never raises unhandled exceptions. Invalid inputs return descriptive validation errors. - Idempotency: Fully idempotent — calling with the same inputs always produces the same output. Safe to retry on timeout or transient failure. - Data Privacy: No input data is stored, logged, or transmitted to external services. All processing happens locally within the MCP server process. """ if err := _check_auth(api_key): return err if err := _rl(caller): return err control_map = { "A01": has_input_validation, "A02": has_tool_allowlist, "A03": has_least_privilege, "A04": has_context_isolation, "A05": has_output_filtering, "A06": has_action_logging, "A07": has_auth_between_agents, "A08": has_resource_limits, "A09": has_dependency_scanning, "A10": has_alignment_testing, } results = [] for risk_id, mitigated in control_map.items(): risk = OWASP_AGENTIC_TOP_10[risk_id] results.append({ "id": risk_id, "name": risk["name"], "severity": risk["severity"], "mitigated": mitigated, "status": "PASS" if mitigated else "FAIL", "recommended_mitigations": risk["mitigations"] if not mitigated else [], }) passed = sum(1 for r in results if r["status"] == "PASS") critical_passed = sum(1 for r in results if r["status"] == "PASS" and r["severity"] == "CRITICAL") critical_total = sum(1 for r in results if r["severity"] == "CRITICAL") if passed == 10: risk_rating = "LOW" elif critical_passed == critical_total and passed >= 7: risk_rating = "MEDIUM" elif critical_passed < critical_total: risk_rating = "CRITICAL" else: risk_rating = "HIGH" return json.dumps({ "agent": agent_name, "framework": "OWASP Top 10 for Agentic AI (2025)", "assessment_date": datetime.now().isoformat(), "overall_risk": risk_rating, "score": round(passed / 10 * 100, 1), "risks_mitigated": passed, "risks_unmitigated": 10 - passed, "critical_risks_mitigated": f"{critical_passed}/{critical_total}", "results": results, }, indent=2) - server.py:139-153 (schema)Input schema: agent_name (str), 10 boolean security controls (A01-A10), caller (str), api_key (str). Returns JSON string
def assess_agent_security( agent_name: str, has_input_validation: bool = False, has_output_filtering: bool = False, has_tool_allowlist: bool = False, has_least_privilege: bool = False, has_context_isolation: bool = False, has_action_logging: bool = False, has_auth_between_agents: bool = False, has_resource_limits: bool = False, has_dependency_scanning: bool = False, has_alignment_testing: bool = False, caller: str = "", api_key: str = "", ) -> str: - server.py:31-54 (helper)Helper functions: _check_auth validates API key, _rl enforces free tier rate limit (10 calls/day)
def _check_auth(api_key: str = "") -> str | None: if _MEOK_API_KEY and api_key != _MEOK_API_KEY: return "Invalid API key. Get one at https://meok.ai/api-keys" return None # ── Rate limiting ─────────────────────────────────────────────── FREE_DAILY_LIMIT = 10 _usage: dict[str, list[datetime]] = defaultdict(list) def _rl(caller: str = "anonymous", tier: str = "free") -> Optional[str]: if tier == "pro": return None now = datetime.now() cutoff = now - timedelta(days=1) _usage[caller] = [t for t in _usage[caller] if t > cutoff] if len(_usage[caller]) >= FREE_DAILY_LIMIT: return ( f"Free tier limit ({FREE_DAILY_LIMIT}/day). " "Upgrade: https://meok.ai/mcp/owasp-agentic/pro" ) _usage[caller].append(now) return None