For example, in 1888, The Annual Register records the phrase think outside the lines.
Early phrasings include go outside the dots (1954),[6][7] breakthrough thinking that gets outside the nine-dot square (1959),[8][9] and what are the actual boundaries of the problem?
You can work on that puzzle, but the only way to solve it is to draw the lines so they connect outside the box.
Step outside the box your problem has created within you and come at it from a different direction.
[13][7] Finally, in 1971, the specific phrase think outside the box is attested, again appearing together with the nine dots puzzle.
According to Martin Kihn, it goes back to management consultants in the 1970s and 1980s challenging their clients to solve the "nine dots" puzzle.