> What legal agreement did the monkey sign to allow PETA power of attorney to act on its behalf?
That isn't necessary in the case of an entity that is not competent to make such a decision. E.g. animals, children, mentally disabled.
In those circumstances the court's can assign or allow welfare groups to act on behalf of the entities.
Taking your requirement that the monkey would have to sign such an agreement would mean groups like the RSPCA or other animal welfare groups - or the government itself - couldn't sue people or business for mistreatment of animals.
The same with respect to children or mentally disabled, the government wouldn't be able to take action on their behalf if we follow your argument.