Matrix application services for bots and bridges: what they do and when you need them
An application service is the right tool when software must act on the homeserver itself, such as creating ghost users for a third-party network, joining rooms on their behalf, or receiving every event in a namespace it owns. A bridge to a network like Slack, IRC, WhatsApp, Telegram, Signal or email is the most common case. The application service API lets that software register with the homeserver and speak for a set of users and room aliases without holding a normal user password. Simpler bots that only read and post messages through a standard client login usually do not need this path. If your bot only answers commands in a few rooms and runs with a regular account, a client-based bot is cheaper to build and easier to hand over. Choose the application service route when you need identities that map to users on another network, when you need to reserve a namespace of users or aliases, or when the bot must receive events it would not otherwise see.
The plan starts with three artifacts. The bridge generates an appservice registration file, which is registration.yaml by default in mautrix bridges, and that file must be registered with the homeserver, which must support application services. The file defines the bridge's namespaces for users, room aliases and room IDs, and overlapping namespaces between services cause conflicts you should find before go-live. On Synapse, a single worker can be designated with notify_appservices_from_worker to push events to application services, and that worker cannot be load-balanced, so the design must accept one notifier process and its failure mode. Confirm the worker layout against the Synapse workers documentation before you decide how many processes the homeserver runs.
Identity is the point most likely to change the plan. Under Matrix Authentication Service, encrypted bridges cannot use the m.login.application_service login type and need MSC4190 device management, which requires Synapse 1.141.0 or later and a bridge that implements it. Ask the bridge vendor which MSC4190 support it ships and confirm it before you commit to MAS. The MAS migration guide explains the authentication change. Your scope should name each bridge, its network, its encryption requirement, its Synapse and MAS versions, and the team that owns its registration file, secrets and restarts.
How a bridge receives events from the homeserver
The path starts when a room event reaches the Synapse main process, which hands it to the replication stream. The worker named by notify_appservices_from_worker picks it up from Redis and pushes it to the bridge over the application service API, matching the bridge's namespaces. Check that the registration file is registered on the homeserver, that the designated notifier is a single worker and not load-balanced, and that the bridge can reach the homeserver while the third-party network stays outside the trust boundary.
Event flow from the homeserver to a bridge and its third-party network.
Which application service settings fit which deployment
A single-process Synapse runs one main process that handles client, federation and application service traffic. Bridges and bots connect through a registration file that you point to in the homeserver configuration, and the main process notifies them directly. This is the simplest shape to reason about, and it is the one most small or pilot deployments start with.
- Registration path: List the bridge's
registration.yamlunderapp_service_config_filesinhomeserver.yaml, then restart Synapse so the file is loaded. - Notification: No separate notifier is needed, so there is no extra process to size or monitor.
- Login types: Bridges can use the
m.login.application_servicelogin type to create and act as ghost users, which keeps setup short. - Trade-off: All appservice traffic shares one process with client and federation load, so a busy bridge can slow the whole server.
- Trade-off: Moving to workers later means revisiting notification and routing, so plan the migration path before adding bridges at volume.
Check the file path, the id and as_token values, and the namespaces in each registration file against what the bridge generated before you restart.
A worker-based Synapse splits work across processes, and application service notification is handled by a designated worker rather than the main process. Synapse documents notify_appservices_from_worker for this purpose, and it designates one worker to notify application services. That worker cannot be load-balanced, so the bridge path has a single point of concern that the rest of the deployment does not.
- Notifier worker: Set
notify_appservices_from_workerin the main configuration to the name of the one worker that will send appservice events. - Registration path: Keep the same
app_service_config_filesentry as the single-process case, and confirm each worker reads the same configuration. - Scaling limit: Do not place that notifier behind a load balancer or run more than one copy, because the notification role is singular by design.
- Trade-off: Client and federation traffic scale out, but bridge throughput depends on one worker, so size and monitor it separately.
- Trade-off: Routing and replication mistakes are easier to make, so test a bridge message in both directions after every worker change.
Confirm which worker holds the notifier role, that no load balancer routes appservice paths to other workers, and that a test message reaches the bridge after a restart.
When Matrix Authentication Service handles sign-in, the login model for bridges changes. Under MAS, encrypted bridges cannot use the m.login.application_service login type and need MSC4190 device management, which requires Synapse 1.141.0 or later and a bridge that implements it. Unencrypted bridges that depend only on the registration file keep working in the usual way, so the split matters most for bridges that handle encrypted rooms.
- Synapse version: Confirm the running Synapse is 1.141.0 or later before you enable MSC4190 device management.
- Bridge support: Check that the bridge release you plan to use implements MSC4190, since Synapse support alone is not enough.
- Login types: Plan encrypted bridges around device management rather than the application service login type, and document which bridges use which path.
- Trade-off: Encrypted bridging depends on both server and bridge versions, which raises the cost of each upgrade.
- Trade-off: Migrating an existing homeserver to MAS changes how bridges authenticate, so review the migration guide before switching sign-in.
Verify the Synapse version, the bridge's MSC4190 support in its own documentation, and that an encrypted message round trip works after any MAS change.
Configuration options and when each fits
This table compares the four settings that shape how a bridge reaches your homeserver: the registration file, namespaces, the notifier worker, and the bridge's own encryption and login mode. Read each row as a decision: what it fits, what it constrains, and what to confirm with the bridge vendor before you register it. The main takeaway is that the encryption and login choice under MAS can decide whether a bridge works at all, so settle it before deployment.
| Option | When it fits | What it constrains | What to confirm |
|---|---|---|---|
| Registration file (registration.yaml) | Every bridge. The bridge generates it and the homeserver must load it before the bridge can act. | The homeserver must support application services. Any change to the file requires re-registration on the homeserver. | The file name and path the bridge generates by default, and whether the bridge can regenerate it on upgrade. |
| Namespace definitions | Bridges that own a set of user IDs, room aliases or room IDs, such as bridge ghost users for a third-party network. | Namespaces decide which users and rooms the bridge controls. Overlapping namespaces with other bridges or local users can cause conflicts. | Which user ID and alias patterns the bridge claims, and whether they match your server_name and naming plan. |
| Notifier worker (notify_appservices_from_worker) | Synapse deployments that run workers and need application services notified from a dedicated process. | A single worker is designated to notify application services, and it cannot be load-balanced. It becomes a single point to monitor. | Whether your worker layout already dedicates one process to this role, and how the bridge recovers if that worker restarts. |
| Bridge encryption and login type (MSC4190 under MAS) | Encrypted bridges on a homeserver that uses MAS. The bridge needs MSC4190 device management. | Encrypted bridges cannot use the m.login.application_service login type under MAS. Requires Synapse 1.141.0 or later and a bridge that implements MSC4190. | Whether the bridge version implements MSC4190, the minimum Synapse version it supports, and whether it supports encryption with your MAS setup. |
| Unencrypted bridge with application service login | Homeservers without MAS where the bridge only relays unencrypted rooms and the login type is acceptable to your security team. | Does not carry over to MAS-managed deployments for encrypted bridging. Review its use against your end-to-end encryption policy. | Whether the bridge still uses this login type in its current release, and whether your MAS configuration blocks it. |
Setting up a bridge on your homeserver
This sequence connects a bridge to your Synapse homeserver as an application service, so the bridge receives events for the users and rooms it owns. When it finishes, the bridge is registered, notified by the correct process, and reporting a live connection to the homeserver.
Generate the registration file from the bridge
The bridge team or your platform engineer runs the bridge's generate command with its configuration, which writes an appservice registration file, by default named registration.yaml. The file carries the bridge's tokens and the user and room namespaces it claims. Confirm the generator's current command in the bridge documentation for your version, then check that the file exists, contains both tokens, and that the namespace regular expressions match the bot user and the bridged user prefix you planned. Keep the file readable only by the homeserver and the bridge service, because its tokens grant API access.
Place the registration file where Synapse can read it
The Synapse administrator copies the registration file to a path the Synapse process can read, and adds that path to the app_service_config_files list in homeserver.yaml. Both the bridge and Synapse must see the same tokens, so copy the file rather than retyping values. Confirm that the list entry points to the exact file, that file ownership matches the Synapse service user, and that the config still parses before any restart. This check is a configuration review, not yet proof of registration.
Designate the notifier worker when workers are in use
If your homeserver runs workers, the platform engineer sets notify_appservices_from_worker to the name of one designated worker in the worker configuration, so that only that process sends events to application services. This worker cannot be load-balanced, so do not place it behind a pool of identical instances. Other workers must not also claim this duty. Verify that the designated worker starts cleanly, appears in your worker list, and that no other worker config enables the same duty. On a single-process homeserver, skip this step and note that decision in your runbook.
Restart Synapse and the bridge
The Synapse administrator restarts the homeserver processes so the registration takes effect, then starts or restarts the bridge service so it can connect with its configured homeserver address and tokens. Restart the designated notifier worker as part of this step if you use workers. Confirm that every Synapse process reports healthy, that the logs show no errors about the appservice configuration, and that the bridge's own log reports a successful connection to the homeserver. Record the restart time so you can match later log entries to it.
Verify the bridge claims its namespaces
After the restart, the administrator checks that the bridge's bot account is active and that the bridge has claimed the user and room namespaces from its registration file. A typical check is to message the bridge bot from a test account and confirm a reply, and to confirm that a bridged user ID in the planned namespace resolves on your server. If the bot does not respond, compare the tokens and URL in the bridge configuration with the registration file and the homeserver logs before changing anything else. Keep the test account and room in a list so you can remove them later.
Confirm event delivery and record the configuration
The platform engineer sends a message in a bridged room and confirms it reaches the third-party network, then sends a reply from that network and confirms it appears in Matrix. Watch for delays or missing events in both directions, which often point to the notifier worker or to a URL the homeserver cannot reach. Once both directions work, store the registration file securely, record the notifier worker name, bridge version, and test results in your runbook, and schedule a review date for the bridge's next upgrade. Ask the bridge vendor which settings change the registration file, because a regenerated file must be re-registered.
Why encrypted bridges need MSC4190 under MAS
Once Matrix Authentication Service (MAS) handles logins, an encrypted bridge cannot use the classic application service login type. Under MAS, the m.login.application_service login type is not available to encrypted bridges, so they need device management defined by MSC4190 instead. Each bridge then acts as its own device with its own end-to-end encryption keys, which is what lets it read and send messages in encrypted rooms. Plan this before you move the homeserver to MAS, because a bridge that worked on an unmigrated Synapse can stop working the moment its authentication path changes.
The requirements are concrete. MSC4190 device management requires Synapse 1.141.0 or later, and the bridge itself must implement MSC4190. Synapse being new enough is not enough on its own. Confirm with the bridge maintainers, in writing, which release of the bridge implements MSC4190 and which Synapse and MAS versions it has been tested against. Then check whether your current bridge version is that release or later, since upgrading a bridge and upgrading Synapse may need to happen in a specific order. Also list every bridge that encrypts, not only the ones you expect to, because unencrypted bridges may keep using the older path.
The migration docs for MAS describe how to move an existing homeserver, and they are the natural next read before you schedule any change. Ask your bridge vendor or maintainer for a test run against a staging Synapse with MAS enabled, and verify that messages flow in both directions in an encrypted room. Record the Synapse version, MAS version, and bridge version used in that test, so the production change repeats a known-good combination. Confirm that bridge sessions and their keys survive the cutover, because losing them can mean re-verifying the bridge and re-establishing its access to rooms.
Security and operational risks of bridges and bots
Application services run with privileges that ordinary users never get, so they widen the attack surface of the homeserver. The cards below cover the places where that extra reach tends to cause trouble: credentials, scope, encryption, network exposure, the notifier and version changes.
Registration file secrets
The registration file holds the appservice token and the homeserver token that authenticate the bridge to Synapse and back again. Anyone who reads that file can act as the bridge, so it should be readable only by the service account that runs the bridge. Check who can read the file on both the homeserver and the bridge host, and confirm that the tokens are rotated when a host is rebuilt or a staff member leaves.
Bridge setup docsNamespace scope creep
Namespaces decide which user IDs, room aliases and room IDs an appservice may claim. Broad regular expressions can let a bridge register or capture identities it was never meant to control, and a later bridge update can quietly widen the pattern. Review each namespace against the bridge's documented purpose, keep exclusive claims as narrow as the bridge needs, and re-check the file after every change to the bridge configuration.
Bridge access to encrypted room keys
A bridge that handles encrypted rooms holds device keys and message keys, so it can read content that users expect to stay end to end encrypted. Under MAS, the bridge also needs device management through MSC4190 rather than the older login type. Ask each bridge vendor where it stores these keys, how they are backed up, and who on your team can reach that storage.
Worker exposure and notifier failure
In a worker-based Synapse, one designated worker sends events to application services and cannot be load-balanced. If that worker stops, every bridge and bot silently stops receiving traffic, and the failure may look like a bridge fault. Monitor that worker separately, confirm which host runs it, and keep its replication and listener ports off untrusted networks.
Upgrade and rollback risk
Bridges, Synapse and MAS have to match each other's versions and feature requirements, such as the Synapse release that MSC4190 device management needs. Synapse upgrade notes warn that rolling back can be hard because database schemas change between releases. Before upgrading, read the notes for every component, take a database backup, and test the bridge against the new homeserver in a staging environment.
Synapse upgrade notesQuestions teams ask before building bridges and bots
What drives the cost of building a Matrix bridge or bot?
The cost is driven mostly by how many third-party systems the bridge must mirror and how much of their behavior you need to reproduce. Each bridge needs a registration file, namespace planning, a running process that holds the appservice token, and testing against real rooms and real accounts. Cost rises when you need message edits, reactions, file transfers, presence, or threads to map correctly, and when the third-party platform has unstable APIs or strict rate limits. Ask any partner to split the quote into one-time work (design, build, first deployment, testing) and recurring work (library and bridge upgrades, Synapse upgrades, credential rotation, monitoring). A quote that names the third-party platform, the features in scope and the Synapse version it targets is far easier to compare than a single lump sum.
How long does it take to get a first working bridge?
No researched figure is available for build duration, so the honest answer depends on scope, access and how many decisions are still open. The steps that usually take the longest are agreeing the namespaces the bridge may claim, getting the third-party credentials approved, and confirming that the homeserver can accept application services at all. A minimal proof of concept, with one room and one test account, moves much faster than a production bridge with user provisioning, backfill and encrypted rooms. Ask for a timeline in the written scope, with a named checkpoint where a working registration file, a running bridge and a test message are demonstrated on your own server.
What does our team need to supply before a bridge project starts?
Your team must supply a Synapse homeserver you can administer, the server_name you have chosen, access to the homeserver configuration and a place to run the bridge process. You will also need a service account on the third-party platform, an agreed list of rooms and users in scope, and an owner who can approve the namespaces the bridge is allowed to register. For a registration file, the bridge generates a file, usually registration.yaml by default, which must be added to the homeserver's configuration, so someone with config write access must be present for that step. Confirm these items with your security team early, because credentials and namespace choices affect what the bridge can see across the whole server.
Can our internal engineers run bridges and bots without a partner?
Yes, if you have engineers who can operate Synapse and a process supervisor, and who can read the bridge and Synapse upgrade notes before each upgrade. The routine work is more demanding than the first install: rotating tokens, watching the bridge logs, handling Synapse releases that change configuration, and restoring a bridge after a database problem. Synapse documents that rolling back can be difficult because of schema changes between releases, so every upgrade needs a tested plan. Teams with a single engineer who knows the setup should decide whether that person's absence would stop message relay, and whether a partner retainer or a documented runbook is the better cover.
How does Matrix Authentication Service change a bridge plan?
Under MAS, the older appservice login approach no longer fits encrypted bridges, so the plan must change before the bridge is built. Encrypted bridges cannot use the m.login.application_service login type under MAS, and they need MSC4190 device management, which requires Synapse 1.141.0 or later and a bridge that implements it. This means you must confirm three things before you commit: your Synapse version, whether your chosen bridge implements MSC4190, and whether your deployment already runs MAS. Unencrypted bridges may follow a different path, so ask the bridge vendor which login type each mode of operation uses. Plan the migration of existing bridge accounts as a separate work item with its own test window.
What goes wrong with the notification worker and bridge throughput?
The most common problem is pointing the appservice notifications at the wrong process, so events never reach the bridge. In Synapse, notify_appservices_from_worker designates a single worker to notify application services, and that worker cannot be load-balanced. If you scale Synapse with workers and send traffic to several copies of that process, appservice delivery can stall or duplicate, which looks like a bridge outage. Check the worker layout before the bridge goes live, confirm which process owns notifications, and test a restart of that process. Ask your partner or internal team to document the single point of delivery in the runbook.
When should we bring in a partner for bridges and bots?
Bring in a partner when the bridge touches encrypted rooms, MAS, or a third-party platform whose credentials or data rules are sensitive, or when your team lacks someone who can own the bridge after launch. A fixed-scope engagement suits a defined set of bridges with written deliverables, while a retainer suits continuing upgrades, Synapse releases and monitoring. DeployOpen implements self-hosted open-source platforms inside your own infrastructure, plans and documents the work, and supports systems after handover, but it does not issue audit reports or certifications. Ask for the scope, deliverables and timelines in writing before work starts, and make sure the handover includes the registration file, the namespace list and the upgrade runbook.
How DeployOpen scopes and delivers Matrix bridge work
DeployOpen plans, builds and hands over Matrix application services for bots and bridges inside infrastructure you control. Each engagement starts from a written scope that names the homeserver, the bridges and bots, the authentication path and the operators who will run them afterward.
How we scope
- Inventory the Synapse version, database, worker layout and whether MAS is in front of the homeserver.
- Define which third-party networks, bots and bridge types are in scope and which rooms they will touch.
- Confirm with the bridge vendor whether its build implements MSC4190 before any encrypted bridge is planned.
How we build
- Generate and register appservice registration files with namespaces agreed in advance and checked for overlaps.
- Designate the single notifying worker through notify_appservices_from_worker and route appservice traffic to it.
- Test bridge login, message flow and encrypted rooms in a staging environment before any production cutover.
How we hand over
- Deliver the written configuration, registration files, network routes and secrets locations with ownership noted.
- Document the upgrade sequence for Synapse, MAS and each bridge, including the database rollback limits in the upgrade notes.
- Walk your operators through restart order, log locations and the checks that show a bridge is connected.
How we support
- Engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts.
- Ongoing bridge upgrades, dependency reviews and retesting are available as a retainer.
- Ask any partner to state in the quote which components, versions and environments the work covers.

