This paper describes a self-contained, automated methodology for active o w control which couples the time-dependent N a vier-Stokes system with an adjoint N a vier-Stokes system and optimality conditions from which optimal states, i.e., unsteady ow elds and controls e.g., actuators, may be determined. The problem of boundary layer instability suppression through wave cancellation is used as the initial validation case to test the methodology. Here, the objective of control is to match the stress vector along a portion of the boundary to a given vector; instability suppression is achieved by c hoosing the given vector to be that of a steady base ow. Control is e ected through the injection or suction of uid through a single ori ce on the boundary. The results demonstrate that instability suppression can be achieved without any a priori knowledge of the disturbance, which is signi cant because other control techniques have required some knowledge of the ow unsteadiness such a s frequencies, instability t ype, etc. The present methodology has been extended to three dimensions and may potentially be applied to separation control, re-laminarization, and turbulence control applications using one to many sensors and actuators.