Jorj X. McKie is a Saboteur Extraordinary, one of the principals of the Bureau of Sabotage, and the only human admitted to practice law before the Gowachin bar as a legum (lawyer). While meditating in a park in BuSab headquarters McKie is mentally contacted by the Caleban Fanny Mae, a female member of a species of unparalleled power from another dimension whose visible manifestation in this universe is the star Thyone in the Pleiades cluster. McKie feels real love toward Fanny Mae, but is unable to have a warm relationship with females of his own species (he has been married more than fifty times). Fannie Mae warns McKie that the full power of "nodal involvement" (her term for love) can destroy human beings.
Generations ago, a secret, unauthorized experiment was carried out with the help of the the Caleban. They isolated the planet Dosadi behind an impenetrable barrier called "The God Wall". On the planet were placed humans and Gowachin with an unstable form of government, the Demo-Pol. The planet itself is massively poisonous except for a narrow valley, into which nearly 90 million humans and Gowachin are crowded under terrible conditions. Senior Liator Keila Jedrik subtly manipulates the Demo-Pol to eliminate the jobs of fifty humans within the bureaucracy of the city of Chu, where humans and Gowachin exist together in a precarious balance. This is the opening gambit in a war that will change Dosadi forever.
BuSab has obtained scattered reports about the existence of Dosadi and Jorj X. McKie is tasked to investigate. As he prepares his sabotage kit, he swallows a bead which will allow a Tapisriot to transmit his memories to another agent in the likely event of this death, indicative of the mechanical way BuSab gnawed away at its problems.
Jedrik watches as the flaw she introduced in the Demo-Pol is taken like bait by another person, who exploits it to add another forty humans to the rolls of the unemployed. Keila herself is "fired" and she leaves her office feigning anger, but she is secretly pleased that the events she put into motion were accelerating.
The Gowachin are a species of frog-people (in human terms) who practice a harsh weeding-out process on their tadpoles, and demand better and better decisions as members rise toward the very pinnacle of their society. Their legal practices are based upon a healthy disrespect for the law: the losing legum may be killed by the winning legum; a client pronounced innocent before the court is torn to pieces by angry spectators; judges may have bias ("if I can decide for my side, I will"), but not prejudice ("I will decide for my side, regardless"); any participant in the trial is subject to judgment and even questioning-by-pain, including the judges. Upon his arrival on Tandaloor, the home world of the Gowachin, McKie is presented with an ancient blue box that contains a knife, a book, and a rock. He is made the legum of Aritch, High Magister of Running Phylum.
The humans Gar and his daughter Tria conver with Dosadi's current ruler, the Gowachin Elector Broey in his citadel. Tria has identified Keila Jedrik as the one who precipitated the recent change in the Demo-Pol. She is tasked to go into the warrens of Chu and contact Jedrik. They suspect she is really an agent for forces outside of Dosadi.
Aritch attempts to limit McKie's investigation into Dosadi by intimidating him with the presence of Ceylang, a deadly Wreave under training to become a legum like McKie. At one point Aritch commands her to attack, but McKie sabotages this by snatching the sacred book from the blue box and threatening to desecrate it with his own blood drawn by the sacred knife.
As Jedrik is driven to her apartment by Havvy, he bargains with her for information about McKie which he thinks is valuable. The information is simply that "McKie comes from beyond the God Wall." She dismisses the information as garbage. Jedrik is well aware of McKie's alien origins, for she has discerned that Havvy himself comes from beyond the God Wall.
With Ceylang dismissed, Aritch answers McKie's questions as required under Gowachin Law. The apparent purpose of the experiment was to subject sentients to the worst conditions possible for survival and see what behaviours and instincts were bred as a response. The Dosadi have become terrifying creatures with heightened perceptions, intelligence, and a drive to survive and prosper; if they were to be loosed upon the universe, they would quickly conquer it. Aritch will destroy Dosadi rather than allow that possibility to materialize. By intense probing, McKie finds a line of questioning that Aritch refuses to answer: What benefits were expected to accrue from conducting the Dosadi Experiment?. Aritch proposes that McKie journey to Dosadi itself to learn the answer first-hand.
Elector Broey communes with the Caleban who poses as the deity of Dosadi. The Caleban, as ordered by Aritch who holds a contract, informs Broey that McKie is arriving through the God Wall. Aritch wants Broey to capture McKie before he falls into the hands of Jedrik. Broey takes pride in the fact that he is a pure servant of "God" who knows what it is to be both human and Gowachin.
McKie arrives on Dosadi via jump-door and waits for his contact to arrive. He clears his mind and contacts Fannie Mae through the God Wall, requesting that she help the Bureau obtain his final memories in the event of his death on Dosadi. She refuses, citing the Gowachin contract, and offers to remove him from Dosadi immediately. Soon McKie will not be permitted to leave in his own "body/node" but she refuses to elaborate, again citing the terms of the contract.
Tria and a small squad of lieutenants foray into the warrens of Chu looking for Jedrik at her last known residence. The first race-riots between human and Gowachin have occured, triggered by Jedrik's "adjustment". When Tria arrives at Jedrik's apartment, she finds her quarry gone and her own agent murdered.
McKie is contacted by a Gowachin named Bahrank and driven in an armored military vehicle through a no-man's land on the rim to the city of Chu, dodging mortar and gun-fire all the way. Bahrank manages to evade Broey's forces and enter Gate Nine. In the city McKie is overwhelmed by the stink and the poverty of the inhabitants. Bahrank leaves him standing in the street and drives away, cutting off McKie's last link to the ConSentiency.
The rioting continues to worsen. Broey is hoping for the situation to become less ambiguous, but Gar is exasperated that Broey is reacting exactly as Jedrik has anticipated. Broey begins to distrust Gar and wants him to leave. Gar reveals that his forces have begun a second City on the Rim, and proposes a separation of the species, but his continued obsession with Jedrik makes Broey realize that Gar is not part of her plot after all. He permits Gar to remain as his advisor.
McKie makes contact with Jedrik, who says, "Well...welcome to Dosadi, McKie." He had been told that the Dosadi did not suspect his off-world origins and warned not to give this secret away. Realizing he has been betrayed by Aritch, McKie becomes utterly submissive. She makes him hand over his toolkit and begins to interrogate him.
On the second day of rioting Elector Broey meets with his Gowachin aids and angrily demands they search for the hidden cache of food and the "blasphemous" second city on the Rim, even if it means angering the humans in the warrens and accelerating the unrest. He begins to admire Jedrik's warlord mind and puzzles over why his "God" failed to warn him.
Keila Jedrik takes McKie to meet a caged Gowachin named Pcharky. Jedrik says Pcharky has helped many people escape Dosadi. Later in her protected quarters they make love, and Jedrik undertakes to make McKie understand about Dosadi "one lesson at a time."
Aritch and Ceylang discuss the possibility that the Dosadi Affair will come to trial in the Courtarena. Ceylang reminds Aritch that McKie dares not draw her blood, or even publically shame her, lest the entire Wreave universe come hunting for him with "death in their mandibles." Aritch angrily reminds her that McKie adapts, and he will find a way to defeat her in such a way that her Wreave universe would "shower him with adulation".
Jedrik takes McKie to a training facility where some of her commandos are learning to use new weapons. McKie is shocked to discover they are larger copies of the tools in his sabotage kit. The speed with which they had been copied gives McKie a new appreciation as to why Aritch feared the Dosadi.
The unrest in Chu has passed from the level of mere rioting to full urban warfare. More than 100 battles rage between the species. Broey anticipates things will go worse and orders the sequestration of a number of Gowachin females within the inner bastions.
McKie examines his life and equates his personal loneliness with the loneliness of the entire world of Dosadi, cut off from the rest of the universe. In a subtle shift he finds his loyalties siding with Dosadi. No longer serving to try to contain Dosadi, he realizes that the planet's freedom and subsequent diaspora of its inhabitants could be the greatest cleansing force the universe had ever experienced.
The fourth day of the Battle for Chu has Tria and Gar in possession of only one-eighth of the warren area, but with a population density triple the norm. Jedrik had effectively cleaved them from any alliance with Broey. Tria asserts herself over her father and decides to surrender to Jedrik.
On the fifth day of the Battle for Chu McKie interrogates a captive Tria and Gar, and suspects that Tria was trained by the Pan-Spechi race. Jedrik sees McKie transformed into a Dosadi before her very eyes. She makes McKie her lieutenant and sends him back with Gar and Tria to their enclave to observe.
Broey recognizes that unless Jedrik makes a stupid mistake, it is only a matter of time until she defeated him. He acknowledges that she is more Dosadi than him and deserves the victory, but he dispatches suicide bombers to make her inevitable victory as costly as possible.
On the front lines of the battle, McKie takes captive a Gowachin named Grinik who reveals that his orders from Mrreg are to get his people out of Dosadi before it is destroyed in sixty hours. McKie has also captured Havvy, who reveals much. The actual purpose of the experiment is to perfect ego transfer. New Dosadi bodies for old ConSentiency ones. Havvy alerts McKie to the fact that Jedrik plans to swap bodies with him and escape Dosadi, because the Caleban contract states that no one may leave Dosadi in their original body. McKie realizes that someone else is looking through Havvy's eyes. He speaks directly to Aritch through Havvy and admonishes him to honor the sacred relationship between Legum and client.
Not a single one of Broey's people have left the city. McKie recognizes that Broey has sequestered the females somewhere. Jedrik plans to use Gar's shock troops to gain entrance to that place. Even a few would be enough, if armed with the new weapons, and Broey would be compelled to yield.
Ceylang is obsessed with the remote observations of McKie, knowing that her life is at stake. When the cameras are shut down Aritch speculates that Jedrik ordered it, which makes Ceylang shudder at the implication that Jedrik is playing them like a fine instrument.
By perfecting ego transfer, the power brokers behind the experiment give themselves a kind of immortality: As they near death, they switch egos with a young person, taking a new body and extending their ego lifespan through several generations, and theoretically forever. Pcharky mediates this, through the power of the God Wall Caleban. He will do this one more time, and in exchange Jedrik will provide a body for Pcharky himself to escape Dosadi. Jedrik convinces McKie that it is the only way out.
Ceylang is fascinated by the possibilities inherent in ego-transfer, but Aritch warns her that it could mean infiltration into one race by another. He considers her fascination to be an infection that could spread out of control if the Dosadi Affair comes to the Courtarena.
Jedrik and McKie swap bodies, but the exchange awakens a "sleeper" deep in their cells that terrifies them and kills Pcharky. Something has gone wrong, and now Jedrik and McKie find they can swap egos and bodies at will. Broey shows up alone to surrender, because the sky of Dosadi has gone black. The Caleban has sealed the planet in to conceal the final explosion.
In Jedrik's body McKie contacts Fannie Mae one more time and asks the Caleban to remove both him and Jedrik through the God Wall. From Tandaloor McKie contacts six BuSab agents using a Tapisriot contract and does a contingency memory dump of everything he learned on Dosaid. Then he contacts Aritch and as legum orders him to cancel the Caleban contract and remove the God Wall. Dosadi is free.
Making several inquiries, McKie confirms the complicity of Bildoon's involvement in the Dosadi Affair. He had been bought off with the promise of a body to permanently fix his ego before it migrated to one of the other four members of his Pan-Spechi creche. McKie maneuvers to have only three judges on the Courtarena bench, and one of them must be Broey.
McKie contacts Mrreg because he asserts that he is the Legum for "that Gowachin who made the decision to launch the Dosadi Experiment". Mrreg wistfully answers his queries while he is preparing for a ritual, unfamiliar to McKie, called Laupuk which turns out to be an alien form of hari-kari. After Mrreg dies, Aritch steps back into his role as McKie's client.
Safe on McKie's floating island on the oceanic world of Tutalsee, Jedrik contacts McKie mind-to-mind to make the point that Aritch's plans didn't extend much beyond the uses of outrage and injustice, and how to turn such things to personal advantage. But such actions always call forth a greater counter-reaction, which was occuring even as they spoke, with escaping Dosadi-born infiltrating every facet of the ConSentiency.
Broey was accepted as judge, and Bildoon as the second judge. The third judge, Moredes Parando, has the look of the Dosadi Rim. McKie knows he was a legalist, who gives advice on Gowachin Law. Legalists were absolutely forbidden from serving as a judge. Ceylang calls Jedrik as a witness, forcing McKie to reveal her whereabouts on Tutalsee. She testifies that she is McKie's lover, but this is not enough to exclude her as a witness. However, Ceylang proposes the exclusion and it is agreed to. After McKie calls a recess, they make love once more, and Jedrik confesses that she is in love with McKie, an emotion she never felt before. She finds the sensation of being able to admit it openly very odd. In the morning Jedrik returns to McKie's home on Tutalsee, but she is killed by an explosion that rips apart the island. By this act Jedrik removes herself as a potential hostage to hold over McKie's head. Eight conspirators arrive to gloat over him, addressing him as Jedrik. Nothing in their experience permits them to believe it was McKie in his own body, for the Caleban contract was clear. Naturally they are surprised when Broey's people pounce on them.
The eight shackled conspirators are dumped on the arena floor. McKie names them his client, and maneuvers Ceylang into being their prosecutor. In so doing, she affirms Aritch's innocence and her life is forfeit. McKie suggests the eight be handed over to ConSentient jurisdiction for trial, and Broey so orders it. McKie picks up a spear, reveals Parando to be a legalist, and kills him with a single thrust. Bildoon's ego, overcome by the stress of the Courtarena, has already fled to the creche leaving Bildoon himself a lifeless corpse. Broey finds for the defense, and Aritch is declared innocent. In the strange, inverted system of Gowachin Law, that means his life could be taken by the court observers. He walks out of the Courtarena to his doom. McKie uses the sacred knife to make a single pockmark in Ceylang's flesh, as a lover would. The Wreaves stand down, accepting this as a token of honor that satisfies Gowachin law. McKie will not be hunted down. Jedrik's ego awakens in McKie's mind then, and both of them must now share his one body. They look at Broey, knowing that he was moving to seize the reins of power in the ConSentiency. Jedrik/McKie find it humorous that Broey is doing their work for them, presenting a single target for their ministrations as the new head of BuSab.