  In principal-agent models, a principal offers a contract to an agent to
perform a certain task. The agent exerts a level of effort that maximizes her
utility. The principal is oblivious to the agent's chosen level of effort, and
conditions her wage only on possible outcomes. In this work, we consider a
model in which the principal is unaware of the agent's utility and action
space: she sequentially offers contracts to identical agents, and observes the
resulting outcomes. We present an algorithm for learning the optimal contract
under mild assumptions. We bound the number of samples needed for the principal
to obtain a contract that is within $\eps$ of her optimal net profit for every
$\eps>0$. Our results are robust even when considering risk-averse agents.
Furthermore, we show that when there are only two possible outcomes or the
agent is risk-neutral, the algorithm's outcome approximates the optimal
contract described in the classical theory.
