<PAGE>
                                                                     EXHIBIT 4.5

                                              Ambac Assurance Corporation
                                              One State Street Plaza, 15th Floor
                                              New York, New York 10004
                                              Telephone: (212) 668-0340

[AMBAC LOGO]

CERTIFICATE GUARANTY INSURANCE POLICY

Insured Obligations:                                   Policy Number: AB0777BE

Sequoia HELOC Trust 2004-1
$317,044,000 HELOC Asset-Backed Notes,
Series 2004-1

                                                   Premium: As specified in the
                                                            Insurance Agreement.

AMBAC ASSURANCE CORPORATION (AMBAC), a Wisconsin stock insurance corporation, in
consideration of the payment of the premium and subject to the terms of this
Policy, hereby agrees unconditionally and irrevocably to pay to the Trustee for
the benefit of the Holders of the Insured Obligations, that portion of the
Insured Amounts which shall become Due for Payment but shall be unpaid by reason
of Nonpayment.

Ambac will make such payments to the Trustee from its own funds on the later of
(a) one (1) Business Day following notification to Ambac of Nonpayment or (b)
the Business Day on which the Insured Amounts are Due for Payment. Such payments
of principal or interest shall be made only upon presentation of an instrument
of assignment in form and substance satisfactory to Ambac, transferring to Ambac
all rights under such Insured Obligations to receive the principal of and
interest on the Insured Obligation. Ambac shall be subrogated to all the
Holders' rights to payment on the Insured Obligations to the extent of the
insurance disbursements so made. Once payments of the Insured Amounts have been
made to the Trustee, Ambac shall have no further obligation hereunder in respect
of such Insured Amounts.

In the event the Trustee for the Insured Obligations has notice that any payment
of principal or interest on an Insured Obligation which has become Due for
Payment and which is made to a Holder by or on behalf of the Trustee has been
deemed a preferential transfer and theretofore recovered from its Holder
pursuant to the United States Bankruptcy Code in accordance with a final,
nonappealable order of a court of competent jurisdiction, such Holder will be
entitled to payment from Ambac to the extent of such recovery if sufficient
funds are not otherwise available.

This Policy is noncancelable by Ambac for any reason, including failure to
receive payment of any premium due hereunder. The premium on this Policy is not
refundable for any reason. This Policy does not insure against loss of any
prepayment or other acceleration payment which at any time may become due in
respect of any Insured Obligation, other than at the sole option of Ambac, nor
against any risk other than Nonpayment, including failure of the Trustee to make
any payment due Holders of Insured Amounts.

To the fullest extent permitted by applicable law, Ambac hereby waives and
agrees not to assert any and all rights and defenses, to the extent such rights
and defenses may be available to Ambac, to avoid payment of its obligations
under this Policy in accordance with the express provisions hereof.

Any capitalized terms not defined herein shall have the meaning given such terms
in the endorsement attached hereto or in the Agreement.

In witness whereof, Ambac has caused this Policy to be affixed with its
corporate seal and to be signed by its duly authorized officers in facsimile to
become effective as their original signatures and binding upon Ambac by virtue
of the countersignature of its duly authorized representative.

/s/ [ILLEGIBLE]                                 /s/ [ILLEGIBLE]
--------------------------   [CORPORATE SEAL]   ---------------------------
   President                                       Secretary

                                              /s/ [ILLEGIBLE]
                                              ----------------------------
                                                 Authorized Representative
 Effective Date:    June 29, 2004

<PAGE>

          CERTIFICATE GUARANTY INSURANCE POLICY ENDORSEMENT

Attached to and forming part of                   Effective Date of Endorsement:
Certificate Guaranty Insurance Policy                              June 29, 2004
#AB077BE issued to:

Wells Fargo Bank, N.A.,
as Indenture Trustee for the Holders of
Sequoia HELOC Trust 2004-1
HELOC Asset-Backed Notes, Series 2004-1

         For all purposes of this Policy, the following terms shall have the
