In fairy tales, always watch out for the cunning fox or the cunning witch. Cunning means clever, in the sense of trickery. A cunning plan might involve setting traps for the innocent and pure at heart to fall into.
This adjective goes back to the 14th century English verb cunnen, which meant "to know," and is actually related to our English verb know. In earlier times, the noun was used to mean a high level of skill in using the hands. You can be cunning, but you can also use your cunning to figure out a very clever and tricky plan.