Deploy OmniRoute Guardrails

PII masking and prompt-injection checks on your AI gateway

Deploy OmniRoute Guardrails

Just deployed

/app/data

Deploy and Host self hosted OmniRoute Guardrails (Self-Hosted AI Gateway with PII and Prompt-Injection Guardrails) on Railway

This template deploys OmniRoute with its guardrail layer enabled. pii-masker, credential-masker and prompt-injection checks run before requests reach a provider, and masking is opt-in.

About Hosting OmniRoute Guardrails open-source software on Railway (self hosted OmniRoute guardrails template)

This template runs one OmniRoute container, the diegosouzapw/omniroute image pinned at 3.8.51, on port 20128.

Railway handles the public domain, the health check against /healthz, restarts and the persistent volume.

Why Deploy OmniRoute Guardrails, the Cloudflare AI Gateway alternative on Railway (Railway Free Trial)

Cloudflare AI Gateway is a solid hosted choice if you're fine routing every prompt through their network.

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying OmniRoute Guardrails on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.

Railway vs Other Hosting Providers and VPS for OmniRoute Guardrails self hosting

Guardrails mean one long-lived container, a persistent SQLite volume, and an HTTPS domain, so this comparison focuses on how much of that you handle yourself.

ProviderWhat You Get with RailwayWhat You Get with the Other Provider
DigitalOceanA template with the pinned OmniRoute image, a volume at /app/data, generated secrets, and HTTPS.Full Droplet control, but you handle Docker, the reverse proxy, TLS, and volume backups.
AWSDeploys with no VPC, load balancer, or IAM policy to set up first.Maximum flexibility, but networking, certificates, and snapshots are on you.
HetznerSimpler setup for a small gateway, with the container, domain, and volume handled for you.Low-cost servers with generous bandwidth, but you run patches, Docker, and TLS yourself.

Common Use Cases for hosted OmniRoute Guardrails

  • Redacting customer emails and phone numbers: pii-masker strips email addresses and phone numbers from support ticket text before the prompt leaves your network. Enable only the PII types you need.
  • Catching leaked API keys in pasted logs: credential-masker runs on the request and the response, so a key pasted into a prompt gets redacted before the upstream provider sees it.
  • Flagging prompt-injection in RAG inputs: The prompt-injection guard runs before the call on LLM routes, so you can block or log instructions hidden in retrieved documents.
  • One policy for every coding tool on the team: Claude Code, Cursor and Cline all point at the same /v1 endpoint, so one guardrail configuration covers all of them.
  • Audit counters per guardrail: Per-type detection counters show how often each masker and the injection check fired, which helps you tune patterns and prove the controls work.

Dependencies for OmniRoute Guardrails Docker hosted on Railway

The gateway runs as one container with SQLite on a mounted volume, so there is no database or cache to provision.

Deployment Dependencies for Managed OmniRoute Guardrails Service (AI Gateway Guardrails)

Run the pinned image diegosouzapw/omniroute:3.8.51 as a single service on port 20128, with a health check at /healthz and a volume mounted at /app/data.

Implementation Details for OmniRoute Guardrails (Using OmniRoute official docker image)

Set PORT=20128, HOSTNAME=0.0.0.0 and DATA_DIR=/app/data. Storage is SQLite with WAL in /app/data, and provider keys are encrypted with AES-256-GCM.

How does OmniRoute Guardrails compare against other ways to put guardrails in front of LLM calls

OmniRoute vs Cloudflare AI Gateway (Cloudflare AI Gateway Alternative)

  • Where it lives: OmniRoute runs on your own host, so masking happens inside your network before anything reaches a provider.
  • Guardrail depth: pii-masker, credential-masker and prompt-injection are built into the gateway itself, not tied to a hosted logging product.
  • Where Cloudflare wins: it is fully managed with a global edge network, so there is nothing for you to patch or keep running.

OmniRoute vs LiteLLM guardrails (LiteLLM Guardrails Alternative)

  • Shape of the project: LiteLLM is an open-source proxy with guardrail integrations, while OmniRoute ships built-in hooks with per-type PII selection and up to 20 custom masking patterns.
  • Priority order: OmniRoute runs guardrails in a fixed order, so you can reason about what fires first.
  • Where LiteLLM wins: its catalog of third-party guardrail integrations is larger, so check it first if you need a specific vendor.

OmniRoute vs Portkey (Portkey Alternative)

  • Deployment choice: Portkey offers an open-source core plus hosted plans, while OmniRoute is self-hosted only, keeping the whole data path under your control.
  • Fail-open default: a guardrail error does not block a request unless that guardrail explicitly decides to block.
  • Where Portkey wins: its managed dashboards and hosted plans take more operational work off your plate.

