<PAGE>

                                                                    EXHIBIT 10.4

                            NONCOMPETITION AGREEMENT

      This Noncompetition Agreement ("Agreement") is made and entered into this
28th day of July, 2005, by and between MediaDefender, Inc., a Delaware
corporation (the "Company"), and Octavio Herrera ("Executive").

                                    RECITALS:

      A. The Company is a leading provider of anti-piracy solutions in the
Internet piracy prevention industry (the "IPP Business");

      B. The Company, ARTISTdirect, Inc., a Delaware corporation ("Parent"), and
ARTISTdirect Merger Sub, Inc., a Delaware corporation and wholly-owned
subsidiary of Parent ("Merger Sub"), entered into that certain Agreement and
Plan of Merger dated as of the date hereof (the "Merger Agreement"), pursuant to
which Merger Sub was merged with and into the Company (the "Merger");

      C. Prior to consummation of the Merger, Executive served as the Company's
Chief Financial Officer; and

      D. As a condition to Parent entering into the Merger Agreement, Parent has
requested that the Executive agree, and the Executive has agreed, to enter into
this Noncompetition Agreement.

      NOW, THEREFORE, the parties hereby agree as follows:

      1. Noncompetition Obligations. For purposes of this Agreement, the term
"Restricted Period" shall mean the period beginning on the date of this
Agreement and ending on the four (4)-year anniversary. In consideration of a
cash payment of $525,000, to be paid on December 31, 2006 (the "Noncompetition
Lump Sum Consideration") and other valuable consideration (collectively, the
"Noncompetition Consideration"), Executive expressly covenants and agrees that
during the Restricted Period, Executive will not, directly or indirectly, on
behalf of any other person, firm, limited liability company, partnership or
corporation, as owner, employee, creditor, consultant or otherwise, engage in
any aspect of the IPP Business in the United States or other locations where the
Company or Parent may then be conducting the IPP Business (the "Territory");
provided, however, the beneficial ownership of less than five percent (5%) of
the shares of stock of any publicly traded entity shall not be deemed to
constitute a violation of this provision.

      2. Customer Non-Solicitation. Executive expressly covenants and agrees
that during the Restricted Period, Executive will not solicit, divert, take
away, or attempt to solicit, divert or take away, any of the Company's or
Parent's customers or the business or patronage of any such customers, either
for himself or on behalf of any other person, firm, partnership, limited
liability company or corporation within the Territory; provided, however, that
this Section 2 shall not prohibit Executive from soliciting such customers with
respect to business that is non-competitive with the IPP Business.

                                       -1-
<PAGE>

      3. Executive Non-Solicitation. Executive expressly covenants and agrees
that during the Restricted Period, Executive will not solicit, recruit or hire
any other employee of the Company or Parent, either for himself or on behalf of
any other person, firm, partnership, limited liability company or corporation.

      4. Confidential Information.

            4.1 Definition of Confidential Information. The Company is in the
IPP Business and has built up and established a positive reputation in the
industry. The Company has developed and continues to develop commercially
valuable technical and non-technical information ("Confidential Information")
that is proprietary and confidential and/or constitutes the Company's "trade
secrets." Such Confidential Information, which is vital to the success of the
Company's business, includes, but is not necessarily limited to: system
documentation, data compilations, software and related codes or formulas,
manuals, methods, techniques, processes, customers, prospective customers,
suppliers, prospective suppliers, contracts with suppliers and customers, sales
proposals, methods of sales, marketing research and data, pricing policies, cost
information, financial information, business plans, specialized requests of the
Company's customers, and other materials and documents developed by the Company.
Confidential Information does not include, however, information which (i) is or
becomes generally available to the public other than as a result of a disclosure
by Executive, (ii) was available to Executive on a non-confidential basis prior
to its disclosure by the Company, or (iii) becomes available to Executive on a
non-confidential basis from a person other than the Company who is not otherwise
bound by a confidentiality agreement with the Company, or is not otherwise
prohibited from transmitting the information to Executive.

            4.2 Nondisclosure of Confidential Information. Executive shall not
