agent script and init