Pi Planning In Safe Framework