GMACM Home Equity Loan Trust 2004-HE4
EX 10.2  NOTE GUARANTY INS. POLICY
<DOCUMENT>
<TYPE>EX-10
<SEQUENCE>6
<FILENAME>he4ins.txt
<DESCRIPTION>EX 10.2  NOTE GUARANTY INS. POLICY
<TEXT>

                         NOTE GUARANTY INSURANCE POLICY


                                                     POLICY NUMBER: 45174
OBLIGATIONS:          $1,018,000,000
GMACM Home Equity Loan Trust 2004-HE4
GMACM Home Equity Loan-Backed Term Notes, Series 2004-HE4
Class A-1, Class A-2 and Class A-3 and GMACM Home Equity Loan- Backed
Variable Pay Revolving Notes, Series 2004-HE4, Class A-1,
Class  A-2  and  Class  A-3 in an  amount  not  to  exceed
$1,018,000,000


        MBIA Insurance  Corporation  (the  "Insurer"),  in  consideration of the
payment of the premium and subject to the terms of this Note Guaranty  Insurance
Policy (this "Policy"), hereby unconditionally and irrevocably guarantees to any
Owner that an amount  equal to each full and  complete  Insured  Amount  will be
received  from the Insurer by Wells  Fargo Bank,  N.A.,  or its  successors,  as
indenture  trustee for the Owners (the  "Indenture  Trustee"),  on behalf of the
Owners,  for distribution by the Indenture Trustee to each Owner of each Owner's
proportionate share of the Insured Amount. The Insurer's  obligations  hereunder
with respect to a particular  Insured  Amount shall be  discharged to the extent
funds equal to the  applicable  Insured  Amount are  received  by the  Indenture
Trustee,  whether  or not those  funds are  properly  applied  by the  Indenture
Trustee. Insured Amounts will be made only at the time set forth in this Policy,
and no accelerated  Insured Amounts will be made regardless of any  acceleration
of the  Obligations,  unless  the  acceleration  is at the  sole  option  of the
Insurer.

        Notwithstanding  the  foregoing  paragraph,  this  Policy does not cover
shortfalls,  if any,  attributable  to the  liability of the Trust Estate or the
Indenture  Trustee  for  withholding  taxes,  if  any  (including  interest  and
penalties in respect of any such liability),  Interest  Shortfalls or Relief Act
Shortfalls.  In addition,  the Policy does not cover any payment of principal on
the Term Notes on any Targeted Final Payment Date.

        The Insurer will pay any Insured  Amount that is a Preference  Amount on
the  Business  Day  following  receipt on a Business Day by the Fiscal Agent (as
described  below) of (a) a certified copy of the order requiring the return of a
preference payment,  (b) an opinion of counsel  satisfactory to the Insurer that
such order is final and not subject to appeal, (c) an assignment in such form as
is reasonably required by the Insurer,  irrevocably assigning to the Insurer all
rights and claims of the Owner  relating  to or  arising  under the  Obligations
against the debtor which made such preference  payment or otherwise with respect
to such  preference  payment  and (d)  appropriate  instruments  to  effect  the
appointment  of the  Insurer  as agent for such  Owner in any  legal  proceeding
related  to  such  preference   payment,   such  instruments  being  in  a  form
satisfactory to the Insurer,  provided that if such documents are received after
12:00 noon,  New York City time, on such Business Day, they will be deemed to be


                                       1
<PAGE>

received on the following  Business Day. Such payments shall be disbursed to the
receiver  or  trustee  in  bankruptcy  named in the  final  order  of the  court
exercising  jurisdiction  on behalf  of the Owner and not to any Owner  directly
unless such Owner has returned  principal or interest paid on the Obligations to
such  receiver or trustee in  bankruptcy,  in which case such  payment  shall be
disbursed to such Owner.

        The Insurer  will pay any other amount  payable  hereunder no later than
12:00 noon,  New York City time,  on the later of the Payment  Date on which the
related Deficiency Amount is due or the second Business Day following receipt in
New York, New York on a Business Day by U.S. Bank Trust National Association, as
Fiscal Agent for the Insurer,  or any  successor  fiscal agent  appointed by the
Insurer (the "Fiscal Agent"), of a Notice (as described below), provided that if
such Notice is received  after 12:00 noon,  New York City time, on such Business
Day, it will be deemed to be received on the following Business Day. If any such
Notice  received  by the  Fiscal  Agent is not in  proper  form or is  otherwise
insufficient for the purpose of making claim  hereunder,  it shall be deemed not
to have been  received by the Fiscal Agent for purposes of this  paragraph,  and
the Insurer or the Fiscal  Agent,  as the case may be, shall  promptly so advise
the Indenture Trustee and the Indenture Trustee may submit an amended Notice.

        Insured Amounts due hereunder,  unless otherwise stated herein,  will be