at any time during the Restricted Period (i) directly or indirectly, disclose or
divulge any Confidential Information to any person not then employed by the
Company, unless authorized or directed by the Company or ordered by a
governmental agency or court order or (ii) appropriate any Confidential
Information for use other than performance of Executive's duties hereunder. If
the Company authorizes or directs Executive to disclose Confidential Information
to any such third party, Executive must ensure that a signed confidentiality
agreement is or has been obtained from the third party to whom Confidential
Information is being disclosed and that all Confidential Information so
disclosed is clearly marked "Confidential."

            4.3 Return of Confidential and Other Information. All Confidential
Information provided to Executive, and all documents and things prepared by
Executive in the course of Executive's employment, including but not necessarily
limited to correspondence, manuals, letters, notes, lists, notebooks, reports,
flow-charts, proposals, daytimers, planners, calendars, schedules, discs,
financial plans and information, business plans, and other documents and
records, whether in hard copy or otherwise, and any and all copies thereof, are
the exclusive property of the Company and shall be returned immediately to the
Company upon termination of employment or upon the Company's request at any
time.

                                       -2-
<PAGE>

      5. Enforcement.

            5.1 Reasonableness of Restrictions. Executive acknowledges that
compliance with this Agreement is reasonable and necessary to protect the
Company's and Parent's legitimate business interests, including but not limited
to, the Company's goodwill and maintaining the confidentiality of the Company's
confidential information.

            5.2 Irreparable Harm. Executive acknowledges and agreed that a
breach of Executive's obligations under this Agreement will result in great,
irreparable and continuing harm and damage to the Company for which there is no
adequate remedy at law. Executive further acknowledges and agrees that a breach
by the Executive of this Agreement, including its covenants, can not be
reasonably or adequately compensated in damages in any action at law. The
Noncompetition Consideration does not quantify the actual damage that the
Company will incur if Executive breaches this Agreement. Indeed, the Executive
and the Company agree that it is impossible to quantify the actual damage that
the Company will incur if Executive breaches the Agreement.

            5.3 Injunctive Relief. Executive agrees that in the event Executive
breaches this Agreement, the Company and/or Parent shall be entitled to seek,
from any court of competent jurisdiction, preliminary and permanent injunctive
relief to enforce the terms of this Agreement, in addition to any and all
monetary damages allowed by law, against Executive. However, no remedy conferred
by any of the specific provisions of this Agreement is intended to be exclusive
of any other remedy, and each and every remedy shall be cumulative and shall be
in addition to every other remedy given hereunder or now or hereafter existing
at law or in equity or by statute or otherwise. The election of any one or more
remedies by the Company shall not constitute a waiver of its right to pursue any
other available remedy.

            5.4 Judicial Modification. The parties expressly agree that the
character, duration and geographical scope of such provisions in this Agreement
are reasonable in light of the circumstances as they exist on the date upon
which this Agreement has been executed. The parties have attempted to limit the
Executive's right to compete only to the extent necessary to protect the
Company's and Parent's goodwill, proprietary and/or confidential information,
and other business interests. The parties recognize, however, that reasonable
people may differ in making such a determination. Consequently, the parties
hereby agree that a court having jurisdiction over the enforcement of this
Agreement shall exercise its power and authority to reform Executive's covenants
under Sections 1 through 4 above to the extent necessary to cause the
limitations contained therein as to time, geographic area and scope of activity
to be restrained to be reasonable and to impose a restraint that is not greater
than necessary to protect the Company's and Parent's goodwill, confidential
information, and other business interests.

            5.5 Legal Fees. In the event of any action in law or in equity for
the purposes of enforcing any of the provisions of this Agreement, the
prevailing party as determined by the trier of fact shall be entitled to recover
its reasonable attorney fees, plus court costs and expenses, from the other
party, to the extent permitted by applicable law.

                                       -3-
<PAGE>

      6. Miscellaneous.

            6.1 Noncompetition Lump Sum Consideration. In the event Executive
has violated the provisions of Sections 1, 2, 3 or 4 of this Agreement, the
Company shall not be obligated to pay the Noncompetition Lump Sum Consideration
to Executive.

            6.2 Waiver; Amendment. This Agreement may be amended, superseded,
