What is the best defensive setup for the palace?
These answers restate the rules implemented by our open-source engine, which follows the WXF laws and is regression-tested against the official 110-diagram repetition casebook. Where an answer refers to a specific position, that position lives on the linked reference page, where the build verifies it against the engine before publishing.
Direct answer
Keep both advisors and both elephants, leave the general a spare point, and block the central file early rather than reacting once a cannon is already on it. A full defence of two advisors and two elephants holds a lone chariot to a draw, which is the benchmark every defensive decision should be measured against.
Count attackers, do not react to threats
The common defensive failure is answering each threat as it appears, one move at a time, while the attacker brings a third piece. Instead count: how many pieces can they get to your palace in three moves, and how many can you get back? If their number is larger, you need to trade something off now.
Trading is defence
Trading a piece is the most reliable way to defuse an attack, because two attackers become one and one attacker achieves nothing. Giving up a soldier to trade a chariot is frequently correct even when it looks like a concession.
Related questions
Is it worth a soldier to keep both advisors?
Usually yes in the endgame. Whole classes of mate become possible the moment one advisor goes.
Should elephants stay at home?
Mostly, but not if they are supplying an enemy cannon with screens. Then moving one out of the firing line is right.