<PAGE>

                                                                    EXHIBIT 10.4

                                    AGREEMENT

THIS AGREEMENT made and entered into this      day of           , 19    by and
                                          -----       ----------    --
between CMAC INVESTMENT CORPORATION, a corporation organized and existing under
the laws of the state of Delaware (hereinafter referred to as the "Company") and
                           (hereinafter referred to as the "Employee").
--------------------------

WHEREAS, the Employee is presently employed by the Company as its VICE PRESIDENT

FOR HUMAN RESOURCES AND ADMINISTRATION; and

WHEREAS, the Board of Directors of the Company (the "Board") recognizes that, as
is the case with many publicly-held corporations, the possibility of a change in
control of the Company exists and that such possibility, and the uncertainty and
questions it may raise among management, may result in the departure or
distraction of key management personnel to the detriment of the Company; and

WHEREAS, the Board has determined that appropriate steps should be taken to
reinforce and encourage the continued attention and dedication of key members of
the Company's management to their assigned duties without distraction in the
face of potentially disturbing circumstances arising from the possibility of a
change in control of the Company; and

WHEREAS, in order to induce the Employee to remain in the employ of the Company,
the Company agrees that the Employee shall receive the compensation set forth in
this Agreement as a cushion against the financial and career impact on the
Employee in the event that Employee's employment with the Company is terminated
subsequent to a "Change of Control" (as that term is defined in Section 1
hereof).

NOW, THEREFORE, in consideration of the foregoing and the mutual covenants and
agreements hereinafter set forth and intending to be legally bound hereby, the
parties hereto agree as follows:

1. DEFINITIONS. When used in this Agreement, the following terms shall have the
specific meanings shown in this Section unless the context of any provision of
this Agreement clearly requires otherwise:

     (a) "Affiliate" and "Associate" shall have the respective meanings ascribed
to such terms in Rule 12b-2 of the General Rules and Regulations under the
Securities Exchange Act of 1934, as amended (the "Exchange Act").

     (b) "Beneficial Owner" of any securities shall mean:

          (i) that such Person or any of such Person's Affiliates or Associates,
directly or indirectly, has the right to acquire (whether such right is
exercisable immediately or only after the passage of time) pursuant to any
agreement, arrangement or understanding (whether or not in writing) or upon the
exercise of conversion rights, exchange rights, rights, warrants or options, or

<PAGE>

otherwise; provided, however, that a Person shall not be deemed the "Beneficial
Owner" of securities tendered pursuant to a tender or exchange offer made by
such Person or any of such Person's Affiliates or Associates until such tendered
securities are accepted for payment, purchase or exchange;

          (ii) that such Person or any of such Person's Affiliates or
Associates, directly or indirectly, has the right to vote or dispose of or has
"beneficial ownership" of (as determined pursuant to Rule 13d-3 of the General
Rules and Regulations under the Exchange Act), including without limitation,
pursuant to any agreement, arrangement or understanding (whether or not in
writing); provided, however, that a Person shall not be deemed the "Beneficial
Owner" of any security under this subsection (ii) as a result of an oral or
written agreement, arrangement or understanding to vote such security if such
agreement, arrangement or understanding (A) arises solely from a revocable proxy
given in response to a public proxy or consent solicitation made pursuant to, an
in accordance with, the applicable provisions of the General Rules and
Regulations under the Exchange Act, and (B) is not then reportable by such
Person on Schedule 13D under the Exchange Act (or any comparable successor
report); or

          (iii) where voting securities are beneficially owned, directly or
