
783 So.2d 1164 (2001)
Rick A. SWOPE, Appellant,
v.
Barry KRISCHER, Esquire, as the State Attorney for the Fifteenth Judicial Circuit, Ira Karmelin, Esquire, Assistant State Attorney, Fifteenth Judicial Circuit, Theodore Booras, Esquire, Assistant State Attorney, Fifteenth Judicial Circuit, Appellees.
No. 4D00-1128.
District Court of Appeal of Florida, Fourth District.
April 18, 2001.
Rehearing Denied May 24, 2001.
*1166 J. David Huskey, Jr. and C. Edward McGee, Jr. of McGee, Gainey & Huskey, P.A., Fort Lauderdale, for appellant.
Robert A. Butterworth, Attorney General, Tallahassee, and Charles M. Fahlbusch, Assistant Attorney General, Fort Lauderdale, for appellee.
WARNER, C.J.
This appeal arises from the dismissal of appellant's complaint against the Palm Beach County State Attorney and two prosecutors in his office for false arrest and section 1983 civil rights violations stemming from the investigation, charging, and arrest of appellant on perjury charges which were later nolle prossed. The trial court dismissed the complaint based upon absolute prosecutorial immunity. Although we conclude that absolute immunity does not apply to the investigative allegations of the complaint, we affirm the order of dismissal based upon qualified immunity principles.[1]
In reviewing a motion to dismiss, the trial court must confine its determination to the four corners of the complaint to determine whether the plaintiff has alleged a cause of action upon which relief may be granted. Provence v. Palm Beach Taverns, Inc., 676 So.2d 1022, 1024 (Fla. 4th DCA 1996). Similarly, the appellate court must confine its review to the four corners of the complaint and must accept as true all well-pleaded allegations. See Aaron v.. Allstate Ins. Co., 559 So.2d 275, 276 (Fla. 4th DCA 1990).
In his complaint, appellant, a former employee of the Broward Sheriff's Office, alleges that he founded a company that specialized in accident reconstruction services and DUI consulting. To enhance his qualifications, he enrolled in a program known as "Master in Science in the Management of Technology" at the University of Miami during the Winter Term of 1994. He successfully completed this program, *1167 earning his Master of Science degree on December 15, 1995. Due to an accounting error by the University of Miami, the initial physical diploma was not issued until June 20, 1997.
After acquiring his degree, appellant testified in court and during depositions that his "graduation date" was December of 1995. Appellant's complaint alleges that certain assistant state attorneys in Palm Beach began a campaign to discredit him. To that end, appellees Ira Karmelin and Theodore Booras reviewed appellant's curriculum vitae and discovered the date discrepancy between the date appellant claimed to have received his degree (1995) and the date he received his diploma (1997). The complaint alleges:
Booras and/or Karelin based this assertion solely on the strength of a telephone call with an employee of the University of Miami (not under oath) and a "review" of an uncertified copy of a college transcript, which "review" was performed, upon information and belief, by an assigned investigator who himself has no four-year college degree.
Based upon the foregoing "investigation," which they largely conducted themselves, Karmelin and Booras caused to be filed a three (3) count Information charge in Palm Beach Circuit Court....
The complaint also alleges that after initiating the prosecution of appellant and his arrest, the assistant state attorneys contacted defense witnesses and subpoenaed them for the purpose of giving investigative statements. In doing so, the prosecutors allegedly threatened the witnesses.

Prosecutorial Immunity:
Prosecutors enjoy absolute immunity from lawsuits for damages resulting from the performance of their quasi-judicial functions of initiating or maintaining a prosecution. State v. Rutherford, 707 So.2d 1129, 1133 (Fla. 4th DCA 1997). However, prosecutorial acts outside this function may not enjoy this same absolute immunity. In Buckley v. Fitzsimmons, 509 U.S. 259, 273-74, 113 S.Ct. 2606, 125 L.Ed.2d 209 (1993), the United States Supreme Court applied the functional approach to determining whether prosecutorial acts would be covered by prosecutorial immunity:

