
448 So.2d 472 (1984)
Lamar STANFORD
v.
STATE.
4 Div. 216.
Court of Criminal Appeals of Alabama.
March 20, 1984.
David C. Emery, Ozark, for appellant.
Charles A. Graddick, Atty. Gen., and Patricia Ellis Guthrie, Asst. Atty. Gen. and Michael Bownes, Montgomery, for appellee.
HARRIS, Judge.
Appellant, Lamar Stanford, was indicted by the Dale County Grand Jury on October 5, 1982, for violation of the provisions of the Alabama Uniform Controlled Substances Act, § 20-2-70, Code of Alabama (1975). On May 26, 1983, appellant was found guilty of selling marijuana and was sentenced to two years' imprisonment in the state penitentiary. The sentence was suspended and appellant was placed on probation.
State Trooper Gerard Herring testified at trial that he went to Ozark as an undercover agent for the Alabama Bureau of Investigation, and that on June 15, 1982, at 8:15 p.m., he drove to a section of town known as "the block." He drove into a parking lot and appellant, who was standing with a group of people, yelled at him, "You looking for me?" Herring drove over to him and appellant said, "I got it." Herring replied, "Let me see what you got." Appellant opened a paper sack and allowed Herring to examine several plastic wrapped bags of marijuana. Herring chose one, gave appellant ten dollars, and drove off.
Herring identified appellant in court as the individual who sold him the marijuana. He stated that this was the only contact he had with appellant, that he had not known him previously, nor had he seen him again until he came to trial.
On cross-examination, Herring testified that, at the time of the drug sale, he was carrying a passenger in the car who witnessed the transaction and identified appellant by name.
Lamar Stanford testified that at about 6:30 p.m., on the evening in question, his fiancee came to his mother's house, where he was living, and the two of them drove to Dothan. They went to a movie which started at 7:15, returned to Ozark between 9:30 and 9:45, and sat out in the car until 1:00 or 2:00 o'clock the following morning. He denied selling the marijuana to Herring, or *473 even being in Ozark when Herring made the purchase.
The sole issue raised on appeal is whether the State was privileged to withhold the identity of the individual who provided Herring with appellant's name, or whether the State should have been compelled to reveal the name of this witness.
The general rule is that the prosecution is privileged to withhold from an accused the identity of an informer. E.g., White v. State, 368 So.2d 332 (Ala.Cr.App. 1979); Williams v. State, 52 Ala.App. 406, 293 So.2d 324 (Ala.Cr.App.1974). The court in Kilgore v. State, 50 Ala.App. 501, 503, 280 So.2d 206, 208 (Ala.Cr.App.1973), stated the following: "Public policy forbids the disclosure of an informant's identity unless it is essential to the defense set up by the accused and is necessary to show his innocence." (Citations omitted.) The United States Supreme Court, in Roviaro v. United States, 353 U.S. 53, 59, 77 S.Ct. 623, 627, 1 L.Ed.2d 639 (1957), expounded upon the State's privilege to withhold the identity of informers as follows: "The purpose of the privilege is the furtherance and protection of the public interest in effective law enforcement. The privilege recognizes the obligation of citizens to communicate their knowledge of the commission of crimes to law enforcement officials and, by preserving their anonymity, encourages them to perform that obligation."
Appellant cites Roviaro, supra, wherein the court held that the trial judge erred in failing to require the State to disclose the name of an informer. Defendant in that case had been charged with both illegally transporting and selling heroin. The informer was heavily involved in the criminal activity, as he was instrumental in bringing about the defendant's possession of the heroin and was the sole participant in the crime other than the accused. He also may have been a material witness on the issue of whether the accused knowingly transported the drugs as charged, and he was the only witness who could have confirmed or contradicted the testimony of the State's witness who reported the contents of a conversation between the accused and the informer.
The court, in Roviaro, supra, announced a balancing test to be applied to the question, stating the following:
"... no fixed rule with respect to [the applicability of the government's privilege to withhold] disclosure [of an informer's identity] is justifiable. The problem is one that calls for balancing the public interest in protecting the flow of information against the individual's right to prepare his defense. Whether a proper balance renders nondisclosure erroneous must depend on the particular circumstances of each case, taking into consideration the crime charged, the possible defenses, the possible significance of the informer's testimony, and other relevant factors." At 62, 77 S.Ct. at 628-629.
Determination of this issue is, of course, within the sound discretion of the trial court. New v. State, 337 So.2d 1355 (Ala. Cr.App.1976).
This court in Kilgore, supra, upheld the trial judge's determination that an informant's identity should be withheld from the accused. In explanation of its holding, the court stated:
"The primary purpose for the disclosure of an informer's name or identity is to prevent a miscarriage of justice in cases where an accused might have been entrapped into committing the offense for which he is prosecuted. The fundamental requirements of fairness compel disclosure in such cases where the informer plays a major and active part in bringing about the sale of narcotics and continues an active participant therein." 50 Ala. App. at 503, 280 So.2d 206.
In Kilgore, supra, the witness, known only as "Betty," introduced the government agent to the accused. The agent then negotiated a purchase of illegal drugs from the accused. It was a simple case of sale and delivery in which "Betty" was not an active participant in the criminal transaction but was, on the contrary, merely a passive observer. The defendant took the *474 stand and denied that he had ever seen the agent either with or without a female companion. The defense of entrapment was thus negated and disclosure of the woman's name could not be compelled.
The facts in the case before us are directly analogous to the facts in Kilgore, supra. The witness was a passive observer of the transaction, and the defendant denied the crime, negating an entrapment defense. State's witness positively identified appellant in court as the individual who sold him the marijuana, so that the State's case was not dependent upon the unidentified witness's identification of the accused. We find that under these facts and circumstances the trial judge committed no error in allowing the State to withhold the name of the witness.
We have carefully searched the record for errors prejudicial to the substantial rights of the appellant and have found none. The judgment of conviction is affirmed.
AFFIRMED.
All the Judges concur.
