Teams Socket Mode Simplifies Local Agent Development

Teams adds socket delivery for local agents. A look at the preview, its transport contract, and the path from local testing to production.

The first debugging session for a chat agent often starts with infrastructure work. Before testing a handler, you need a reachable endpoint, a tunnel to the laptop, and a registration pointing at the right URL. A broken callback can look remarkably similar to a broken application.

On November 13, 2026, Microsoft announced a public preview of socket mode for Teams agents. The agent opens a WebSocket connection and receives activities through it, removing the public messaging endpoint requirement for local development. The preview applies to newly created agents and is intended for development and testing; production agents should use an HTTPS messaging endpoint. Microsoft’s announcement makes that scope explicit.

This is a useful engineering change because it shortens the distance between editing a handler and exercising it inside Teams. Its value depends on understanding which parts of the system it simplifies and which operational problems remain.

What Happened

Teams now provides a choice of inbound activity delivery methods. Agent Communication Service, or ACS, can send activities to a public HTTPS endpoint, or deliver them over connections initiated by the agent. Outgoing messages continue to use HTTPS in either mode. The activity payloads remain the same. The connectivity guide describes this division.

That separation matters. Receiving a message over a socket does not mean the entire conversation becomes a single bidirectional application protocol. The connection carries incoming activity delivery and its protocol replies; posting a chat response remains an ACS API operation.

For application developers, the useful promise is a stable handler boundary. Transport selection belongs in startup and registration configuration. Business logic should be able to process an activity without knowing whether it arrived through an HTTP request or a socket adapter.

The announcement is also narrower than a general hosting release. Teams Store distribution is outside the socket preview’s supported path. Treat it as a new development option, with a deliberate deployment transition to plan and test.

Why It Matters

An agent’s local feedback loop includes more than model inference. Engineers need to inspect incoming activities, check conversation identifiers, exercise card actions, and confirm that replies reach the intended conversation. If each experiment first requires repairing a tunnel or updating an endpoint, infrastructure friction becomes part of every application change.

My assessment is that socket mode is most useful at this integration boundary. A unit test can prove that a function formats a response correctly. It cannot prove that the installed Teams application routes a real user message to that function. Removing a public callback from the local setup makes that second kind of check easier to repeat.

Consider a backend engineer adding a read-only incident assistant. The initial task is modest: receive a question, query an internal incident service, and return a summary. Local execution may already have access to development credentials and internal network routes. A tunnel introduces another independently configured component before the engineer can inspect the first activity.

Socket delivery reduces that setup burden. It does not establish whether the assistant is authorized to query a particular incident, whether retrieved text is trustworthy, or whether a generated answer cites the right evidence. Those remain application concerns. Keeping them visible is essential: successful message delivery is only the beginning of agent correctness.

There is also a practical testing consequence. A convenient local transport can encourage frequent real-client tests, but it can hide production-specific integration failures unless the team maintains a separate deployed test environment. I would use sockets for rapid iteration and require an HTTPS smoke test before release.

How It Works

At the protocol level, the agent authenticates a regional connect request with its own application identity. ACS returns a connection URL and a token. The client then establishes a SignalR connection and waits for SocketReady before treating the connection as usable. Microsoft explicitly warns that a plain WebSocket library is insufficient unless the developer also implements the SignalR hub protocol. The protocol guide documents those steps.

This is a good reason to use the SDK. Writing a custom transport means owning negotiation, readiness, token replacement, and reconnect behavior before reaching any agent functionality. That work may be justified for an unsupported runtime, but it should have an explicit maintenance budget.

The service’s documented delivery semantics deserve attention: activities can arrive concurrently, conversation affinity is not guaranteed, and senders can produce duplicates after a failed delivery. ACS does not retry a failed socket delivery on another socket. The guide currently specifies a 25-second reply deadline and at most four open sockets per agent per region. These are preview limits, not capacity promises to extrapolate into a production architecture. Connectivity and delivery semantics are the relevant reference.

