<Page>

                                                                 Exhibit (d)(4)

                                                                   CONFIDENTIAL

November 1, 2002

Gilead Sciences, Inc.
333 Lakeside Drive
Foster City, CA 94404

Attention: John F. Milligan, Ph.D

Dear Sirs:

In connection with the analysis of a possible strategic or financial
transaction (the "Transaction") between Gilead Sciences, Inc. ("Gilead") and
Triangle Pharmaceuticals, Inc. ("Triangle"), Gilead may deliver to Triangle
or its Representatives (as defined below) certain oral and written
Information (as defined below) concerning Gilead and the Transaction, and
Triangle may deliver to Gilead or its Representatives certain oral and
written Information concerning Triangle and the Transaction. Gilead and
Triangle are sometimes referred to herein individually as a "Party" and
collectively as the "Parties."

As used herein, "Information" means (i) all data, reports, analyses,
compilations, studies, interpretations, forecasts, records and other
materials (in whatever form maintained, whether documentary, computer storage
or otherwise) to the extent such materials contain or otherwise reflect
confidential or proprietary information concerning a Party, any of its
subsidiaries or affiliates or the Transaction that such Party or its
Representatives may provide to the other Party or its Representatives in the
course of the evaluation of the Transaction ("Provided Information"), together
with all data, reports, analyses, compilations, studies, interpretations,
forecasts, records or other materials (in whatever form maintained, whether
documentary, computer storage or otherwise) prepared by the other Party or
its Representatives to the extent such materials contain or otherwise reflect
or are based upon any Provided Information or reflect the review of, interest
in, or evaluation of all or any portion of the Transaction ("Derived
Information"), and (ii) the fact that discussions or negotiations are taking
place between Triangle and Gilead concerning the Transaction and all
confidential or proprietary information related thereto with respect to the
Transaction, including the status thereof. As used herein, "Representatives"
means, collectively, the controlled affiliates of a Party and the respective
directors, officers, employees, investment bankers, accountants, attorneys,
financial advisors, lenders and consultants of such Party or its controlled
affiliates. As used herein, the term "person" shall be broadly interpreted to
include, without limitation, any corporation, partnership, trust or
individual.

Each Party hereby agrees to use the Information concerning the other Party
solely for the purpose of evaluating a possible Transaction, that the
Information concerning the other Party will be kept confidential and that the
Party will not disclose any of the Information concerning the other Party in
any manner whatsoever; provided, however, that (i) each Party

<Page>

                                                               November 1, 2002
                                                                    Page 2 of 6


may make disclosure of any such Information concerning the other Party to
which the other Party gives its prior written consent, (ii) each Party may
make disclosure of any Information concerning the other Party in order, based
upon the advice of such Party's counsel, that such disclosure is necessary,
to avoid violating the federal securities and other applicable laws,
regulations and orders; provided that each Party agrees, to the extent
reasonably practicable and legally permissible, to notify the other Party of
any such required disclosure prior to the making of such disclosure and to
cooperate with the other Party, at such other Party's expense, to the extent
it may seek to limit such disclosure; and provided further, that with respect
to disclosure under this clause (ii), each Party will give reasonable advance
notice to the other Party prior to disclosing technical scientific
information included in the Information concerning the other Party and
reasonably cooperate with the other Party to the extent it may seek to limit
such disclosure; (iii) each Party may disclose to its Representatives any
Information concerning the other Party if and to the extent that such
Representatives, in the reasonable judgment of the Party, need to know any
Information concerning the other Party for the purpose of evaluating a
possible Transaction and are informed of the confidential nature of the
Information concerning the other Party and the Party's confidentiality
obligations hereunder; and (iv) neither party shall be permitted to disclose
any Information regarding any proposed Transaction to any third party unless
outside counsel shall have advised such party that it is required to do so
under applicable federal securities laws.

If a Transaction is not consummated or if the other Party so requests, each
Party promptly will return to the other Party all copies of the Provided
Information concerning the other Party in its possession and in the
possession of its Representatives, and will destroy all copies of any Derived
Information concerning the other Party; provided that a Party may keep one
copy of the Information in its legal files for the sole purpose of ensuring
or demonstrating compliance with the obligations contained herein. However,
this Agreement will continue to apply to such Information on the terms set
forth herein. Notwithstanding the return or destruction of any Information
concerning the other Party, or documents or material containing or reflecting
any Information concerning the other Party, each Party and its
Representatives will continue to be bound by its obligations of
confidentiality and other obligations hereunder for the terms specified in
this Agreement.

Neither Party will initiate or maintain contact (except for those contacts
made in the ordinary course of business) in any way relating to the
Information or a possible Transaction with any officer, director,
shareholder, employee or agent of the other Party or its subsidiaries
regarding its business, operations, prospects or finances, except with the
express written consent of the other Party. It is understood that each Party
will arrange for appropriate contacts for due diligence purposes. It is
further understood that all (i) communications regarding a possible
Transaction, (ii) requests for additional information, (iii) requests for
facility tours or management meetings and (iv) discussions or questions
regarding procedures will be submitted or directed to a single designee of
each Party specified in writing by such Party.

This Agreement shall not apply to such of the Information as (i) is or
becomes generally available to the public other than as a result of
unauthorized disclosure by the Party to which the Information is disclosed or
any of its Representatives, (ii) was within the possession of

<Page>

                                                               November 1, 2002
                                                                    Page 3 of 6


the Party to which the Information is disclosed prior to its being furnished
to such Party by or on behalf of the other Party pursuant hereto, provided
that the source of such information was not known by the Party to which the
Information is disclosed to be in violation of a confidentiality agreement
with or other contractual, legal or fiduciary obligation of confidentiality
to the other Party or any other party with respect to such Information, (iii)
becomes available to the Party to which the Information is disclosed on a
nonconfidential basis from a source other than the other Party or any of its
Representatives, provided that such source is not known by the Party to
which the Information is disclosed to be in violation of a confidentiality
agreement with or other contractual, legal or fiduciary obligation of
confidentiality to the other Party or any other party with respect to such
Information, or (iv) was, or is in the future, independently developed by the
Party to which the Information is disclosed or by any of its affiliates
without reliance on the Information concerning the other Party.

Although each Party has endeavored and will endeavor to include in the
Information it discloses to the other Party the information which it believes
to be relevant for the purpose of the other Party's evaluation of a possible
Transaction, each Party (i) acknowledges that neither the other Party  nor
any of its subsidiaries or affiliates or any of its Representatives makes any
representation or warranty (express or implied) as to the accuracy or
completeness of any Information and (ii) agrees to assume full responsibility
for all conclusions it derives from the Information. Each Party shall be
entitled to, and shall, rely solely on representations and warranties made
in any final agreement relating to the Transaction.

In the event that either Party or any person to whom it or its
Representatives transmit Information concerning the other Party becomes
legally compelled (by oral questions, interrogatories, requests for
Information or documents, subpoenas, civil investigative demands or
otherwise) to disclose any such Information, such Party shall provide the
other Party with prompt written notice so that the other Party may seek a
protective order or other appropriate remedy, or both. If, in the absence of
a protective order or other remedy or the receipt of a waiver by the other
Party, such Party or any of its Representatives are nonetheless, based upon
the advice of such Party's counsel, legally compelled to disclose Information
concerning the other Party to any tribunal, such Party or its Representative
may, without liability hereunder, disclose to such tribunal any portion of the
Information concerning the other Party which such Party's counsel advises is
legally required to be disclosed. Each Party shall be entitled to
reimbursement from the other Party for such Party's reasonable expenses,
including the fees and expenses of such Party's counsel, in connection with
any action required of such Party by this paragraph.

Each Party agrees that, for a period of twelve (12) months from the date of
this Agreement (the "Standstill Period"), neither it nor any of its
Representatives acting on its behalf (excluding its investment bankers) who
have knowledge of the discussions regarding the Transaction and access to
material non-public information about Triangle and Gilead, as the case may be
will, without the prior written consent of the other Party's board of
directors: (i) acquire, offer to acquire, or agree to acquire, directly or
indirectly, by purchase or otherwise, any voting securities or direct or
indirect rights to acquire any voting securities of the other Party or any
subsidiary of the other Party, or any assets of the other Party or any
subsidiary


<Page>

                                                               November 1, 2002
                                                                    Page 4 of 6

or division thereof; (ii) make, or in any way participate in, directly or
indirectly, any "solicitation" of "proxies" (as such terms are used in the
rules of the Securities Exchange Commission) to vote, or seek to advise or
influence any person or entity with respect to the voting of, any voting
securities of the other Party, (iii) make any public announcements with
respect to, or submit a proposal for, or offer of (with or without
conditions) any extraordinary transaction involving the other Party or its
securities or assets, (iv) form, join or in any way participate in a "group"
(as defined in Section 13(d)(3) of the Securities Exchange Act of 1934, as
amended) in connection with any of the foregoing or (v) request the other
Party or any of its Representatives, directly or indirectly, to amend or
waive any provision of this paragraph. Notwithstanding anything to the
contrary contained in this Agreement, if, at any time during the Standstill
Period, any person other than a Party or its Representatives (i) commences or
publicly announces a tender offer for at least 50% of the outstanding
capital stock of a Party, (ii) commences or publicly announces a proxy
contest with respect to the election of any directors of a Party, or (iii)
enters into an agreement with a Party contemplating the acquisition (by way
of merger, tender offer or otherwise) of at least 50% of the outstanding
capital stock of such Party or all or substantially all of such Party's
assets, then (in any of such cases) the restrictions applicable to the other
Party, as set forth in this paragraph, shall immediately terminate and cease
to be of any further force or effect.

Notwithstanding any of the above restrictions, nothing shall prohibit the
purchase, holding and/or sale by either Party or its subsidiaries of less
than two percent (2%) of the voting securities of the other Party and/or
other relationships between the Parties in the ordinary course of business
(e.g., licensing and other comparable transactions).

Each Party agrees that neither it, its Representatives who are participating
in negotiations or discussions between the Parties for a possible
Transaction, or its officer(s) primarily responsible for human resources,
employment issues and firm-wide recruiting will at any time from the date of
this Agreement and for a period of one year thereafter, without obtaining the
prior written consent of the other Party, solicit or direct any other person
to solicit for employment with such Party any employee of the other Party so
long as such employee is employed by the other; provided, however, that this
paragraph will not prevent either Party or any Representative of either Party
from: (a) causing to be placed or posted any general advertisement or similar
notice (including any advertisement or notice on such Party's web site) that
is not targeted specifically at employees of the other Party, or soliciting
for employment any employee of the other Party who responds to any such
advertisement or notice; or (b) engaging any recruiting firm or similar
organization to identify or solicit persons for employment on behalf of such
Party, provided that such recruiting firm is not instructed to solicit for
employment employee of the other party or otherwise violate the terms of this
Agreement. Provided also that such Party takes reasonable measures through
its officer(s) primarily responsible for human resources, employment issues
and firm-wide recruiting to prevent the solicitation for employment of such
employees.

Each Party understands and agrees that no contract or agreement providing for
a Transaction with the other Party shall be deemed to exist between the
Parties unless and until a definitive Transaction agreement has been executed
and delivered, and each Party hereby waives, in advance, any claims
(including, without limitation, breach of contract) in connection with a

<Page>

                                                               November 1, 2002
                                                                    Page 5 of 6

possible Transaction with the other Party unless and until the Parties shall
have entered into a definitive Transaction agreement. Each Party also agrees
that unless and until a Transaction agreement between the Parties has been
executed and delivered, the other Party has no legal obligation of any kind
whatsoever with respect to any such Transaction by virtue of this Agreement
or any other written or oral expression with respect to such Transaction
except, in the case of this Agreement, for the matters specifically agreed to
herein. For purposes of this Agreement, the term "Transaction agreement" does
not include the nonbinding provisions of an executed letter of intent or the
nonbinding provisions of any other preliminary written agreement in
principle. Each Party further understands that (i) the other Party shall be
free to conduct the process for a possible Transaction as it in its sole
discretion shall determine, and (ii) the other Party reserves the right, in
its sole and absolute discretion, to reject any and all proposals including,
but not limited to those relating to such process, and to terminate
discussions and negotiations with such Party at any time.

This Agreement shall inure to the benefit of and be binding upon Triangle and
Gilead and their respective successors and permitted assigns.

Each Party agrees that the other Party may be irreparably injured by a breach
of this Agreement by such Party or its Representatives and that the other
Party shall be entitled to seek equitable relief, including injunctive relief
and specific performance, in the event of any breach of the provisions of
this Agreement. Such remedies shall not be deemed to be the exclusive
remedies for a breach of this Agreement by such Party or its Representatives,
but shall be in addition to all other remedies available at law or in equity.

Any assignment of this Agreement by Gilead or Triangle without the prior
written consent of the other Party shall be void.

This Agreement shall cover Information disclosed from the date hereof to May
1, 2003 and this Agreement shall terminate on such date (or such earlier
date, if any, that the Information is returned or destroyed pursuant to the
provisions hereof) but the obligations applicable to the Information
(including, without limitation confidentiality and non-disclosure) shall
survive and continue in full force and effect for a period of five (5) years
from the date hereof and the standstill and non-solicitation obligations set
forth herein shall survive and continue in full force and effect for the
respective periods set forth above.

This Agreement shall be governed by, and construed in accordance with, the
laws of the State of Delaware without regard to its conflicts of laws
provisions.

This Agreement contains the entire agreement between the Parties concerning
confidentiality of the Information concerning each of the Parties and related
matters. No modifications of this Agreement or waiver of the terms and
conditions hereof shall be binding upon the Parties, unless approved in
writing by each of Triangle and Gilead.

No written consent required by this Agreement shall be unreasonably withheld.

<Page>

                                                               November 1, 2002
                                                                    Page 6 of 6

If the foregoing reflects our agreement, kindly sign and return the duplicate
copy of this letter to us.

                                          Sincerely,

                                          TRIANGLE PHARMACEUTICALS, INC.

                                          By:   /s/ ANDREW FINKLE
                                             ---------------------------------
                                                 Exec. VP.


Agreed to as of the date set forth above:

GILEAD SCIENCES, INC.

By:  /s/ JOHN MILLIGAN
   ------------------------------------
     Sr. VP and CFO