5178b3f056
The execute_code sandbox exposed its tool-call RPC (AF_UNIX socket and remote file-poll transports) without any caller check, so any local process that could reach the socket / rpc dir could dispatch terminal-capable tool calls through the parent. Mint a per-session HERMES_RPC_TOKEN, pass it to the sandboxed child, and require a timing-safe match on every request in both _rpc_server_loop and _rpc_poll_loop. Empty/missing/wrong token fails closed. Salvaged from #44073 (per-session RPC token). Added timing-safe secrets.compare_digest comparison and fail-closed regression tests. Co-authored-by: Hermes Agent <agent@nousresearch.com>