"knowing, wise," 1630s, from a Scottish and northern English formation from can (v.1) in its sense of "know how to," + -y (2). A doublet of cunning that flowered into distinct senses in Scottish English. In the glossary to Scott's "Heart of Mid-Lothian" (1818) uncanny is defined as "dangerous," while canny, as used in the tale, is defined as "skilful, prudent, lucky ; in a superstitious sense, good-conditioned, and safe to deal with ; trustworthy ; quiet." Cannily is "gently" and canny moment is "an opportune or happy time."
"Knowing," hence, from 18c., "careful, skillful, clever," also "frugal, thrifty," and, from early 19c. (perhaps via Scott's novels) "cautious, wary, shrewd." Often used superciliously of Scots by their southern neighbors (and their American cousins).
The Canny Scot is so well known as scarcely to require description. He carries caution, cunning, and selfishness to excess. Deceitful when a purpose is to be accomplished, he is not habitually deceitful. One thing he never loses sight of—his own interest. But of his own interest he is not the most enlightened judge. ["The Natural History of Scotsmen," in The Argosy, December 1865]
Related: Cannily; canniness.