We study the problem of pathwise stochastic optimal control, where the optimization is performed for each fixed realisation of the driving noise, by phrasing the problem in terms of the optimal control of rough differential equations. We investigate the degeneracy phenomenon induced by directly controlling the coefficient of the noise term, and propose a simple procedure to resolve this degeneracy whilst retaining dynamic programming. As an application, we use pathwise stochastic control in the context of stochastic filtering to construct filters which are robust to parameter uncertainty, demonstrating an original application of rough path theory to statistics.