You are about to invest your savings in a promising land deal. Across town, the lawyer for the company sponsoring the investment discovers that it's a fraud. The land really is a swamp.

Under a proposed code of ethics the American Bar Association approved here last week, that lawyer may not warn you of the swindle. If he does, he will be breaking the confidence of his client and could be subject to bar disciplinary proceedings.

Suppose a grand jury starts investigating the swindle and the lawyer is called to testify. Under the code, he may not disclose confidences from his client, even though he could be held in contempt.

Such a scenario--which bar leaders here acknowledge presents a "dilemma"--may be possible as a result of votes in the ABA House of Delegates that stunned sponsors of a new model code of conduct for lawyers.

This "dilemma" was not what sponsors had in mind six years ago when a commission, chaired by Robert Kutak of Nebraska, set out to revamp the current foggy lawyers' ethics code, with the Watergate scandals as a backdrop. At their gathering here last week, however, the lawyers substituted their own recommendations for many of those made by the commission.

Kutak, who died last month, had said he saw the legal profession's time-honored code of silence--the attorney-client privilege of confidentiality--as basically sound but one that could become a straitjacket on lawyers. If silence was a straitjacket at times under the current code, the new code may serve to tighten that straitjacket.

At its best, the principle of confidentiality gives clients the trust to "tell everything" to a lawyer, as they would to a priest or psychiatrist who also observe similar codes, and thereby get the best advice.

At its worst, the principle can enlist a lawyer's aid in a fraud or at least in perpetuating it. A recent case involving O.P.M. ("Other People's Money") Services Leasing Inc. was cited repeatedly in debates here as an example of the worst. The company, which went bankrupt in 1981, was accused of bilking lenders of more than $210 million by falsifying its worth.

Its New York law firm, Singer Hutner Levine & Seeman, had discovered the situation. It resigned the client but did not disclose what was going on, even to the law firm that O.P.M. retained to replace it.

The law firm based its decision on an understanding of the current code of conduct. If there was confusion in the code then, there will be none if state courts, which have no obligation to follow the ABA recommendations, adopt the new code.

The current code may or may not permit disclosure of fraud, except when perjury is involved. The new proposal would remove that ambiguity and prohibit disclosure.

Under it, the only justification for disclosure would be the threat of substantial physical injury, "imminent death" or a client's forfeiting his right to confidentiality by suing the lawyer or contesting the fee.

Proponents of a new code expressed disgust at the latter exception, noting that the "sacred" trust could be broken to protect the lawyer's livelihood but not the potential losses of the victims of a fraud or swindle.

In its actions last week, the ABA adopted a near-absolute rule that many critics consider to be a step backward.

The controversy here paralleled controversies surrounding the claimed privileges of reporters, who want to protect news sources, and psychiatrists, who want to protect diagnoses and patients' secrets.

The other professions have been running into trouble in defending their privileges, too.

Recent litigation, for example, has found psychiatrists liable for damages for failure to warn a victim of potential harm from a psychiatric patient who had confided his intentions during therapy.

A California newspaper is in trouble in a multimillion-dollar libel suit because a judge ruled it in default after a reporter refused to disclose a source.

Reporters argue that a breach of trust with a source would discourage people from going to them with valuable news.

The lawyers' debate will continue at an ABA convention in Atlanta in August. Proponents of the changes see hope in the fine print that will be drafted as "commentary" to the code provisions approved here.

It may be possible to reach agreement on wording, they hope, that will allow a lawyer to withdraw a false document, like the prospectus in the hypothetical land swindle, when fraud is discovered.

The lawyer would then avoid detailing what he has learned from his client but also would be signaling that something is wrong.