American Telephone & Telegraph Co. and the Communications Workers of America reached a tentative settlement yesterday to end the 17-day-old nationwide strike by 155,000 AT&T employes. Both sides hailed the agreement, saying it includes significant steps toward guaranteeing job security in the turbulent telecommunications industry.

The union said AT&T's long-distance operators, skilled technicians and clerical and factory workers could be back at work by this weekend if the two sides can reach agreement at six local bargaining sessions covering AT&T divisions.

Each side claimed victory at its own news conference. AT&T spokesman Herb Linnen said the firm "believes its goals have been achieved: job security, fair wages and benefits . . . and improving our competitive posture" by controlling costs and not including cost-of-living adjustments COLAs in the three-year contract.

CWA President Morton Bahr said the union achieved its key goal "when the company removed all of its concessionary demands from the national bargaining table," strengthened job-security language and agreed to keep the COLA clause in the contract as a formal entity, even though there will be no COLA payments during the three years. COLA clauses, included in about half of union contracts, afford varying degrees of protection against inflation.

"At a time when workers in other industries have been forced to accept contractual givebacks, this tentative contract is significant in that it requires no concessions of CWA members," Bahr said.

The centerpiece of the job-security arrangement is a $21 million program under which AT&T will pay for creation of a jointly owned company-union nonprofit corporation that will retrain workers facing layoffs. Employes will be trained for placement within AT&T or for jobs outside the company, using community colleges and other facilities.

The company said that the tentative agreement's wage and pension improvements -- which total 8 percent over three years -- would create "no undue pressure on consumer prices" and should not hurt AT&T's ability to compete with growing numbers of major telecommunications companies.

The final roadblock to a settlement was removed after meetings late Monday and yesterday morning at the Watergate Hotel and CWA headquarters here in which the two sides -- with the assistance of Kay McMurray, director of the Federal Mediation and Conciliation Service -- agreed to language on the COLA issue and on job protections for 20,000 technicians who feared that their jobs could be lost or downgraded by AT&T's use of subcontractors or lower-paid workers.

McMurray, credited by both sides for helping settle the strike, the nation's largest work stoppage in three years, described the contract as having "a trend-setting employment security program that will help employes plan their careers . . . and new job structures that will help the company become more competitive."

The new job structures include the position of "wire-puller," which would have a weekly salary of $240. In the past, AT&T was forced to use technicians making more than $600 a week to perform relatively simple tasks, resulting in other firms being able to greatly underbid AT&T for major installation contracts, the company said.

Job security emerged as the major union issue in the wake of the 1984 breakup of AT&T, which has cut 56,000 jobs and laid off more than 15,000 employes. Bahr described the job-security provisions as a "milestone" because AT&T has agreed to expand the rights of employes facing layoff. Those workers get "right of first hire before any off-the-street hires can be made" and also may transfer to any of AT&T's corporate divisions, a right they previously did not have, Bahr said.

In most respects, the contract is like the one previously accepted by the International Brotherhood of Electrical Workers, which represents 41,000 AT&T workers. Bahr said that although his members will have lost three weeks' pay, they strongly supported the strike because AT&T has earned $2 billion profit in its last five quarters, and union members favored a hard line against contract concessions.

AT&T hired 5,200 temporaries and used supervisors working six-day, 72-hour weeks to maintain long-distance service during the strike. Most Wall Street analysts said the company was not hurt financially by the walkout and would have suffered only if it had lasted several more weeks.