There is a difference between the advocate's role in evaluating evidence and interviewing witnesses as he prepares for trial, on the one hand, and the detective's role in searching for the clues and corroboration that might give him probable cause to recommend that a suspect be arrested, on the other hand. When a prosecutor performs the investigative functions normally performed by a detective or police officer, it is "neither appropriate nor justifiable that, for the same act, immunity should protect the one and not the other." Hampton v. Chicago, 484 F.2d 602, 608 (C.A.7 1973)(internal quotation marks omitted), cert. denied, 415 U.S. 917, 94 S.Ct. 1413, 39 L.Ed.2d 471 (1974). Thus, if a prosecutor plans and executes a raid on a suspected weapons cache, he "has no greater claim to complete immunity than activities of police officers allegedly acting under his direction." 484 F.2d at 608-609.
(Emphasis added). However, it is not always easy to determine whether or not the action of the prosecutor is protected by absolute immunity, as the Supreme Court acknowledged in Imbler v. Pachtman, 424 U.S. 409, 432, 96 S.Ct. 984, 47 L.Ed.2d 128 (1976). In a footnote, the Court discussed the application of prosecutorial immunity to the prosecutor's investigative function:
We recognize that the duties of the prosecutor in his role as advocate for the *1168 State involve actions preliminary to the initiation of a prosecution and actions apart from the courtroom.... Preparation, both for the initiation of the criminal process and for a trial, may require the obtaining, reviewing, and evaluating of evidence. At some point, and with respect to some decisions, the prosecutor no doubt functions as an administrator rather than as an officer of the court. Drawing a proper line between these functions may present difficult questions, but this case does not require us to anticipate them.
Id. at 431 n. 33, 96 S.Ct. 984. At the very least, "[a] prosecutor neither is, nor should consider himself to be, an advocate before he has probable cause to have anyone arrested." Buckley, 509 U.S. at 274, 113 S.Ct. 2606.[2]
Reviewing the complaint in this case, it is alleged that the two state attorneys sought to discredit appellant, who frequently testified as an expert in the Palm Beach County courts. To that end, they reviewed appellant's qualifications and discovered the date discrepancy regarding his graduation date and diploma date. It was after they discovered this discrepancy that they filed the charges. Thus, the complaint alleges that the prosecutors conducted the investigation of appellant and through this investigation found information that they then used to file the perjury charges.
These facts demonstrate prosecutorial acts that are closer to "the detective's role in searching for the clues and corroboration that might give him probable cause to recommend that a suspect be arrested" than to the prosecutor's role "in evaluating evidence and interviewing witnesses as he prepares for trial." Id. at 273, 113 S.Ct. 2606. The prosecutors could not have developed probable cause to believe that appellant had committed perjury until after the investigation. Based solely upon the allegations of the complaint, the conduct of the assistant state attorneys in investigating appellant was not protected by prosecutorial immunity.
We hasten to add that the trial court apparently believed that the assistant state attorneys were reviewing appellant's qualifications in connection with a pending prosecution because the trial court noted in its order that "[s]urely, it is the function of an advocate to gather information to test the credibility of witnesses and to discredit them if possible." If this is the true state of the facts, and it very well may be, then we would agree that the prosecutors were performing the functions of an advocate in preparing for trial. However, no allegations to that effect were made in the complaint, and we are limited to those allegations in reviewing an order of dismissal. See Aaron, 559 So.2d at 276.
The same functional analysis leads to the conclusion that the prosecutors are protected by prosecutorial immunity for the actual filing of criminal charges that led to the arrest of appellant and the subsequent interrogation of witnesses. Such actions are clearly those of the prosecutor's role in evaluating evidence and preparing for trial. For those actions the assistant state attorneys are protected by absolute immunity.

Section 1983 immunity:
Although the assistant state attorneys are not protected by prosecutorial immunity in investigating appellant, *1169 they are protected by qualified immunity in connection with the section 1983 civil rights claims. Government officials are protected by qualified immunity for performance of discretionary functions when "their conduct does not violate clearly established statutory or constitutional rights of which a reasonable person would have known." Harlow v. Fitzgerald, 457 U.S. 800, 818, 102 S.Ct. 2727, 73 L.Ed.2d 396 (1982). Where the government official acts with a reasonable good faith belief that the action taken was lawful, no suit for damages can be maintained against the official. See Smith v. Garretto, 147 F.3d 91, 94 (2d Cir.1998).
In Lassiter v. Alabama A & M University, Bd. of Trustees, 28 F.3d 1146, 1149-50 (11th Cir.1994), the court succinctly listed the principles applicable to the qualified immunity defense. In discussing the requirement that the law be clearly established, the court stated:
For the law to be clearly established to the point that qualified immunity does not apply, the law must have earlier been developed in such a concrete and factually defined context to make it obvious to all reasonable government actors, in the defendant's place, that "what he is doing" violates federal law. Anderson v.. Creighton, 483 U.S. 635, 640, 107 S.Ct. 3034, 3039, 97 L.Ed.2d 523 (1987). Qualified immunity is a doctrine that focuses on the actual, on the specific, on the details of concrete cases.
The instant complaint alleges that the assistant state attorneys investigated appellant and filed charges when they discovered a discrepancy in his testimony regarding his graduation date for his masters degree versus his diploma date. As appellees state in their brief, "making a telephone call to the University of Miami to determine if an expert witness really had the degree he was testifying to is not an action that the reasonable government official would realize would clearly violate the constitutional rights of the witness he was calling about." Appellant has not cited any cases which hold that a witness who has testified in a criminal proceeding has the right not to be investigated to determine whether his testimony was truthful. The complaint does not show a violation of a clearly established right by these defendants. Therefore, qualified immunity protects appellees.

Sovereign immunity:
Finally, the State Attorney Barry Krischer, in his official capacity, is protected by sovereign immunity where a state employee acts in bad faith or with a malicious purpose, as is alleged in this complaint. See § 768.28(9)(a), Fla.Stat. (1999); City of Fort Lauderdale v. Todaro, 632 So.2d 655 (Fla. 4th DCA 1994).
Affirmed.
SHAHOOD and HAZOURI, JJ., concur.
NOTES
[1]  Although immunity is an affirmative defense, where the complaint contains allegations that demonstrate the existence of the defense, then it can be considered on a motion to dismiss. See Vaswani v. Ganobsek, 402 So.2d 1350, 1351 (Fla. 4th DCA 1981).
[2]  According to the Supreme Court, this does not mean that all activities of a prosecutor after a determination of probable cause are absolutely immune. See Buckley, 509 U.S. at 274 n. 5, 113 S.Ct. 2606.
