
100 Cal.Rptr.2d 150 (2000)
83 Cal.App.4th 927
The CADLE COMPANY II, Plaintiff and Appellant,
v.
D. Neil HARVEY, Defendant and Respondent.
No. D033796.
Court of Appeal, Fourth District, Division One.
September 19, 2000.
Rehearing Denied October 16, 2000.
Review Denied December 13, 2000.
*152 Alpert, Barr & Gross, Alpert & Barr, Gary l. Barr and Mark S. Blackman, Encino, for Plaintiff and Appellant.
Ferrette & Slater, Timothy J. Truxaw and Gary E. Slater, San Diego, for Defendant and Respondent.
Certified for Partial Publication.[1]
*151 Mcdonald, J.
The D. Neil Harvey Family Trust (the trust), an inter vivos revocable trust settled by respondent D. Neil Harvey, purchased real property from a bank. As part of the purchase price, the trust gave the bank a purchase money note secured by a deed of trust encumbering the real property. Harvey also signed a guaranty purporting to personally guarantee the secured purchase money note. The trust later defaulted on the note, and the bank's successor-in-interest nonjudicially foreclosed and purchased the real property by credit bid at the foreclosure sale for less than the amount owed on the note, leaving an unpaid balance (the deficiency).
In the present lawsuit, appellant The Cadle Company II (Cadle), assignee of the note and the guaranty, sued Harvey on the guaranty to collect the deficiency. The trial court sustained Harvey's demurrer without leave to amend, concluding the guaranty was a nullity under Torrey Pines Bank v. Hoffman (1991) 231 Cal.App.3d 308, 282 Cal.Rptr. 354 (Torrey Pines).
We conclude the trial court correctly sustained the demurrer to Cadle's claims on the guaranty because, under Torrey Pines, Harvey had no liability on the guaranty separate or independent from his liability on the secured note; Harvey's liability must instead be evaluated by treating Harvey as the principal obligor on the secured note. We further conclude that, although Harvey waived certain antideficiency protections as part of his guaranty, any purported waiver of the protections of Code of Civil Procedure section 580b,[2] which bars deficiency judgments following foreclosure of a purchase money secured obligation, is unenforceable against the principal obligor under DeBerard Properties, Ltd, v. Lim (1999) 20 Cal.4th 659, 85 Cal.Rptr.2d 292, 976 P.2d 843. Because Harvey as principal obligor on the secured note remains entitled to the protections of section 580b and cannot under that section be personally liable for a deficiency following foreclosure of the secured note, Harvey's demurrer to Cadle's attempt to impose personal liability was correctly sustained without leave to amend.


*153 I

FACTUAL BACKGROUND[3]

A. The Secured Note and Guaranty

In November 1990 the trust purchased real property (the property) from San Clemente F.S.B. (Bank), financed by a purchase money loan from Bank to the trust. The loan was represented by a promissory note (the note), payable by the trust to Bank, secured by a deed of trust encumbering the property.
Harvey, the settlor and trustee of the trust, signed a personal guaranty of the note.[4] The guaranty contained certain waivers, including the so-called Gradsky[5] waivers, that specifically waived any defense to the guaranty based on the bank's election of remedies under sections 580d and 726.

B. The Forbearance Agreement

In November 1992 the trust was in default on the loan. Bank's successor-in-interest, The Resolution Trust Corporation (RTC), negotiated a forbearance agreement with Harvey and the trust that restructured the debt. The parties executed a loan modification agreement and associated agreements providing that RTC would forbear from foreclosing on the deed of trust and in exchange the trust and Harvey agreed to amend the note to increase the principal balance owed, adjust the payment schedule, and continue securing the note with the first deed of trust encumbering the property. Harvey also agreed the guaranty bound him in his personal capacity and remained binding notwithstanding the note modifications.

C. The Default and Foreclosure

In November 1993 the trust defaulted on the modified note, and in December 1995 RTC nonjudicially foreclosed on the property. The amount owed on the note was at that time in excess of $2.3 million; RTC bid $1.1 million at the trustee's sale, leaving an unpaid balance in excess of $1.2 million.

