If you want to hire a real estate agent to list your house for sale or buyer agent to help you buy a home, you must enter into an Agency Agreement in writing; otherwise, you do not have representation.
Keep in mind that the Agreement is with the BROKER not the individual agent ! Because the agent cannot function legally w/o the broker, you should ensure that the Broker and Brokerage name and all relevant contact info is in the Agreement. It is your right to contact the Broker anytime you want! Your agreement is invalid if this is not in writing!
Also make sure that there is a termination date. More importantly make sure the way to terminate early is in writing as well! It should not be an "unreasonable" time period for you to give notice in writing to the broker/agent that you wish to terminate early. IMHO, anything more than 7 days is unreasonable. There is no hard and fast rule or law dictating termination time frames, however. An exception to this will be if you are already under contract; you will likely not have the opportunity during the contract period to terminate so you can avoid payment to the broker.
Terms within each agency agreement are also negotiable between the consumer and the broker/agent.
This takes us to payment.
Listing agreements are agreements between seller and broker/agent to sell the property for a certain %; terms of compensation must be included. Usually there is an agreement w/in this that sellers authorize listing broker/agent to offer part of that % to the buyer's broker/agent. When this % is advertised that portion of the agreement becomes one between the brokers. Sometimes agreements can be not only for a %, a flat $#, or a combination of both.
Buyer agency agreements also must have terms of compensation included where buyer agrees to pay the broker/agent for services rendered. Think about it, the buyer is hiring someone to represent them, they should be the ones responsible for paying the agent/broker. However, because of the broker agreements via multiple-listing services that indicate the offer to compensate buyer brokers/agents, many times (A LOT but not always) the buyer broker/agent will received payment via the listing broker INSTEAD of from the buyer. There is usually a paragraph explaining that buyer authorizes broker/agent to receive compensation from the listing side directly. And yes, if there is no or less than what you agreed to pay your buyer broker/agent you may be required to make up the difference. That is also a negotiating point.
If you meet with an agent to list your house for sale or help you find your new home, it is quite insulting to basically tell them "hey, I want you to do all this work, but I don't think I should have to pay you for it." There are very few professionals in any field that would take that from any potential client. I never have understood those who hire a professional to handle the buy/sell of their - probably - most valuable asset and think it deserves little to no compensation from them, the client. Find out exactly what you will be paying for.