This research addresses principles for organizing predictable and flexible behavior in complex sensorimotor systems operating in unstructured environments. The central hypothesis of the work is that large classes of correct behavior can be constructed at run-time through the use of a small set of properly designed control primitives (the control basis) and that the skillful use of these sensorimotor primitives generalizes well to other tasks. A control basis is designed to represent a broad class of tasks, to structure the exploration of control policies to avoid irrelevant or unsafe alternatives, and to facilitate adaptive optimal compensation. The Discrete Event Dynamic Systems (DEDS) framework is used to characterize the control basis and to prune inappropriate control composition policies. Dynamic programming (DP) techniques are used to explore safe composition policies in which sensory and motor resources are bound to elements of the control basis to maximize the expected future payoff. An adaptive compensation policy is designed to extend the control basis and to incrementally approximate optimal control policies. A program of theoretical development and empirical analysis is undertaken to demonstrate the utility of this approach in robotics and machine learning applications.