D. The Lawsuit

Cadle, alleging it was the assignee of the note and guaranty, filed the present complaint against Harvey for breach of the guaranty and sought to collect the unpaid balance.[6] Harvey's demurrer argued the guaranty was unenforceable as a sham guaranty under Torrey Pines, supra, 231 Cal.App.3d 308, 282 Cal.Rptr. 354 and therefore the antideficiency laws precluded Cadle from stating a claim against Harvey for the deficiency. Cadle argued the guaranty was enforceable because Harvey's reaffirmation of the guaranty as part of the loan modification agreement validly waived the protections of the antideficiency laws. The trial court agreed the guaranty *154 was unenforceable as a sham guaranty under Torrey Pines and sustained the demurrer without leave to amend.

II

ANALYSIS

A. The Trial Court Correctly Sustained the Demurrer Because Harvey Had No Liability on the Guaranty Separate or Independent from His Liability on the Note

Our analysis is controlled by well-established principles. The courts have repeatedly recognized that the antideficiency laws embodied in sections 580a through 580d and 726 reflect a legislative policy that strictly limits the right to recover deficiency judgments for the amount the debt exceeds the value of the security. {Brown v. Jensen (1953) 41 Cal.2d 193, 197, 259 P.2d 425.) The debtor cannot be compelled to waive the antideficiency protections in advance {Freedland v. Greco (1955) 45 Cal.2d 462, 467-468, 289 P.2d 463; Civ.Code, § 2953) because the antideficiency legislation was established for a public reason and cannot be contravened by a private agreement. (Valinda Builders, Inc. v. Bissner (1964) 230 Cal.App.2d 106,112, 40 Cal.Rptr. 735.)
The courts have also recognized that the protections afforded to debtors under the antideficiency legislation do not directly protect guarantors from liability for deficiency judgments. (Consolidated Capital Income Trust v. Khaloghli (1986) 183 Cal.App.3d 107, 112, 227 Cal.Rptr. 879.) Accordingly, if a guarantor expressly waives the protections of the antideficiency laws, a lender may recover the deficiency judgment against the guarantor even though the antideficiency laws would bar the lender from collecting that same deficiency from the primary obligor. (Mariners Sav. & Loan Assn. v. Neil (1971) 22 Cal.App.3d 232, 235-237, 99 Cal. Rptr. 238.)
However, to collect a deficiency from a guarantor, he must be a true guarantor and not merely the principal debtor under a different name. The protections afforded debtors under the antideficiency laws cannot be subverted by artifice (Passanisi v. Merit-McBride Realtors, Inc. (1987) 190 Cal.App.3d 1496, 1508, 236 Cal. Rptr. 59), and a substantial body of law has developed to protect the principal debtor against personal liability in cases in which the principal debtor purports to take on additional liability as a guarantor. Under these circumstances, the courts have concluded the guaranty adds nothing to the primary obligation. (Valinda Builders, Inc. v. Bissner, supra, 230 Cal.App.2d at pp. 110-111, 40 Cal.Rptr. 735; Union Bank v. Dorn (1967) 254 Cal.App.2d 157, 159, 61 Cal.Rptr. 893.) "The correct inquiry ... is whether the purported debtor is anything other than an instrumentality used by the individuals who guaranteed the debtor's obligation, and whether such instrumentality actually removed the individuals from their status and obligations as debtors. [Citation.] Put another way, are the supposed guarantors nothing more than the principal obligors under another name? [Citation.] ... [T]he legislative purpose of the antideficiency law may not be subverted by attempting to separate the primary obligor's interests by making a related entity the debtor while relegating the true principal obligors to the position of guarantors. [Citation.]" (Torrey Pines, supra, 231 Cal.App.3d 308, 320, 282 Cal.Rptr. 354; accord, River Bank America v. Diller (1995) 38 Cal.App.4th 1400, 1420, 45 Cal.Rptr.2d 790.)
Harvey argues the guaranty here was unenforceable as a sham guaranty because he was the primary obligor on the note and therefore his guaranty added nothing to the principal obligation. Civil Code section 2787 defines a true guarantor as one "who promises to answer for the debt ... of another...." (Italics added.) This court in Torrey Pines, supra, 231 Cal.App.3d 308, 282 Cal.Rptr. 354 reviewed numerous cases applying the antideficiency laws in which the separateness of the guarantor and principal obligor was in dispute (id. at pp. 318-319, 282 Cal. *155 Rptr. 354), and concluded that when an intervivos revocable trust is the principal obligor on a debt subject to the antideficiency laws, a guaranty of that debt by the individual who is the trustee and settlor of the trust is ineffective because the individual and the trust are essentially the same; accordingly, the individual is deemed the principal obligor for purposes of applying the antideficiency laws. (Id. at pp. 319-323, 282 Cal.Rptr. 354.) Torrey Pines is indistinguishable from the present case: Harvey was the settlor and trustee of his intervivos revocable trust; the trust was the principal obligor on an obligation governed by the antideficiency laws; and Harvey purported to guarantee that obligation. Torrey Pines compels the conclusion Harvey's guaranty is ineffective because he was the principal obligor on the note, and therefore Cadle's ability to pursue Harvey for a deficiency judgment must be assessed by treating Harvey as the principal obligor on the note.[7](Id. at pp. 323-325, 282 Cal.Rptr. 354.)

