This paper shows how ontogenetic programming, an enhancement to the genetic programming methodology, allows for the automatic generation of adaptive programs. Programs produced by ontogenetic programming may include calls to self-modification operators. By permitting runtime program self-modification, these operators allow evolved programs to further adapt to their environments. In this paper the ontogenetic programming methodology is described and two examples of its use are presented, one for binary sequence prediction and the other for action selection in a virtual world. In both cases the inclusion of self-modification operators has a clear positive impact on the ability of genetic programming to produce successful programs. 1 Introduc...