I am working on a project where there are a lot of objects that are created by a library, and I have no access to the creation process of these objects.
The following sn
The only way to do what you suggest is to use byte code Instrumentation. You can add an agent which changes the byte code of the clazz you want to modify before it is loaded.
The reason you need to do this at load time is that many JVMs will not allow you to change fields and some don't allow you to add methods after the class is loaded.
A simpler solution is to decompile the class, modify it and compile it again. Assuming the class can be decompiled this will save you a lot of time and effort.
the library I am using has a security manager that blocks the use of all reflection
This is an odd choice because you can put in place your own SecurityManager before calling the library and it can't prevent you from doing anything.