indirectly, by any other Person (or any Affiliate or Associate thereof) with
which such Person (or any of such Person's Affiliates or Associates) has any
agreement, arrangement or understanding (whether or not in writing) for the
purpose of acquiring, holding, voting (except pursuant to a revocable proxy
described in the proviso to subsection (ii) above) or disposing of any voting
securities of the Company;

provided, however, that nothing in this subsection (b) shall cause a Person
engaged in business as an underwriter of securities to be the "Beneficial Owner"
of any securities acquired through such Person's participation in good faith in
a firm commitment underwriting until expiration of forty (40) days after the
date of such acquisition.

     (c) "Change of Control" shall be deemed to have taken place if (i) any
Person (except for the Employee or his family, the Company or any employee
benefit plan of the Company or of any Affiliate, any Person or entity organized,
appointed or established by the Company for or pursuant to the terms of any such
employee benefit plan), together with all Affiliates and Associates of such
Person, shall become the Beneficial Owner in the aggregate of 20% or more of the
shares of the Company then outstanding and entitled to vote for directors
generally, (ii) any Person (except the Employee and his family), together with
all Affiliates and Associates of such Person purchases substantially all of the
assets of the Company, or (iii) during any twenty-four (24) month period,
individuals who at the beginning of such period constituted the Board cease for
any reason to constitute a majority thereof, unless the election, or the
nomination for election by the Company's stockholders, of at least seventy-five
percent (75%) of the directors who were not directors at the beginning of such
period was approved by a vote of at least seventy-five percent (75%) of the
directors in office at the time of such election or nomination who were
directors at the beginning of such period.

                                       2

<PAGE>

     (d) "Person" shall mean any individual, firm, corporation, partnership or
other entity.

     (e) "Subsidiary" shall have the meaning ascribed to such term in Rule 12b-2
of the General Rules and Regulations under the Exchange Act.

     (f) "Termination Date" shall mean the date of receipt of the Notice of
Termination described in Section 2 hereof or any later date specified therein,
as the case may be.

     (g) "Termination of Employment" shall mean the termination of the
Employee's actual employment relationship with the Company.

     (h) "Termination following a Change of Control" shall mean a Termination of
Employment within two years after a Change of Control either:

          (i) initiated by the Company for any reason other than (a) the
Employee's continuous illness, injury or incapacity for a period of twelve
consecutive months or (b) for "cause", which shall mean misappropriation of
funds, habitual insobriety, substance abuse, conviction of a crime involving
moral turpitude, or gross negligence in the performance of duties, which gross
negligence has had a material adverse effect on the business, operations,
assets, properties or financial condition of the Company and its Subsidiaries
taken as a whole; or

          (ii) initiated by the Employee upon the occurrence of one or more of
the following:

               (A) any failure of the Company to comply with and satisfy any of
the conditions of this Agreement;

               (B) any change resulting in a significant reduction by the
Company of the authority, duties or responsibilities of the Employee;

               (C) any removal by the Company of the Employee from the
employment grade, compensation level or officer positions which the Employee
holds as of the effective date hereof, except in connection with promotions to a
higher office;

               (D) the requirement that the Employee undertake business travel
(or commuting in excess of fifty miles each way) to an extent substantially
greater than is reasonable and customary for the position the Employee holds.

2. NOTICE OF TERMINATION. Any Termination following a Change of Control shall be
communicated by a Notice of Termination to the other party hereto given in
accordance with Section 14 hereof. For purposes of this Agreement, a "Notice of
Termination" means a written notice which (i) indicates the specific termination
provision in this Agreement relied upon, (ii) briefly summarizes the facts and
circumstances deemed to provide a basis for termination of the Employee's
employment under the provision so indicated, and (iii) if the Termination Date
is other than the date of receipt

                                       3

<PAGE>

of such notice, specifies the Termination Date (which date shall not be more
than fifteen days after the giving of such notice).

3. BENEFITS UPON CHANGE OF CONTROL.

     (a) In the event of a Change of Control (i) any stock options previously
granted to the Employee under any Company stock option or equity compensation
plan which have not yet vested shall become vested, and (ii) any restricted
stock previously granted to the Employee under any Company equity compensation
plan which has not yet vested or become freely transferable shall become vested
and freely transferable.

     (b) In the event of the Employee's Termination following a Change of
Control the Company shall pay to the Employee, within fifteen days after the
Termination Date, an amount in cash equal to 2.0 times (i) the Employee's then
current annual base compensation, plus (ii) the Employee's then current target
bonus eligibility.

     (c) In the event of the Employee's Termination following a Change of
Control, the Employee shall be entitled to continued participation in the
Company's life, disability, accident and health insurance plans for a period not
to exceed thirty-six (36) months following the termination.

4. OTHER PAYMENTS. The payment due under Section 3 hereof shall be in addition
to and not in lieu of any payments or benefits due to the Employee under any
other plan, policy or program of the Company except that no payments shall be
due to the Employee under the Company's then current severance pay plan for
employees, if any.

5. ESTABLISHMENT OF TRUST. The Company has or will establish an irrevocable
trust fund (hereinafter referred to as the "Trust Fund") pursuant to a trust
agreement to hold assets contributed to satisfy its obligations under this
Agreement. Funding of such trust fund shall be subject to the Company's
discretion, as set forth in the trust agreement establishing the Trust Fund.
Notwithstanding the foregoing:

     (a) Upon a Change of Control of the Company, the Chief Financial Officer of
the Company, or his authorized representative (hereinafter referred to
collectively as the "Treasurer"), shall immediately remit to the Trustee of the
Trust Fund as a contribution to the applicable trust established as part of the
Trust Fund for the benefit of the Employee the amount due under this Agreement
and not yet contributed to the Trustee as well as an amount estimated to be
sufficient to pay all fees and expenses that may thereafter become due. The
Trustee shall be under no duty to determine the sufficiency, or to enforce the
making, of such contributions.

     (b) In the event that the Chairman of the Board determines that a Change of
Control of the Company is imminent, the Treasurer shall make the payments to the
Trustee specified in paragraph (i) above. If a Change of Control of the Company
shall not have occurred within ninety (90) days of the contribution made
pursuant to this Section 5 and the Board adopts a resolution to the effect that,
for purposes of this Agreement, a Change of Control of the Company is not
imminent,

                                       4

<PAGE>

any amounts added to the Trust Fund pursuant to this Section, together with any
earnings thereon, shall be paid by the Trustee to the Company.

6. ENFORCEMENT.

     (a) In the event that the Company shall fail or refuse to make payment of
any amounts due the Employee under Sections 3 and 4 hereof within the respective
time periods provided therein, the Company shall pay to the Employee, in
addition to the payment of any other sums provided in this Agreement, interest,
compounded daily, on any amount remaining unpaid from the date payment is
required under Section 3 and 4, as appropriate, until paid to the Employee, at
the rate from time to time announced by PNC Bank, or its successor, as its
"prime rate" plus 2%, each change in such rate to take effect on the effective
date of the change in such prime rate.

     (b) It is the intent of the parties that the Employee not be required to
incur any expenses associated with the enforcement of his rights under this
Agreement by arbitration, litigation or other legal action because the cost and
expense thereof would substantially detract from the benefits intended to be
extended to the Employee hereunder. Accordingly, the Company shall pay the
Employee on demand the amount necessary to reimburse the Employee in full for
all expenses (including attorney's fees and legal expenses) incurred by the
Employee in enforcing any of the obligations of the Company under this
Agreement.

7. NO MITIGATION. The Employee shall not be required to mitigate the amount of
any payment or benefit provided for in this Agreement by seeking other
employment or otherwise, nor shall the amount of any payment or benefit provided
for herein be reduced by any compensation earned by other employment or
otherwise.

8. NON-EXCLUSIVITY OF RIGHTS. Nothing in this Agreement shall prevent or limit
the Employee's continuing or future participation in or rights under any
benefit, bonus, incentive or other plan or program provided by the Company or
any of its Subsidiaries or Affiliates and for which the Employee may qualify;
provided, however, that with respect to a Termination following a Change of
Control, the Employee hereby waives the Employee's right to receive any payments
under any severance pay plan or similar program applicable to other employees of
the Company, and agrees to accept the payment provided in Section 3(b) above in
lieu of any other severance pay plan or similar program.

9. NO SET-OFF. The Company's obligation to make the payments provided for in
this Agreement and otherwise to perform its obligations hereunder shall not be
affected by any circumstances, including, without limitation, any set-off,
counterclaim, recoupment, defense or other right which the Company may have
against the Employee or others.

10. TAXES. Any payment required under this Agreement shall be subject to all
requirements of law with regard to the withholding of taxes, filing, making of
reports and the like, and the Company shall use its best efforts to satisfy
promptly all such requirements.

                                       5

<PAGE>

11. ADJUSTMENT FOR TAXES. In the event that either the Company's independent
public accountants or the Internal Revenue Service determine that any payment,
coverage, benefit or benefit acceleration provided to the Employee, whether
specifically provided for in this Agreement or otherwise, is subject to the
excise tax imposed by Section 4999 (or any successor provision) ("Section 4999")
of the Code, the Company, within thirty (30) days thereafter, shall pay to the
Executive, in addition to any other payment, coverage or benefit due and owing
hereunder, an amount determined by multiplying the rate of excise tax then
imposed by Section 4999 by the amount of the "excess parachute payment" received
by the Executive (determined without regard to any payments made to the
Executive pursuant to this paragraph) and dividing the product so obtained by
the amount obtained by subtracting the aggregate local, estate and Federal
income tax rate applicable to the receipt by the Employee of the "excess
parachute payment" (taking into account the deductibility for Federal income tax
purposes of the payment of state and local income taxes thereon) from the amount
obtained by subtracting from 1.00 the rate of excise tax then imposed by Section
4999 of the Code, it being the Company's intention that the Employee's net after
tax position be identical to that which would have obtained had Sections 280G
and 4999 not been a part of the Code.

12. TERM OF AGREEMENT. The term of this Agreement shall be for 3 years from the
date hereof and shall be automatically renewed for successive one-year periods
unless the Company notifies the Employee in writing that this Agreement will not
be renewed at least sixty (60) days prior to the end of the current term;
provided, however, that (i) after a Change of Control during the term of this
Agreement, this Agreement shall remain in effect until all of the obligations of
the parties hereunder are satisfied or have expired, and (ii) this Agreement
shall terminate if, prior to a Change of Control, the employment of the Employee
with the Company or any of its Subsidiaries, as the case may be, shall terminate
for any reason, or if the Employee shall cease to be an Employee.

13. SUCCESSOR COMPANY. The Company shall require any successor or successors
(whether direct or indirect, by purchase, merger, consolidation or otherwise) to
all or substantially all of the business and/or assets of the Company, by
agreement in form and substance satisfactory to the Employee, to acknowledge
expressly that this Agreement is binding upon and enforceable against the
Company in accordance with the terms hereof, and to become jointly and severally
obligated with the Company to perform this Agreement in the same manner and to
the same extent that the Company would be required to perform if no such
succession or successions had taken place. Failure of the Company to obtain such
agreement prior to the effectiveness of any such succession shall be a breach of
this Agreement. As used in this Agreement, the Company shall mean the Company as
hereinbefore defined and any successor or successors to its business and/or
assets, jointly and severally.

14. NOTICE. All notices and other communications required or permitted hereunder
or necessary or convenient herewith shall be in writing and shall be delivered
personally or mailed by registered or certified mail, return receipt requested,
or by overnight express courier service, as follows:

If to the Company, to:

                                       6

<PAGE>

     CMAC Investment Corporation
     1601 Market Street
     Philadelphia, PA 19103
     Attention: Corporate Secretary

If to the Employee, to:

     Scott C. Stevens
     200 Barrie Road
     Narberth, PA 19072

or to such other names or addresses as the Company or the Employee, as the case
may be, shall designate by notice to the other party hereto in the manner
specified in this Section 14; provided, however, that if no such notice is given
by the Company following a Change of Control, notice at the last address of the
Company or to any successor pursuant to Section 13 hereof shall be deemed
sufficient for the purposes hereof. Any such notice shall be deemed delivered
and effective when received in the case of personal delivery; five days after
deposit, postage prepaid, with the U.S. Postal Service in the case of registered
or certified mail; or on the next business day in the case of an overnight
express courier service.

15. GOVERNING LAW. This Agreement shall be governed by and construed by and
interpreted under the laws of the Commonwealth of Pennsylvania without giving
effect to any conflict of laws provisions.

16. CONTENTS OF AGREEMENTS, AMENDMENT AND ASSIGNMENT.

     (a) This Agreement supersedes all prior agreements and sets forth the
entire understanding between the parties hereto with respect to the subject
matter hereof and cannot be changed, modified, extended or terminated except
upon written amendment executed by the Employee and approved by the Board and
executed on the Company's behalf by a duly authorized officer. The provisions of
this Agreement may provide for payments to the Employee under certain
compensation or bonus plans under circumstances where such plans would not
provide for the payment thereof. It is the specific intention of the parties
that the provisions of this Agreement shall supersede any provisions to the
contrary in such plans, and such plans shall be deemed to have been amended to
correspond with this Agreement without further action by the Company or the
Board.

     (b) Nothing in this Agreement shall be construed as giving the Employee any
right to be retained in the employ of the Company.

     (c) All of the terms and provisions of this Agreement shall be binding upon
and inure to the benefit of and be enforceable by the respective heirs,
representatives, successors and assigns of the parties hereto, except that the
duties and responsibilities of the Employee and the Company hereunder shall not
be assignable in whole or in part by the Company.

                                       7

<PAGE>

17. SEVERABILITY. If any provision of this Agreement or application thereof to
anyone or under any circumstances shall be determined to be invalid or
unenforceable, such invalidity or unenforceability shall not affect any other
provisions or applications of this Agreement which can be given effect without
the invalid or unenforceable provision or application.

18. REMEDIES CUMULATIVE; NO WAIVER. No right conferred upon the Employee by this
Agreement is intended to be exclusive of any other right or remedy, and each and
every such right or remedy shall be cumulative and shall be in addition to any
other right or remedy given hereunder or now or hereafter existing at law or in
equity. No delay or omission by the Employee in exercising any right, remedy or
power hereunder or existing at law or in equity shall be construed as a waiver
thereof, including, without limitation, any delay by the Employee in delivering
a Notice of Termination pursuant to Section 2 hereof after an event has occurred
which would, if the Employee had resigned, have constituted a Termination
following a Change of Control pursuant to this Agreement.

19. MISCELLANEOUS. All section headings are for convenience only. This Agreement
may be executed in several counterparts, each of which is an original. It shall
not be necessary in making proof of this Agreement or any counterpart hereof to
produce or account for any of the other counterparts.

IN WITNESS WHEREOF, the undersigned, intending to be legally bound, have
executed this Agreement as of the date first above written.

CMAC INVESTMENT CORPORATION


By:
    ---------------------------------          ---------------------------------
    Frank P. Filipps, President

Attest:
        -----------------------------

                                       8