Section 9. A bank may receive deposits, renew time deposits, close loans, service loans, and receive payments on loans and other obligations in the commonwealth or in any other state as an agent for another banking institution, whether located within the commonwealth or in another state. The banking institution acting as such agent shall not be considered to be a branch of the principal banking institution. A banking institution acting as such agent shall not conduct an activity which it would be prohibited from conducting as a principal under a state or federal law, or, as a principal, have an agent conduct an activity which the institution would be prohibited from conducting under a state or federal law. The agency relationship shall be consistent with safe and sound banking practices and all applicable regulations of the commissioner. For the purposes of this section, a banking institution shall mean a bank, federal bank, foreign bank, out-of-state bank and an out-of-state federal bank as such terms are defined in section 1 of chapter 167.