1) You want to retain sole the rights to the IP and possibly license it for money to others some day. In this event, you should license it to your employer for a fee. However, this presents quite a tricky proposition of how you allocate time to spend on the tool vs time on your other work. If there is work to be done on the tool, you'd have to completely separate that from normal working hours, which may be impractical once the company is relying on said tool. The best way I can see to do that would be switching from employee to some kind of contractor role, where you could allocate time spent separately. As you can see this gets complicated.
2) You just don't want to give up the ownership completely to your company, but have no interest in ever charging for the tool. In that case, I'd suggest releasing it under an open source license prior to using it in your work. There are a variety of open source licenses available, and I feel like the pros and cons of each are well-worn territory already which can be examined with a simple Google search.
It seems like open source might be the way to go from your description above. In any case, you definitely need some kind of legal license in place, be it paid or open source.