People making agreements for another person or company are agents. Agents may have different scope of authority to act but more basic: how are agents created to begin with?
1) By express agreement. That means that the principal and the agent reach an understanding as to what the relationship is. This agreement may be written or oral.
2) By the conduct of the parties. If the two people act like there is a principal/agent relationship, then their conduct create the relationship. In other words, people cannot pretend to have agents in order to cheat others.
3) By ratification of an unauthorized act. This is the same kind of idea as above.
4) By estoppel. If I come home and I see you painting my house and I do nothing to stop you or even find out what is going on, then I’ve got to pay for the paint job, even though there’s no agreement to do so, unless I could satisfy a court that I had good reason not to suspect anything was wrong.
5) By necessity. A child, while away from home, may need to see a doctor on a medical emergency. The doctor has to show that his treatment and his bill was reasonable but if he does so, the parent is liable to pay the bill even though they had no prior knowledge or approval of the action.
However the relationship is established, agents are expected to act in the best interests of the principal.