following meanings:

         "Agreements" shall mean, for purposes of the Policy, the Indenture and
the Servicing Agreement.

         "Available Funds" shall have the meaning assigned to such term in the
Indenture.

         "Business Day" shall mean any day other than (i) a Saturday or Sunday,
(ii) a day on which banking institutions in the state of New York, the state of
California or the state in which the Corporate Trust Office is located are
required or authorized by law or executive order to be closed of (iii) a day on
which the Insurer is closed.

         "Deficiency Amount" means with respect to the Notes, the sum of (i) for
any Payment Date the excess, if any, of (a) the Interest Payment Amount
(excluding any Relief Act Shortfalls, any interest shortfalls resulting from
prepayments on the Mortgage Loans and any Deferred Interest) over (b) the
portion of the Available Funds for such Payment Date remaining after payment of
the Indenture Trustee Fee, the Premium Amount and the Owner Trustee Fee, in each
case, for such Payment Date, such portion being (x) during the Managed
Amortization Period, the pro rata portion of such remaining Available Funds
based on the pari passu application of such amount to the Interest Payment
Amount and to interest on any Additional Balance Contributed Amount at the
Contribution Rate on such Payment Date and (y) after the Managed Amortization
Period, all such remaining Available Funds, (ii) for any Payment Date other than
the Final Scheduled Payment Date, the Overcollateralization Deficit, if any, for
such Payment Date remaining after giving effect to payments pursuant to Section
8.7(b)(vii) of the Indenture on such Payment Date and (iii) on the Final
Scheduled Payment Date, the outstanding principal balance of the Notes then
outstanding, after taking into account all payments to be made to the Notes on
the Final Scheduled Payment Date other than pursuant to the Policy.

         "Distribution Account" shall mean the account created and maintained
with the Indenture Trustee for the benefit of the Holders and the Insurer
pursuant to Section 8.3 of the Indenture.

<PAGE>

         "Due for Payment" shall mean, (i) with respect to an Insured Amount,
the Payment Date on which Insured Amounts are due and payable pursuant to the
terms of the Indenture and (ii) with respect to a Preference Amount, the
Business Day on which the documentation required by the Insurer has been
received by the Insurer.

         "Final Scheduled Payment Date" shall mean the Payment Date occurring in
December 2014.

         "First Payment Date" shall mean July 20, 2004.

         "Holder" shall mean the registered owner or beneficial owner of a Note,
but shall not include the Issuer, the Indenture Trustee, the Owner Trustee, the
Servicer, the Originator, the Seller or the Depositor.

         "Indenture" shall mean the Indenture between the Issuer and the
Indenture Trustee, dated June 1, 2004.

         "Indenture Trustee" shall mean Wells Fargo Bank, N.A., or its
successor-in-interest, in its capacity as Indenture Trustee under the Indenture,
or if any successor trustee shall be appointed as provided therein, then
"Indenture Trustee" shall also mean such successor trustee, subject to the
provisions thereof.

         "Insurance Agreement" shall mean the Insurance and Indemnity Agreement,
dated as of June 29, 2004, among Sequoia Mortgage Funding Corporation, as
Depositor, RWT Holdings, Inc., as Seller, Wells Fargo Bank, N.A., as Indenture
Trustee, the Insurer, and Sequoia HELOC Trust 2004-1, as Issuer, as such
agreement may be amended, modified or supplemented from time to time.

         "Insured Amounts" shall mean, with respect to any Payment Date, the
Deficiency Amount for such Payment Date.

         "Insured Payments" shall mean, with respect to any Payment Date, the
aggregate amount actually paid by the Insurer to the Indenture Trustee in
respect of (i) Insured Amounts for a Payment Date and (ii) Preference Amounts
for any given Business Day.

         "Insurer" shall mean Ambac Assurance Corporation, or any successor
thereto, as issuer of this Policy.

         "Issuer" means Sequoia HELOC Trust 2004-1.

         "Late Payment Rate" shall mean for any Payment Date, the lesser of (i)
