ruvnet/ruflo · error

[wasm_gallery_import] HIGH_RISK: ${aiDefenceWarning}

Error message

[wasm_gallery_import] HIGH_RISK: ${aiDefenceWarning}

What it means

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.

Source

Thrown at v3/@claude-flow/cli/src/mcp-tools/wasm-agent-tools.ts:702

        let aiDefenceWarning: string | undefined;
        try {
          const aidefenceMod = await import('@claude-flow/aidefence');
          const defence = aidefenceMod.createAIDefence({ enableLearning: false });
          if (defence) {
            const scanResult = await defence.scan(args.templatesJson as string);
            if (scanResult && (scanResult as any).isThreat) {
              return {
                content: [{ type: 'text', text: JSON.stringify({
                  error: 'AIDefence blocked import: potential prompt injection detected in template payload',
                  HIGH_RISK: true,
                }) }],
                isError: true,
              };
            }
          }
        } catch {
          aiDefenceWarning = 'AIDefence not available — import proceeded without prompt-injection scan';
          console.warn(`[wasm_gallery_import] HIGH_RISK: ${aiDefenceWarning}`);
        }

        const wasm = await loadAgentWasm();
        const count = await wasm.galleryImportCustom(args.templatesJson as string);
        return { content: [{ type: 'text', text: JSON.stringify({ success: true, importedCount: count, warning: aiDefenceWarning }, null, 2) }] };
      } catch (err) {
        return { content: [{ type: 'text', text: JSON.stringify({ error: String(err) }) }], isError: true };
      }
    },
  },
  {
    name: 'wasm_gallery_export',
    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.',
    inputSchema: { type: 'object' as const, properties: {} },
    handler: async () => {
      try {
        const wasm = await loadAgentWasm();
        const exported = await wasm.galleryExportCustom();

View on GitHub (pinned to fa13ee4ad6)

Solutions

  1. Review the AI-defence warning before importing the WASM gallery item; only import trusted, reviewed artifacts flagged high risk.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at v3/@claude-flow/cli/src/mcp-tools/wasm-agent-tools.ts:702 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of ruvnet/ruflo@fa13ee4ad6 (2026-08-18). Data as JSON: /api/errors/d9390b67cf435b35. Report an issue: GitHub.