Correct, Keyboard Maestro currently only considers the front foreground application to be the active application, and does not currently notice when non-foreground applications have the focus. This changed in 7.x with the new running application system, and may change back when I figure out how to do it within the new system.
Keyboard Maestro can only base its decisions on the front application (the one with the menu bar), which as far as I am aware is pretty much never Alfred. So unfortunately it probably cannot detect when Alfred is active.