ruvnet/ruflo · error

Learning not enabled. Pass { enableLearning: true } to creat

Error message

Learning not enabled. Pass { enableLearning: true } to createAIDefence()

What it means

Log warning in learnFromDetection: the factory was created without { enableLearning: true }, so no learning service exists and the learning call is a no-op returning immediately — a capability guard, not a thrown error.

Source

Thrown at v3/@claude-flow/aidefence/src/index.ts:209

    quickScan(input: string) {
      return detectionService.quickScan(input);
    },

    hasPII(input: string) {
      return detectionService.detectPII(input);
    },

    async searchSimilarThreats(query, options) {
      if (!learningService) {
        return [];
      }
      return learningService.searchSimilarThreats(query, options);
    },

    async learnFromDetection(input, result, feedback) {
      if (!learningService) {
        console.warn('Learning not enabled. Pass { enableLearning: true } to createAIDefence()');
        return;
      }
      await learningService.learnFromDetection(input, result, feedback);
    },

    async recordMitigation(threatType, strategy, success) {
      if (!learningService) return;
      await learningService.recordMitigation(threatType, strategy, success);
    },

    async getBestMitigation(threatType) {
      if (!learningService) return null;
      return learningService.getBestMitigation(threatType);
    },

    startTrajectory(sessionId, task) {
      learningService?.startTrajectory(sessionId, task);
    },

View on GitHub (pinned to fa13ee4ad6)

Solutions

  1. Pass { enableLearning: true } to createAIDefence() to enable the learning features being invoked.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at v3/@claude-flow/aidefence/src/index.ts:209 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/85975c98be8be382. Report an issue: GitHub.