B. Because a Principal Obligor Cannot Waive the Protections of Section 580b, Even by a Postorigination Waiver, the Trial Court Correctly Sustained the Demurrer Without Leave to Amend
The core of Cadle's appellate argument is that Harvey waived the protections of the antideficiency laws in his initial guaranty, and that even if a waiver made at loan origination is unenforceable, Harvey's agreement to the loan modification was a knowing and intelligent post origination waiver permitting Cadle to collect the deficiency from Harvey. We must therefore assess whether Harvey as principal obligor validly waived the protections of the antideficiency laws.[8] We conclude that, even assuming Harvey's consent to the loan modification constituted a post origination agreement waiving the protections of the antideficiency laws, DeBerard PropeHies, Ltd v. Lim, supra, 20 Cal.4th 659, 85 Cal.Rptr.2d 292, 976 P.2d 843 holds that a principal obligor cannot validly waive the protections of section 580b even by postorigination agreements. Because the current loan was subject to section 580b and Harvey was entitled to the protections of that section, there was no possibility that Cadle could have amended its complaint to state a valid claim for the deficiency, and therefore it was proper for the court to sustain the demurrer without leave to amend.
In DeBerard, the debtors purchased a shopping center and gave seller a purchase money note secured by a second trust deed. Several years later, debtors were unable to service the debt and they negotiated *156 a loan work-out agreement with the seller. The seller restructured the note, and in exchange the debtors waived the protections of section 580b. However, the debtors were still unable to service the debt, the senior lienholder foreclosed, and the seller as a sold-out junior sued the debtors for the unpaid balance of the purchase money note. The trial court concluded section 580b was waivable and that the debtors had knowingly and intelligently waived that section, and permitted the seller to recover a deficiency judgment. (DeBerard Properties, Ltd. v. Lim, supra, 20 Cal.4th at pp. 662-663, 85 Cal.Rptr.2d 292, 976 P.2d 843.)
On appeal, the DeBerard court concluded that in most situations section 580b cannot be waived by the principal obligor.[9] The court rejected the accreditor's arguments that postorigination agreements that change the terms of the original loan, or that are entered into by sophisticated debtors, provide justification for permitting the debtor to waive section 580b, and disapproved a line of cases holding or suggesting that section 580b could be waived by a post origination agreement. (DeBerard Properties, Ltd. v. Lim, supra, 20 Cal.4th at pp. 667-671, 85 Cal.Rptr.2d 292, 976 P.2d 843.)
The present case is indistinguishable from DeBerard on its material facts and on the controlling law. Because Harvey's modification agreement was ineffective to waive section 580b, it would have been impossible for Cadle to amend its complaint to state a claim against Harvey that would have survived section 580b's bar against a deficiency judgment.

