predict_risk_neural
Assess AI system compliance risk by predicting violation probability, remediation urgency, and audit priority. Neural network refines predictions with each check.
Instructions
Neural network-based risk prediction that improves from every compliance check. Predicts overall risk, violation probability, remediation urgency, and audit priority.
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 to assess, audit, or verify compliance requirements. Ideal for gap analysis, readiness checks, and generating compliance documentation.
When NOT to use: Do not use as a substitute for qualified legal counsel. This tool provides technical compliance guidance, not legal advice. 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 |
|---|---|---|---|
| system_name | Yes | ||
| system_type | No | ||
| uses_biometric | No | ||
| uses_health_data | No | ||
| uses_financial_data | No | ||
| has_human_oversight | No | ||
| affected_users | No | ||
| sector | No | ||
| has_documentation | No | ||
| prior_incidents | No | ||
| deployed_cross_border | No | ||
| model_explainable | No | ||
| api_key | No |
Implementation Reference
- server.py:1832-1907 (handler)Handler function for the predict_risk_neural MCP tool. It authenticates, rate-limits, extracts features using ComplianceNeuralNet, and returns a neural network-based risk prediction.
@mcp.tool() def predict_risk_neural( system_name: str, system_type: str = "", uses_biometric: bool = False, uses_health_data: bool = False, uses_financial_data: bool = False, has_human_oversight: bool = True, affected_users: int = 0, sector: str = "", has_documentation: bool = False, prior_incidents: int = 0, deployed_cross_border: bool = False, model_explainable: bool = True, api_key: str = "") -> dict: """Neural network-based risk prediction that improves from every compliance check. Predicts overall risk, violation probability, remediation urgency, and audit priority. 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 to assess, audit, or verify compliance requirements. Ideal for gap analysis, readiness checks, and generating compliance documentation. When NOT to use: Do not use as a substitute for qualified legal counsel. This tool provides technical compliance guidance, not legal advice. 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. """ allowed, msg, tier = check_access(api_key) if not allowed: return {"error": msg, "upgrade_url": "https://meok.ai/pricing"} limit_err = _check_rate_limit("anonymous", tier) if limit_err: return {"error": "rate_limited", "message": limit_err} if _neural_net is None: return {"error": "Neural engine not available. Install meok-labs-engine for neural predictions.", "system_name": system_name} features = _neural_net.extract_features_from_system( system_name=system_name, system_type=system_type, uses_biometric=uses_biometric, uses_health_data=uses_health_data, uses_financial_data=uses_financial_data, has_human_oversight=has_human_oversight, affected_users=affected_users, sector=sector, has_documentation=has_documentation, prior_incidents=prior_incidents, deployed_cross_border=deployed_cross_border, model_explainable=model_explainable, ) prediction = _neural_net.predict_risk(features) prediction["system_name"] = system_name prediction["features_used"] = features return prediction - server.py:1832-1833 (registration)Tool registration via the @mcp.tool() decorator on the predict_risk_neural function.
@mcp.tool() def predict_risk_neural( - server.py:30-37 (helper)Import of ComplianceNeuralNet helper class from compliance_neural module, instantiated as _neural_net. This neural engine provides extract_features_from_system and predict_risk methods used by the tool.
try: sys.path.insert(0, os.path.expanduser("~/clawd/meok-labs-engine/shared")) from auth_middleware import check_access as _shared_check_access from compliance_neural import ComplianceNeuralNet _neural_net = ComplianceNeuralNet("eu-ai-act") _AUTH_ENGINE_AVAILABLE = True except ImportError: _AUTH_ENGINE_AVAILABLE = False