disbursed by the Fiscal Agent to the  Indenture  Trustee on behalf of the Owners
by wire  transfer of  immediately  available  funds in the amount of the Insured
Amount less, in respect of Insured  Amounts related to Preference  Amounts,  any
amount held by the Indenture  Trustee for the payment of such Insured Amount and
legally available therefor.

        The Fiscal Agent is the agent of the Insurer only,  and the Fiscal Agent
shall in no event be liable to Owners  for any acts of the  Fiscal  Agent or any
failure of the Insurer to deposit, or cause to be deposited, sufficient funds to
make payments due under this Policy.

        Subject to the terms of the  Agreement,  the Insurer shall be subrogated
to the rights of each Owner to receive  payments  under the  Obligations  to the
extent of any payment by the Insurer hereunder.

        As used herein, the following terms shall have the following meanings:

        "Agreement"  means the Indenture dated as of October 28, 2004, among the
GMACM Home Equity Loan Trust 2004-HE4,  as Issuer, and the Indenture Trustee, as
indenture trustee, without regard to any amendment or supplement thereto, unless
such amendment or supplement has been approved in writing by the Insurer.

        "Business Day" means any day other than (a) a Saturday or a Sunday (b) a
day on which the Insurer is closed or (c) a day on which banking institutions in
New  York  City or in the  city in  which  the  corporate  trust  office  of the
Indenture  Trustee under the Agreement is located are authorized or obligated by
law or executive order to close.

        "Deficiency Amount" means with respect to any Payment Date, an amount if
any equal to the sum of (a) the amount by which the aggregate  amount of accrued
interest  on the  Obligations  (excluding  any  Relief Act  Shortfalls  for that
Payment  Date) at the  respective  Note Rates on that  Payment  Date exceeds the
amount  on  deposit  in  the  Note  Payment   Account   available  for  interest
distributions  on that  Payment Date and (b)(i) with respect to any Payment Date
that is not the Final Payment Date, any Liquidation Loss Amount for that Payment
Date, to the extent not distributed as part of the Principal Distribution Amount
to the holders of the Notes on such Payment  Date or deposited  into the Funding
Account as part of the  Principal  Distribution  Amount for such Payment Date or
applied to reduce the Overcollateralization  Amount on such Payment Date or (ii)
on the Final Payment Date, the aggregate  outstanding balance of the Obligations
to the extent otherwise not paid on that date.

                                       2
<PAGE>

         "Insured  Amount"  means (a) as of any  Payment  Date,  any  Deficiency
Amount and (b) any Preference Amount.

        "Notice" means the telephonic or telegraphic notice,  promptly confirmed
in writing by facsimile  substantially in the form of Exhibit A attached hereto,
the original of which is subsequently delivered by registered or certified mail,
from the Indenture Trustee  specifying the Insured Amount which shall be due and
owing on the applicable Payment Date.

        "Owner" means each  Noteholder (as defined in the Agreement) who, on the
applicable  Payment  Date,  is  entitled  under  the  terms  of  the  applicable
Obligations to payment thereunder.

        "Preference Amount" means any amount previously  distributed to an Owner
on the Obligations  that is recoverable and sought to be recovered as a voidable
preference by a trustee in bankruptcy  pursuant to the United States  Bankruptcy
Code (11  U.S.C.),  as  amended  from  time to time in  accordance  with a final
nonappealable order of a court having competent jurisdiction.

        "Relief Act Shortfalls" means current interest shortfalls resulting from
the  application  of the  Servicemembers  Civil  Relief Act, as amended,  or any
similar state legislation or regulations.

        Capitalized  terms used herein and not  otherwise  defined  herein shall
have  the  respective  meanings  set  forth in the  Agreement  as of the date of
execution of this Policy,  without giving effect to any subsequent  amendment to
or modification of the Agreement  unless such amendment or modification has been
approved in writing by the Insurer.

        Any notice  hereunder  or service of process on the Fiscal  Agent may be
made at the address  listed below for the Fiscal Agent or such other  address as
the Insurer shall specify in writing to the Indenture Trustee.

        The notice address of the Fiscal Agent is 15th Floor,  61 Broadway,  New
York, New York 10006, Attention:  Municipal Registrar and Paying Agency, or such
other  address as the Fiscal  Agent shall  specify to the  Indenture  Trustee in
writing.

        THIS  POLICY  IS BEING  ISSUED  UNDER  AND  PURSUANT  TO,  AND  SHALL BE
CONSTRUED UNDER, THE LAWS OF THE STATE OF NEW YORK, WITHOUT GIVING EFFECT TO THE
CONFLICT OF LAWS PRINCIPLES THEREOF.

        The   insurance   provided   by  this  Policy  is  not  covered  by  the
Property/Casualty  Insurance  Security  Fund  specified in Article 76 of the New
York Insurance Law.

        This Policy is not cancelable for any reason. The premium on this Policy