OmniRoute vs no gateway (Provider Safety Only Alternative)

  • Coverage: without a gateway, each tool talks to providers directly, so there is no single place to mask PII or credentials across all of them.
  • Gateway benefit: one OpenAI-compatible endpoint at /v1 means one guardrail policy covers every tool pointed at it.
  • Where going direct wins: there is no extra hop or service to run, and provider-side safety still applies on its own for a single low-risk app.

How to use OmniRoute Guardrails (the OSS AI gateway)?

  1. Log into the dashboard at /dashboard with your INITIAL_PASSWORD, then change it.
  2. Connect at least one provider account, since guardrails only act once traffic flows.
  3. Open the Guardrails or Security settings. These move between versions, so check your build.
  4. Turn on PII masking and credential masking. Both are opt-in.
  5. Pick the PII types you need and add a custom pattern for internal IDs.
  6. Keep prompt-injection detection on.
  7. Send a test request with a fake email and fake key:
curl https://YOUR_OMNIROUTE_DOMAIN/v1/chat/completions \
  -H "Authorization: Bearer sk-fake-test-key-000000" \
  -H "Content-Type: application/json" \
  -d '{"model":"auto","messages":[{"role":"user","content":"Email jane.doe@example.com, key AKIAFAKEFAKEFAKE12"}]}'
  1. Check the logs for the masked payload and per-guardrail counters. If the email or key still appears unmasked, that route isn't covered, so don't treat it as a security control yet.

How to self host OmniRoute Guardrails on other VPS Services (OmniRoute self hosting guide)

Running OmniRoute on your own VPS gives you the same guardrail layer as the Railway template, but you manage the box, TLS and upgrades yourself.

Clone the Repository

Pull the source so you can read docs/security/GUARDRAILS.md before enabling anything.

git clone https://github.com/diegosouzapw/omniroute.git
cd omniroute

Install Dependencies

Pull the official image pinned to a version, and confirm the tag against your Guardrails settings.

docker pull diegosouzapw/omniroute:3.8.51

Configure Environment Variables

Set the secrets and public URL, and keep the auth cookie secure. Use your own values.

INITIAL_PASSWORD=your-strong-password
JWT_SECRET=your-jwt-secret
API_KEY_SECRET=your-api-key-secret
BASE_URL=https://your-domain
AUTH_COOKIE_SECURE=true
REQUIRE_API_KEY=true

Start the OmniRoute Guardrails Application

Run the container on port 20128 with a persistent volume for /app/data, then check /healthz behind a TLS reverse proxy.

docker run -d -p 20128:20128 -v omniroute-data:/app/data --env-file .env diegosouzapw/omniroute:3.8.51

On a VPS you handle backups, TLS renewal and updates yourself, while Railway handles those for you.

Official Pricing of OmniRoute Guardrails (OmniRoute pricing)

OmniRoute is open source under the MIT license, so there is no subscription and no per-request fee for the gateway or its guardrails.

OmniRoute Guardrails cloud vs self hosted comparison (Pricing, features, costs, and more)

Self hosting keeps the guardrail layer, the gateway and your provider keys on infrastructure you control.

Monthly cost of self hosting OmniRoute Guardrails on Railway

On Railway, expect roughly $5 to $15 per month for light use at 1 to 2 GB of memory. Check current usage rates in your own account before you commit to a budget.

System Requirements for Hosting OmniRoute Guardrails on a VPS

The default OMNIROUTE_MEMORY_MB is 1024, which suits the dashboard and light chat. Coding-agent workloads need the larger memory figure from the upstream docs.

Frequently Asked Questions (FAQs)

Is masking turned on by default?

No. Check the settings in your OmniRoute version, since defaults change between releases.

What happens if a guardrail fails?

The system is fail-open. Watch the detection counters and logs so a broken guardrail doesn't quietly let requests through.

Does it slow requests down?

The pre-call guardrails run before the request goes upstream, so they add some latency.

Does it cover streaming responses?

pii-masker and credential-masker also run on responses, but the hooks do not run on every route or every response.

Can I add my own patterns?

Yes. You can add up to 20 custom masking patterns, each validated when saved.

Does it replace provider-side safety?

No. Guardrails catch things at your gateway before they leave, and the provider's own safety systems still apply. Treat them as separate layers.


Template Content

More templates in this category

View Template
Chat Chat
Chat Chat, your own unified chat and search to AI platform.

okisdev
117
View Template
NEW
Weaviate
Vector database with hybrid search and an API key-protected API

zer0person
1
View Template
NEW
Möbius v0.1 Personal AI OS
Self-hosted AI agent that builds and runs apps for you, with memory.

bento
1