The `ModuleProtocol` function will always free the old tags before allocating the new ones, so we'll leak one copy at the end of the agent execution, which I think is acceptable.  If you'd like to rework it, please do.