What is "Agent" object

I am making wifi printer. I am looking inside the some reference code. but I am so confused.
What is the “agent” ? there is no exact description about “agent”. Some docs says to use agent , we need to get additional
permission. is that right ?

I am so excited to use imp. but docs and explanation is so poor.