fix(attach): harden runtime operations (#826)