is not refundable for any reason, including payment, or provision being made for
payment, prior to maturity of the Obligations.


                                       3
<PAGE>

        IN WITNESS  WHEREOF,  the  Insurer has caused this Policy to be executed
and attested this 28th day of October 2004.

                                               MBIA INSURANCE CORPORATION


                                               By
                                               Title: President

                                               Attest:


                                               By ______________________________
                                               Title: Assistant Secretary




                                       4
<PAGE>


                                    EXHIBIT A
                           TO NOTE GUARANTY INSURANCE
                              POLICY NUMBER: 45174

                           NOTICE UNDER NOTE GUARANTY
                         INSURANCE POLICY NUMBER: 45174


U.S. Bank Trust National Association, as Fiscal Agent
for MBIA Insurance Corporation
15th Floor
61 Broadway
New York, NY  10006
Attention:  Registrar and
            Paying Agency

MBIA Insurance Corporation
113 King Street
Armonk, NY  10504

        The  undersigned,  a duly  authorized  officer  of  [NAME  OF  INDENTURE
TRUSTEE] as indenture  trustee (the "Indenture  Trustee"),  hereby  certifies to
U.S. Bank Trust  National  Association  (the "Fiscal  Agent") and MBIA Insurance
Corporation  (the "Insurer"),  with reference to Note Guaranty  Insurance Policy
Number:   45174  (the  "Policy")  issued  by  the  Insurer  in  respect  of  the
$1,018,000,000   GMACM  Home  Equity  Loan  Trust  2004-HE4  GMACM  Home  Equity
Loan-Backed  Term Notes,  Series 2004-HE4 Class A-1, Class A-2 and Class A-3 and
GMACM Home Equity Loan- Backed Variable Pay Revolving  Notes,  Series  2004-HE4,
Class  A-1,  Class A-2 and Class A-3 in an amount  not to exceed  $1,018,000,000
(the "Obligations"), that:

               (a) the  Indenture  Trustee is the  indenture  trustee  under the
        Indenture  dated as of October 28, 2004  between  GMACM Home Equity Loan
        Trust  2004-HE4,  as Issuer,  and the  Indenture  Trustee,  as indenture
        trustee for the Owners;

               (b)  the  amount  due  under  clause  (a)  of the  definition  of
        Deficiency Amount for any Payment Date occurring on [ ] (the "Applicable
        Payment Date") is $[ ];

               (c)  the  amount  due  under  clause  (b)  of the  definition  of
        Deficiency Amount for the Applicable Payment Date is $[ ];

               (d) the sum of the amounts listed in paragraphs (b) and (c) above
        is $[ ] (the "Deficiency Amount");

               (e)  the  amount  of  previously   distributed  payments  on  the
        Obligations that is recoverable and sought to be recovered as a voidable
        preference by a trustee in bankruptcy pursuant to the Bankruptcy Code in
        accordance with a final  nonappealable order of a court having competent
        jurisdiction is $[ ] (the "Preference Amount");


<PAGE>

               (f) the total Insured Amount due is $[ ], which amount equals the
        sum of the Deficiency Amount and the Preference Amount;

               (g) the Indenture Trustee is making a claim under and pursuant to
        the terms of the Policy for the dollar amount of the Insured  Amount set
        forth in (d) above to be applied to the payment of the Deficiency Amount
        for the Applicable Payment Date in accordance with the Agreement and for
        the  dollar  amount of the  Insured  Amount set forth in (e) above to be
        applied to the payment of any Preference Amount; and

               (h) the  Indenture  Trustee  directs  that payment of the Insured
        Amount be made to the following account by bank wire transfer of federal
        or other immediately available funds in accordance with the terms of the
        Policy: [INDENTURE TRUSTEE'S ACCOUNT NUMBER].

        Any  capitalized  term used in this  Notice  and not  otherwise  defined
herein shall have the meaning assigned thereto in the Policy.

Any Person Who  Knowingly  And With Intent To Defraud Any  Insurance  Company Or
Other Person Files An Application For Insurance Or Statement Of Claim Containing
Any  Materially  False  Information,  Or Conceals For The Purpose Of Misleading,
Information Concerning Any Fact Material Thereto, Commits A Fraudulent Insurance
Act,  Which Is A Crime,  And Shall  Also Be Subject  To A Civil  Penalty  Not To
Exceed Five  Thousand  Dollars  And The Stated  Value Of The Claim For Each Such
Violation.

        IN WITNESS  WHEREOF,  the  Indenture  Trustee has executed and delivered
this Notice under the Policy as of the [ ] day of [ ], [ ].

                                 [NAME OF INDENTURE TRUSTEE], as Indenture
                                 Trustee


                                 By _____________________________
                                 Title

<PAGE>

</TEXT>
</DOCUMENT>
