We consider the one-shot Prisoner’s Dilemma between algorithms with access to one anothers’ source codes, and apply the modal logic of provability to achieve a flexible and robust form of mutual cooperation. We discuss some variants, and point out obstacles to definitions of optimality. 1 Informal Introduction Many philosophers have suggested that mutual knowledge of decision processes can enable rational cooperation in even the one-shot Prisoner’s Dilemma. Rapoport  argued in the 1960s that two agents with mutual knowledge of each others’ rationality should be able to cooperate. Howard  explains the argument thus: Nonetheless arguments have been made in favour of playing C even in a single play of the PD. The one that interests us relies heavily on the usual assumption that both players are completely rational and know everything there is to know about the situation. (So for instance, Row knows that Column is rational, and Column knows that he knows it, and so on.) It can then be argued by Row that Column is an individual very similar to himself and in the same situation as himself. Hence whatever he eventually decides to do, Column will necessarily do the same (just as two good students given the same sum to calculate will necessarily arrive at the same answer). Hence if Row chooses D, so will Column, and each will get 1. However if Row chooses C, so will Column, and each will then get 2. Hence Row should choose C. ∗Partially supported by NSF Grant DMS-1201314.