decouple agent from app process