{"record":{"id":"d9390b67cf435b35","repo":"ruvnet/ruflo","slug":"wasm-gallery-import-high-risk-aidefencewarnin","errorCode":null,"errorMessage":"[wasm_gallery_import] HIGH_RISK: ${aiDefenceWarning}","messagePattern":"\\[wasm_gallery_import\\] HIGH_RISK: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/cli/src/mcp-tools/wasm-agent-tools.ts","lineNumber":702,"sourceCode":"        let aiDefenceWarning: string | undefined;\n        try {\n          const aidefenceMod = await import('@claude-flow/aidefence');\n          const defence = aidefenceMod.createAIDefence({ enableLearning: false });\n          if (defence) {\n            const scanResult = await defence.scan(args.templatesJson as string);\n            if (scanResult && (scanResult as any).isThreat) {\n              return {\n                content: [{ type: 'text', text: JSON.stringify({\n                  error: 'AIDefence blocked import: potential prompt injection detected in template payload',\n                  HIGH_RISK: true,\n                }) }],\n                isError: true,\n              };\n            }\n          }\n        } catch {\n          aiDefenceWarning = 'AIDefence not available — import proceeded without prompt-injection scan';\n          console.warn(`[wasm_gallery_import] HIGH_RISK: ${aiDefenceWarning}`);\n        }\n\n        const wasm = await loadAgentWasm();\n        const count = await wasm.galleryImportCustom(args.templatesJson as string);\n        return { content: [{ type: 'text', text: JSON.stringify({ success: true, importedCount: count, warning: aiDefenceWarning }, null, 2) }] };\n      } catch (err) {\n        return { content: [{ type: 'text', text: JSON.stringify({ error: String(err) }) }], isError: true };\n      }\n    },\n  },\n  {\n    name: 'wasm_gallery_export',\n    description: 'Export all custom WASM gallery templates as a JSON snapshot. Use when native Read/cat is wrong because custom templates live inside the WASM runtime store and are not persisted as individual files on disk.',\n    inputSchema: { type: 'object' as const, properties: {} },\n    handler: async () => {\n      try {\n        const wasm = await loadAgentWasm();\n        const exported = await wasm.galleryExportCustom();","sourceCodeStart":684,"sourceCodeEnd":720,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/@claude-flow/cli/src/mcp-tools/wasm-agent-tools.ts#L684-L720","documentation":"High-risk security warning from the wasm_gallery_import tool: AIDefence's scan of the template payload flagged content worth escalating (e.g. injection indicators); the tool tags the import HIGH_RISK so the operator must review before proceeding.","triggerScenarios":"Thrown at v3/@claude-flow/cli/src/mcp-tools/wasm-agent-tools.ts:702 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Review the AI-defence warning before importing the WASM gallery item; only import trusted, reviewed artifacts flagged high risk."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fa13ee4ad60ac2090b1480656eb233521790d640","analyzedAt":"2026-08-18T21:34:22.708Z","contentChangedAt":"2026-08-18T21:34:22.708Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}