And to add to Kelsey McLeod’s answer, the notion of decision, choice came first. The notion of surreptitiousness comes later: it’s using your capability of making good decisions, in order not to divulge that much, considering the social factors at play. It’s being discerning (which is in fact the same verb).
From OED, it all happened in Late Latin:
(ii) classical Latin discrētiōn- , discrētiō separation, division, distinction, discrimination, in post-classical Latin also discernment (Vulgate; early 3rd cent. in Tertullian), prudence (5th cent.), caution, circumspection (5th or 6th cent.), as a form of address [“your discretion!”, towards a cleric] (8th cent.; frequently from 12th cent. in British sources) < discrēt– , past participial stem of discernere discern v. + –iō -ion suffix1.
< (i) Anglo-Norman and Middle French discrecion, discretion (French discrétion) discernment, wisdom, sound judgement (c1165 in Old French), freedom to decide as one sees fit (15th cent.), separation, distinction, discontinuity (c1400), in Anglo-Norman also disparity (1139), interval, distance (15th cent.), also used with a possessive adjective as a form of address to a person in authority (15th cent.),
The first really obvious example I see in the OED of “choosing not to speak” and not just “being thoughtful in what you speak” is:
1597 Bacon Ess. f. 3, Discretion of Speech is more than eloquence.