My engineering recommendation is to keep the incoming handler small. Validate application permissions, identify the operation, and durably accept work before acknowledging it when asynchronous processing is needed. Acknowledging first and placing work only in process memory creates an avoidable failure window.

For a future write-capable assistant, I would also put deduplication at the operation boundary. The activity identifier can help identify repeated input, but the business operation needs its own durable outcome record. Otherwise, a repeated request could initiate the same deployment or ticket update twice even when the transport behaves as documented.

The TypeScript API exposes per-geography lifecycle events and distinguishes connection readiness from merely opening a socket. It also states that socket mode starts no inbound HTTP listener, leaving browser routes such as OAuth callbacks and tabs unavailable through that transport. The SDK reference is useful for diagnosing those boundaries.

For observability, I would record delivery, handler acceptance, and eventual user-visible completion separately. A connected agent with failing work should never appear healthy simply because its socket is open.

Example

Start with a newly created development agent. Microsoft’s setup guide specifies Teams CLI 3.1.0 or later and Teams SDK 2.2.1 or later. Registration and runtime delivery settings must agree. The configuration guide provides the prerequisites and language examples.

The following illustrates the registration step after installing the supported CLI and authenticating it:

teams app create --name "Incident helper dev" --messaging-mode socket

Inside an otherwise configured TypeScript Teams SDK project, the relevant application code is small:

import { App } from '@microsoft/teams.apps';

const app = new App({ socketMode: true });

app.on('message', async ({ activity, reply }) => {
  await reply(`Received your incident question: ${activity.text}`);
});

await app.start();

This is an illustrative echo handler, not a complete project scaffold. It assumes the application’s identity, credentials, installation, and SDK dependencies are already configured. No model or incident API is involved yet. Establishing this deterministic baseline makes later failures easier to locate.

Send a message from Teams and confirm both handler execution and the visible response. Then restart the process and repeat. Only after those checks would I introduce retrieval, model calls, and background work. Add one uncertain dependency at a time so a routing failure cannot disappear inside a generic “agent failed” error.

For deployment, change the delivery registration to HTTP and supply the deployed endpoint:

teams app update <app-id> --messaging-mode http \
  --endpoint https://example.com/api/messages

The CLI documentation says an endpoint update alone does not change messaging mode, and the SDK application must be restarted after changing mode. The command reference documents that behavior. Update the runtime configuration as well, then exercise the deployed handler through Teams.

These snippets were checked against the documentation, not executed against a live tenant. Preview availability and tenant configuration still need verification in the target environment.

My Take

I would adopt this preview for a new Teams agent development project. The immediate benefit is concrete: fewer networking steps before testing the actual application. That is enough to justify evaluating it without inventing productivity percentages or claiming a new agent architecture.

I would keep transport choices out of the incident-query service, authorization policy, and model orchestration code. Those components should consume application inputs and produce application outcomes. A startup adapter can handle how Teams activities enter the process.

The main adoption risk is mistaking local convenience for deployment equivalence. Browser authentication flows, endpoint validation, network policy, and operational readiness still deserve their own integration checks. A socket-based echo test provides useful evidence, but its evidence has a defined scope.

For a small team, the sensible implementation is correspondingly small: SDK-managed connections, a deterministic initial handler, explicit lifecycle logging, and a documented HTTPS release check. Build additional abstractions only when a second real transport or application requirement demands them.

Conclusion

Teams socket mode improves a specific part of agent engineering: connecting a local runtime to real Teams activity delivery. The November 13 preview offers a simpler development loop while retaining a separate HTTPS path for production.

Use that convenience to test more frequently. Preserve durable work handling, authorization, and deployment validation as explicit engineering responsibilities. The strongest result is a shorter path to reliable integration evidence.

Sources

Enjoying this article?

Subscribe to get new NestJS, Node.js, and backend engineering posts directly in your inbox.

Subscribe for free