the greater of (a) the rate of interest, as it is publicly announced by
Citibank, N.A. at its principal office in New York, New York as its prime rate
(any change in such prime rate of interest to be effective on the date such
change is announced by Citibank, N.A.) plus 2% and (b) the then applicable
highest rate of interest on the Notes and (ii) the maximum rate permissible
under applicable usury or similar laws limiting interest rates. The Late

                                       2
<PAGE>

Payment Rate shall be computed on the basis of the actual number of days elapsed
over a year of 360 days.

         "Nonpayment" shall mean, with respect to any Payment Date, an Insured
Amount is Due for Payment but has not been paid pursuant to the Indenture.

         "Notes" shall mean any one of the HELOC Asset-Backed Notes, Series
2004-1, substantially in the form set forth in Exhibit A to the Indenture.

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

         "Payment Date" shall mean the 20th day of any month (or if such 20th
day is not a Business Day the first Business Day immediately following)
beginning with the First Payment Date.

         "Policy" shall mean this Certificate Guaranty Insurance Policy together
with each and every endorsement hereto.

         "Preference Amount" shall mean any payment of principal or interest
previously distributed to a Holder on a Note, which would have been covered
under the Policy as an Insured Amount, which has been deemed a preferential
transfer and was previously recovered from its owner pursuant to the United
States Bankruptcy Code in accordance with a final, non-appealable order a court
of competent jurisdiction.

         "Reimbursement Amount" shall mean, as to any Payment Date, the sum of
(x) (i) all Insured Payments paid by the Insurer, but for which the Insurer has
not been reimbursed prior to such Payment Date pursuant to Section 8.7(b)(viii)
of the Indenture, plus (ii) interest accrued on such Insured Payments not
previously repaid, calculated at the Late Payment Rate from the date the
Indenture Trustee received the related Insured Payments, and (y) without
duplication (i) any amounts then due and owing to the Insurer under the
Insurance Agreement, as certified to the Indenture Trustee by the Insurer plus
(ii) interest on such amounts at the Late Payment Rate.

         "Relief Act Shortfalls" shall mean interest shortfalls resulting from
the application of the Servicemembers Relief Act, as amended, or any similar
state law.

         "Sale and Servicing Agreement" shall mean the Sale and Servicing
Agreement, dated as of June 1, 2004 among Sequoia Mortgage Funding Corporation,
as Depositor, RWT Holdings, Inc., as Seller, Morgan Stanley Dean Witter Credit
Corporation, as Servicer, the Indenture Trustee and the Issuer, as such
agreement may be amended, modified or supplemented from time to time as set
forth in the agreement.

         "Trustee" shall mean, for purposes of this Policy, the Indenture
Trustee.

                                       3
<PAGE>

         "Trust Agreement" shall mean the Trust Agreement, dated as of June 1,
2004, between Sequoia Mortgage Funding Corporation, as Depositor, and Wilmington
Trust Company, as Owner Trustee.

         Capitalized terms used herein as defined terms and not otherwise
defined herein shall have the meaning assigned to them in the Insurance
Agreement and the Agreements, without regard to any amendment or modification
thereof, unless such amendment or modification has been approved in writing by
the Insurer.

         Notwithstanding any other provision of the Policy, the Insurer will pay
any Insured Amount payable hereunder no later than 12:00 noon, New York City
time, on the later of (i) the Payment Date on which the related Insured Amount
is Due for Payment and (ii) the third Business Day following receipt in New
York, New York on a Business Day by the Insurer of a Notice at the address and
in the manner provided in Section 6.02 of the Insurance Agreement; provided
that, if such Notice is received after 12:00 noon, New York City time, on such
Business Day, it shall be deemed to be received on the following Business Day.
If any such Notice is not in proper form or is otherwise insufficient for the
purpose of making a claim under the Policy, it shall be deemed not to have been
received for purposes of this paragraph, and the Insurer shall promptly so
advise the Indenture Trustee and the Indenture Trustee may submit an amended or
corrected Notice.

         The Insurer will pay any Preference Amount when due to be paid pursuant
