Moral hazard is a key issue in principal-agent literature. Examples lie in several aspects of real life, such as the worker's lack of effort when his/her conduct cannot be directly observed by the employer, and the principal's consequent need to motivate the agent to work as much as possible in his/her best interests. Another example is the relationship between voters and politicians, where elections serve as a disciplining mechanism to prevent rent-seeking behavior by unobserved public administrators. In this work we analyze such problems in a continuous-time setting with a model specification that draws from the classical consumption/investment à la Merton. Agents differ in competence, which is incompletely (but symmetrically) known by all players and learned over time by observing agent's performance. From a mathematical point of view, the analysis uses classical filtering techniques to re-formulate the problem within a complete information setting; then, relying on the dynamic programming principle and by using a guess-and-verify approach, explicit (at least to some extent) solutions are provided.