canceled, renewed or extended, and the terms hereof or thereof may be waived,
only by a written instrument signed by each of the parties hereto or, in the
case of a waiver, by the party waiving compliance. The failure of a party to
insist, in any one or more instances, upon performance of the terms or
conditions of this Agreement shall not be construed as a waiver or
relinquishment of any right granted hereunder or of the future performance of
any such term, covenant or condition. No waiver on the part of any party of any
right, power or privilege, nor any single or partial exercise of any such right,
power or privilege, shall preclude any further exercise thereof or the exercise
of any other such right, power or privilege.

            6.3 Agreement Binding. This Agreement shall be binding upon and
inure to the benefit of the Company, the Company's successors, legal
representatives and assigns; Executive and Executive's heirs, executors,
administrators and legal representatives.

            6.4 Governing Law. This Agreement is made and entered into in the
State of California and concerns employment situated in said state. This
Agreement shall be interpreted and construed in accordance with the laws of the
State of California.

            6.5 Entire Agreement. This Agreement, together with that certain
Employment, Confidentiality and Noncompetition Agreement between the Company and
Executive, dated as of the date hereof (the "Employment Agreement"), contains
all the understandings and agreements between the parties concerning matters set
forth in this Agreement. The terms of this Agreement and the Employment
Agreement supersede any and all prior statements, representations and agreements
by or between the Company and Executive, or either of them, concerning the
matters set forth in this Agreement or the Employment Agreement.

            6.6 Counterparts. This Agreement may be executed in one (1) or more
counterparts, which when so executed shall constitute one (1) and the same
agreement. Facsimile signatures attached to this Agreement shall be as valid and
binding as original signatures. The headings herein are for reference only and
shall not affect the interpretation of this Agreement.

            6.7 Notices. Any notice or communication required or permitted by
this Agreement shall be deemed sufficiently given if in writing and, if
delivered personally, when it is delivered or, if delivered in another manner,
the earlier of when it is actually received by the party to whom it is directed
or when the period set forth below expires (whether or not it is actually
received): (i) if deposited with the U.S. Postal Service, postage prepaid, and
addressed to the party to receive it as set forth below, forty-eight (48) hours
after such deposit as registered or certified mail; or (ii) if accepted by
Federal Express or a similar delivery service in general usage for delivery to
the address of the party to receive it as set forth next below, twenty-four (24)
hours after the delivery time promised by the delivery service. Notices should
be addressed

                                       -4-
<PAGE>

as follows, or to such other address or to the attention of such other person as
the recipient party will have specified by prior written notice to the sending
party:

                  To The Company:

                  MediaDefender, Inc.
                  Attn:
                  4505 Glencoe Avenue
                  Marina Del Rey, California 90292
                  Facsimile: (310) 306-9869

                  With copies to:

                  ARTISTdirect, Inc.
                  Attn: Robert Weingarten
                  10900 Wilshire Boulevard
                  Los Angeles, CA  90024
                  Facsimile: (310) 443-5361

                  To Executive:

                  Randy Saaf
                  13428 Maxella Avenue, #742
                  Marina Del Rey, California 90292
                  Facsimile: (310) 306-9869

                [Reminder of this page left blank intentionally.]

                                       -5-
<PAGE>

      IN WITNESS WHEREOF, the parties have set their hands as of the date first
above written, and Executive acknowledges that he has read and understands the
entire contents of this Agreement and that he has received a copy of this
Agreement.

                                               "COMPANY"

                                               MediaDefender, Inc.

                                               By: /s/ Randy Saaf
                                                   -----------------------------
                                               Name:  Randy Saaf

                                               Title: Chief Executive Officer

                                               "EXECUTIVE"

                                               /s/ Octavio Herrera
                                               -----------------------------
                                               Octavio Herrera

Acknowledged by:

"PARENT"

ARTISTdirect, Inc.

By: /s/ Robert N. Weingarten
    --------------------------------
Name: Robert N. Weingarten

Title: Chief Financial Officer

                            Noncompetition Agreement