to the Order (as defined below), but in any event no earlier than the third
Business Day following receipt by the Insurer of (i) a certified copy of a
final, non-appealable order of a court or other body exercising jurisdiction in
such insolvency proceeding to the effect that the Indenture Trustee, or Holder,
as applicable, is required to return such Preference Amount paid during the term
of this Policy because such payments were avoided as a preferential transfer or
otherwise rescinded or required to be restored by the Indenture Trustee or
Holder (the "Order"), (ii) a certificate by or on behalf of the Indenture
Trustee or Holder that the Order has been entered and is not subject to any
stay, (iii) an assignment, in form and substance satisfactory to the Insurer,
duly executed and delivered by the Indenture Trustee or Holder, irrevocably
assigning to the Insurer all rights and claims of the Indenture Trustee or
Holder relating to or arising under the Indenture and the Servicing Agreement
against the estate of the Indenture Trustee or otherwise with respect to such
Preference Amount and (iv) a Notice (in the form attached hereto as Exhibit A)
appropriately completed and executed by the Indenture Trustee; 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 received on the following Business Day;
provided, further, that the Insurer shall not be obligated to make any payment
in respect of any Preference Amount representing a payment of principal on the
Notes prior to the time the Insurer would have been required to make a payment
in respect of such principal pursuant to the first paragraph of the face of this
Policy. Such payment shall be disbursed to the receiver, conservator,
debtor-in-possession or trustee in bankruptcy named in the Order, and not to the
Holder directly, unless the Holder has made a payment of the Preference Amount
to the court or such receiver, conservator, debtor-in-possession or trustee in
bankruptcy named in the Order, in which case the Insurer will pay the Holder,

                                       4
<PAGE>

subject to the delivery of (a) the items referred to in clauses (i), (ii), (iii)
and (iv) above to the Insurer and (b) evidence satisfactory to the Insurer that
payment has been made to such court or receiver, conservator,
debtor-in-possession or trustee in bankruptcy named in the Order.

         The Insurer shall be subrogated to the rights of each Holder to the
extent of any payment by the Insurer under the Policy.

         The Insurer hereby agrees that if it shall be subrogated to the rights
of Holders by virtue of any payment under this Policy, no recovery of such
payment will occur unless the full amount of the Holders' allocable
distributions for such Payment Date can be made. In so doing, the Insurer does
not waive its rights to seek full payment of all Reimbursement Amounts owed to
it under the Insurance Agreement and Agreements.

         This Policy does not cover Deferred Interest, Relief Act Shortfalls or
interest shortfalls due to the partial or full prepayment of the Mortgage Loans,
nor does the Policy guarantee to the Holders of the Notes any particular rate of
principal payment. In addition, the Policy does not cover shortfalls, if any,
attributable to the liability of the Issuer, the Indenture Trustee or any
Noteholder for withholding taxes, if any, (including interest and penalties in
respect of any liability for withholding taxes) or any risk other than
Nonpayment, including the failure of the Indenture Trustee to make any payment
required under the Indenture to the Note holders.

         The terms and provisions of the Indenture constitute the instrument of
assignment referred to in the second paragraph of the face of this Policy.

         A premium will be payable on this Policy on each Payment Date as
provided in Section 8.7(b)(ii) of the Indenture, beginning with the First
Payment Date, in an amount equal to the Premium Amount.

         THE INSURANCE PROVIDED BY THE POLICY IS NOT COVERED BY THE
PROPERTY/CASUALTY INSURANCE SECURITY FUND SPECIFIED IN ARTICLE 76 OF THE NEW
YORK INSURANCE LAWS.

         The Policy to which this endorsement is attached and of which it forms
a part is hereby amended to provide that there shall be no acceleration payment
due under the Policy unless such acceleration is at the sole option of the
Insurer.

         Nothing herein contained shall be held to vary, alter, waive or extend
