It seems the algorithm for deleting files when cleaning files in the work/.old directory follows symlinks. This is less than excellent when running the agent as root and the symlinks point to let's say /bin or /etc.
One could argue that leaving symlinks in the first place is a bad idea, but it could happen.
We use a system of debootstrap and chroot and some clever symlinking to ensure we get clean environments of the os-version/bitness/architecture we need. In some cases when builds fail we lose important information in the file system of the machine itself.
Is it possible to replace the deletion code by a custom script? That'd probably work for us, as we could then ensure cleanup and do the file deletion in a way we see fit.