C. The Trial Court Did Not Abuse Its Discretion by Denying Cadle Leave to Amend to State a Claim on the Additional Note[*]

DISPOSITION
The judgment is affirmed. Respondent is entitled to costs on appeal.
BENKE, Acting P.J., and NARES, J., concur.
NOTES
[1]  Pursuant to California Rules of Court, rule 976.1, this opinion is certified for publication with the exception of part II.C.
[2]  All further statutory references are to the Code of Civil Procedure unless otherwise specified.
[3]  Because this matter comes before us from a judgment of dismissal following the sustaining of a demurrer without leave to amend, our factual background accepts as true the facts alleged in the complaint, together with facts that may be implied or inferred from those expressly alleged (Marshall v. Gibson, Dunn & Crutcher (1995) 37 Cal.App.4th 1397, 1403, 44 Cal.Rptr.2d 339) but not the truth of contentions or conclusions of fact or law. (Blank v. Kirwan (1985) 39 Cal.3d 311, 318, 216 Cal.Rptr. 718, 703 P.2d 58.) Additionally, to the extent the factual allegations conflict with the content of the writings attached as exhibits to the complaint, we rely on the contents of the exhibit and treat the pleader's allegations as to its legal effect as surplusage. (Weitzenkorn v. Lesser (1953) 40 Cal.2d 778, 785-786, 256 P.2d 947.)
[4]  Although Harvey originally signed the guaranty in his capacity as trustee of the trust, he later admitted this was in error and confirmed the guaranty was executed in his individual capacity.
[5]  Union Bank v. Gradsky (1968) 265 Cal. App.2d 40, 71 Cal.Rptr. 64.
[6]  The complaint also contained common counts seeking to recover the unpaid balance. However, because we conclude the breach of guaranty claim was properly dismissed, and the common counts are based on the identical set of facts, the common counts were properly dismissed on demurrer. (Hays v. Temple (1937) 23 Cal.App.2d 690, 695, 73 P.2d 1248.)
[7]  Cadle argues Torrey Pines is inapplicable because when Harvey signed the modification agreement he effectively executed a new guaranty of the trust's obligations, and this new guaranty reaffirmed the waivers of the antideficiency protections. However, Cadle does not explain how Harvey's execution of a new guaranty changed his status as the primary obligor on the note, to which this new guaranty added nothing to his extant principal obligation. In Torrey Pines the court concluded that a similar postdefault agreement did not deprive the guarantors of their principal obligor status but was instead relevant only to whether the postorigination waiver of certain protections by a principal obligor effectively waived the protections available to a principal obligor under section 580d. Torrey Pines, supra, 231 Cal.App.3d at pp. 323-325, 282 Cal.Rptr. 354.)
[8]  As previously discussed, the sham guaranty doctrine makes ineffective Harvey's guaranty because the guaranty adds nothing to his liability on the principal obligation, and therefore the trial court correctly sustained the demurrer insofar as Cadle sought to collect on the guaranty. However, a determination that Harvey has no liability separate from his obligations as a principal obligor still leaves a potential for liability as principal obligor. (Torrey Pines, supra, 231 Cal.App.3d at pp. 323-325, 282 Cal.Rptr. 354 [no liability on guaranty but court evaluates whether debtors as principal obligors validly waived section 580d].) Because the demurrer was sustained without leave to amend, we evaluate whether it was error to preclude Cadle the opportunity to plead a claim against Harvey for liability as the principal obligor.
[9]  The single exception to the general rule prohibiting waiver of section 580b, arising under the circumstances described by Spangler v. Memel (1972) 7 Cal.3d 603, 102 Cal.Rptr. 807, 498 P.2d 1055, was recognized and preserved by the DeBerard court. (DeBerard Properties, Ltd. v. Lim, supra, 20 Cal.4th at pp. 666-667, 85 Cal.Rptr.2d 292, 976 P.2d 843.) Cadle does not claim this case falls within the Spangler exception.
[*]   See footnote 1, ante.
