Complete security framework for safe execution of AI-generated and external code with risk analysis, signature verification, and sandbox isolation