@@ -17,6 +17,7 @@ func (c *Compiler) buildDetectionEngineExecutionStep(data *WorkflowData) []strin
1717 if data .SafeOutputs != nil && data .SafeOutputs .ThreatDetection != nil {
1818 if data .SafeOutputs .ThreatDetection .EngineDisabled {
1919 // Engine explicitly disabled with engine: false
20+ threatLog .Print ("Threat detection engine explicitly disabled via engine: false" )
2021 return []string {
2122 " # AI engine disabled for threat detection (engine: false)\n " ,
2223 }
@@ -49,6 +50,7 @@ func (c *Compiler) buildDetectionEngineExecutionStep(data *WorkflowData) []strin
4950 // Get the engine instance
5051 engine , err := c .getAgenticEngine (engineSetting )
5152 if err != nil {
53+ threatLog .Printf ("Detection engine %q not found, skipping execution: %v" , engineSetting , err )
5254 return []string {" # Engine not found, skipping execution\n " }
5355 }
5456
@@ -113,6 +115,8 @@ func (c *Compiler) buildDetectionEngineExecutionStep(data *WorkflowData) []strin
113115 resolvedDetectionModel = extractPiModelID (resolvedDetectionModel )
114116 }
115117
118+ threatLog .Printf ("Resolved inline detection engine %q (original=%q) with model %q" , engineSetting , originalEngineID , resolvedDetectionModel )
119+
116120 // Create minimal WorkflowData for threat detection.
117121 // SandboxConfig with AWF enabled ensures the engine runs inside the firewall.
118122 // NetworkPermissions.Allowed preserves only literal user-specified domains when Copilot
@@ -154,6 +158,7 @@ func (c *Compiler) buildDetectionEngineExecutionStep(data *WorkflowData) []strin
154158 // via BuildStandardNpmEngineInstallSteps) — a duplicate would trip
155159 // JobManager.ValidateDuplicateSteps and hard-fail the compile.
156160 if engineRequiresNodeHarness (engine ) && ! installStepsContainNodeSetup (installSteps ) {
161+ threatLog .Print ("Injecting Node.js setup step for detection engine harness" )
157162 for _ , line := range GenerateNodeJsSetupStep () {
158163 steps = append (steps , line + "\n " )
159164 }
0 commit comments