Import and rewrite process guard from the old experiments repo.