any of the terms, conditions, provisions, agreements or limitations of the above
mentioned Policy other than as above stated.

         To the extent the provisions of this endorsement conflict with the
provisions in the above-mentioned Policy, the provisions of this endorsement
shall govern.

                                       5
<PAGE>

         This Policy and the obligations of the Insurer thereunder will
terminate without any action on the part of the Insurer or any other person on
the date that is one year and one day following the earlier to occur of (i) the
date on which all amounts required to be paid on the Notes have been paid in
full and (ii) the Final Scheduled Payment Date. Upon termination of the Policy,
the Indenture Trustee shall deliver the original of the Policy to the Insurer.

         No person other than the Indenture Trustee shall be entitled to present
the Notice.

         No waiver of any rights or powers of the Insurer, the Holders or the
Indenture Trustee or consent by any of them shall be valid unless signed by an
authorized officer or agent thereof.

         This Policy is issued under and pursuant to, and shall be construed in
accordance with, the laws of the State of New York, without giving effect to the
conflict of laws principles thereof.

                                       6
<PAGE>

         IN WITNESS WHEREOF, Ambac Assurance Corporation has caused this
endorsement to the Policy to be signed by its duly authorized officers

/s/ [ILLEGIBLE]                                 /s/ [ILLEGIBLE]
  -------------------                           -------------------
  Name :[ILLEGIBLE]                             Name :[ILLEGIBLE]

  Title : Assistant Secretary                   Title: First Vice President

                                       7
<PAGE>

                                    EXHIBIT A
                        TO THE GUARANTY INSURANCE POLICY
                               Policy No. AB077BE

                         NOTICE OF NONPAYMENT AND DEMAND
                         FOR PAYMENT OF INSURED AMOUNTS

                                                             Date: [           ]

Ambac Assurance Corporation
One State Street Plaza
New York, New York 10004
Attention: General Counsel

                  Reference is made to Certificate Guaranty Insurance Policy No.
AB077BE (the "Policy") issued by Ambac Assurance Corporation ("Ambac"). Terms
capitalized herein and not otherwise defined shall have the meanings specified
in the Policy and the Indenture, dated as of June 1, 2004, between Sequoia HELOC
Trust 2004-1, as Issuer and Wells Fargo Bank, N.A., as Indenture Trustee, as the
case may be, unless the context otherwise requires.

                  The Indenture Trustee hereby certifies as follows:

         1.       The Indenture Trustee is the Indenture Trustee under the
                  Indenture for the Holders.

         2.       The relevant Payment Date is [date].

         3.       Payment on the Notes in respect of the Payment Date is due to
                  be received on______________________________________under the
                  Indenture in an amount equal to $______________.

         4.       There is an [Insured Amount] [Preference Amount] of
                  $__________________________________ in respect of the Notes,
                  which amount is Due for Payment pursuant to the terms of the
                  Indenture.

         5.       The Indenture Trustee has not heretofore made a demand for the
                  Insured Amount in respect of the Payment Date.

         6.       The Indenture Trustee hereby requests the payment of the
                  [Insured Amount] [Preference Amount] that is Due For Payment
                  be made by Ambac under the Policy and directs that payment
                  under the Policy 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
                  to:_______________________________________________(Indenture
                  Trustee's account number).

                                       A-1

<PAGE>

         7.       The Indenture Trustee hereby agrees that, following receipt of
                  the [Insured Amount] [Preference Amount] from Ambac, it shall
                  (a) hold such amounts in trust and apply the same directly to
                  the distribution of payment on the Notes when due; (b) not
                  apply such funds for any other purpose; (c) deposit such funds
                  to the Policy Payment Account and not commingle such funds
                  with other funds held by Indenture Trustee and (d) maintain an
                  accurate record of such payments with respect to each
                  certificate and the corresponding claim on the Policy and
                  proceeds thereof.

                  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.

                                         BY_____________________________
                                           Identure Trustee
                                         Title:_________________________
                                               (Officer)

                                       A-2