aligning validation in agent code