Event Router
Central event dispatcher: receives events, matches routing rules, fans out to n8n, state or actions.
Status, in the repository's words: 1.1.x is the current version line and receives security fixes.
What it is
A FastAPI service that gives a multi-agent system a single place to emit events and have them routed.
Producers emit a typed event once, and the router passes it to whichever consumers a rule file names.
It matches events against glob-pattern routing rules and dispatches them to three consumer types.
The docs describe it as lightweight and say it is not a message broker with durable ordered topics.
What it does today
- Receives events at POST /events; by default the sender does not wait for delivery (fire-and-forget).
- Validates events against a versioned event taxonomy kept in taxonomy.yaml.
- Routes with glob patterns from routing-rules.yaml, which is reloaded without a restart.
- Dispatches to n8n webhooks, conductor state, or direct actions.
- Failed deliveries land in a SQLite dead-letter queue and can be replayed.
- A consumer can delay delivery with delay_seconds and collapse duplicate events with dedup_key.
- Logs every routing decision and tracks workflow health against SLA.
- Prunes and archives its own database on a schedule or on request.
- Every route except /health, /metrics and /static/* needs a bearer token.
- The router is the only program that may open its SQLite file; other tools read through the HTTP API.
What it ships
- hook-dispatch.py: reads a Claude Code hook payload from stdin and posts a derived event to the router.
- emit-event.sh: a command-line emitter that sends an event without waiting and never blocks the caller.
- bridge-daemon.py (optional): follows the routing log through the API and mirrors events into downstream consumers.
- prune_event_db.py and prune-event-db.sh (optional): a scheduler entry point that asks the router to prune.
- n8n-health-poller.py: polls n8n executions and updates the router's workflow-health table.
- Working example configuration files in config.example/.
- A Dockerfile that builds a minimal image running as a non-root user.
- A small dashboard page served at / (see known issues).
What it needs
- Python 3.12.
- Seven pinned Python dependencies.
- A bearer token in EVENT_ROUTER_TOKEN is required; when it is unset, protected routes answer 503.
- Three YAML configuration files in the directory named by EVENTS_DIR.
- Docker and Docker Compose are optional.
- The optional bridge mirror also needs the psycopg2 Postgres client.
Install
Copied from the repository's README. This site has not run these commands.
mkdir -p ~/.config/event-router cp config.example/*.yaml ~/.config/event-router/ pip install -r requirements.txt export EVENTS_DIR=~/.config/event-router export EVENT_ROUTER_TOKEN=$(python3 -c "import secrets; print(secrets.token_urlsafe(32))") uvicorn app.main:app --host 127.0.0.1 --port 8085
Limits and known issues, as the repository lists them
As listed on branch main of BulletproofSoftwareAI/bulletproof-event-router on 2026-11-30, commit 88ae73c: newer than the version described above.
- A missing taxonomy.yaml fails open: the router then accepts all events.
- Outbound webhooks are unsigned: the router posts the event JSON with no signature.
- The router database stores the full payload of every event in its routing log.
- The router does not provide multi-tenancy or per-caller authorization.
- Known gap: the dashboard page cannot send the router token, so with auth on it answers 401; use the JSON endpoints.
- The router process is the only thing that may open its database file.
Works with
Documents in the repository
Where each statement on this page comes from
Read from BulletproofSoftwareAI/bulletproof-event-router, branch main, commit e6a6e87; the limits and known issues from BulletproofSoftwareAI/bulletproof-event-router, branch main, commit 88ae73c, read on 2026-11-30. File and line for each statement:
- Central event dispatcher: receives events, matches routing rules, fans out to n8n, state or actions.
README.md:3 - 1.1.x is the current version line and receives security fixes.
SECURITY.md:9 - 1.1.3
app/__init__.py:4 - 2026-11-14
CHANGELOG.md:6 - Apache-2.0
README.md:172 - A FastAPI service that gives a multi-agent system a single place to emit events and have them routed.
README.md:14 - Producers emit a typed event once, and the router passes it to whichever consumers a rule file names.
docs/OVERVIEW.md:14 - It matches events against glob-pattern routing rules and dispatches them to three consumer types.
README.md:16 - The docs describe it as lightweight and say it is not a message broker with durable ordered topics.
docs/OVERVIEW.md:97 - Receives events at POST /events; by default the sender does not wait for delivery (fire-and-forget).
README.md:22 - Validates events against a versioned event taxonomy kept in taxonomy.yaml.
README.md:23 - Routes with glob patterns from routing-rules.yaml, which is reloaded without a restart.
README.md:24 - Dispatches to n8n webhooks, conductor state, or direct actions.
README.md:25 - Failed deliveries land in a SQLite dead-letter queue and can be replayed.
README.md:26 - A consumer can delay delivery with delay_seconds and collapse duplicate events with dedup_key.
docs/HOW-TO-USE.md:143 - Logs every routing decision and tracks workflow health against SLA.
README.md:27 - Prunes and archives its own database on a schedule or on request.
README.md:31 - Every route except /health, /metrics and /static/* needs a bearer token.
README.md:33 - The router is the only program that may open its SQLite file; other tools read through the HTTP API.
README.md:109 - hook-dispatch.py: reads a Claude Code hook payload from stdin and posts a derived event to the router.
README.md:126 - emit-event.sh: a command-line emitter that sends an event without waiting and never blocks the caller.
README.md:127 - bridge-daemon.py (optional): follows the routing log through the API and mirrors events into downstream consumers.
README.md:128 - prune_event_db.py and prune-event-db.sh (optional): a scheduler entry point that asks the router to prune.
README.md:130 - n8n-health-poller.py: polls n8n executions and updates the router's workflow-health table.
README.md:131 - Working example configuration files in config.example/.
README.md:45 - A Dockerfile that builds a minimal image running as a non-root user.
docs/INSTALL.md:52 - A small dashboard page served at / (see known issues).
README.md:28 - Python 3.12.
docs/INSTALL.md:9 - Seven pinned Python dependencies.
docs/INSTALL.md:3 - A bearer token in EVENT_ROUTER_TOKEN is required; when it is unset, protected routes answer 503.
README.md:96 - Three YAML configuration files in the directory named by EVENTS_DIR.
README.md:37 - Docker and Docker Compose are optional.
docs/INSTALL.md:14 - The optional bridge mirror also needs the psycopg2 Postgres client.
docs/INSTALL.md:12 - A missing taxonomy.yaml fails open: the router then accepts all events.
docs/ADMINISTRATOR.md:256 at 88ae73c - Outbound webhooks are unsigned: the router posts the event JSON with no signature.
docs/ADMINISTRATOR.md:115 at 88ae73c - The router database stores the full payload of every event in its routing log.
SECURITY.md:61 at 88ae73c - The router does not provide multi-tenancy or per-caller authorization.
SECURITY.md:69 at 88ae73c - Known gap: the dashboard page cannot send the router token, so with auth on it answers 401; use the JSON endpoints.
README.md:28 at 88ae73c - The router process is the only thing that may open its database file.
docs/ADMINISTRATOR.md:8 at 88ae73c - The optional bridge daemon can mirror events into runtime-security.
README.md:128 - The optional bridge daemon can send a cost backfill to metrics-engine over HMAC-signed HTTP.
CHANGELOG.md:118 - hook-dispatch.py can optionally mark the session active in agent-economics.
docs/OVERVIEW.md:85 - Install section of the README
README.md:59
Bulletproof suite v1.0.0 pins tag v1.1.3, commit e6a6e87, tagged 2026-11-14.