gateway logo

gateway

trylonai/gateway

Self-hosted firewall for securing AI applications with guardrails and content moderation.

GraphCanon updated today · GitHub synced today

126 stars12 forksLast push 1y Python Other

Decision brief

Self-hosted firewall for securing AI applications with guardrails and content moderation.

Good fit when

  • When you need to self-host a secure gateway for LLM-based AI applications that requires local deployment via Docker
  • If your application requires PII redaction or prompt injection prevention measures built into the gateway framework

Avoid when

  • Avoid if you are looking for cloud-managed services, as this tool is designed solely for local or self-hosted environments
  • Not suitable if you require extensive customization beyond the provided policies.yaml file and predefined guardrails for content moderation and security
Pricing:
freemium - Open-source with no explicit monetary cost, but requires users to handle infrastructure costs associated with local Docker deployment
Requirements:
Min 4 GB RAM; Requires Docker; Docker and Docker Compose are required for deployment; Initial launch takes several minutes due to downloading machine learning models (~1.5GB+) for the first time

Observed Jul 15, 2026 · Source: enrich:decision_facts

Verify the decision

Maintenance and security

Full trust report
Maintenance
Dormant (385d since push)
As of today
Provenance
Not a fork · Organization account
As of today
Security (OSV)
No lockfile
As of today

Public GitHub metadata and optional OSV scans. Signals, not a guarantee. Trust methodology.

Install

pip install gateway
PyPI

Similar tools

Same-category neighbours. No typed graph edges are catalogued for this tool yet.

Evidence and technical details

Sourced facts, taxonomy, compatibility claims, README excerpt, and machine-readable endpoints.

Overview

trylonai/gateway provides an open-source gateway to secure LLM-based AI applications by implementing powerful guardrails and measures such as PII redaction, prompt injection prevention, and more. Users can deploy the service locally via Docker. The framework allows for custom policies to control access and content flow through API requests.

Capability facts

Deploy
Self-host

Source: dockerfile:Dockerfile · Jul 15, 2026

Docker
Dockerfile present

Source: dockerfile:Dockerfile · Jul 15, 2026

Languages
python

Source: github.language+pyproject.toml · Jul 15, 2026

Categories

Tags

README

Quick Start

The fastest way to deploy your own AI Gateway.

Prerequisites: Docker and Docker Compose.

  1. Clone the repository:

    git clone https://github.com/trylonai/gateway.git
    cd gateway
    
  2. Prepare your environment:

    # Copy the example environment file. No edits are needed to run the quick start.
    cp .env.example .env
    
    # An example policies.yaml and docker-compose.yml are already present.
    
  3. Launch the Gateway:

    docker-compose up -d
    

    Note: The first launch will take several minutes. The gateway needs to download the machine learning models (~1.5GB+). Subsequent launches will be much faster because the models are stored in a persistent Docker volume (trylon_hf_cache).

    You can monitor the download progress and see when the application is ready by watching the logs:

    docker-compose logs -f
    
  4. Test a Guardrail in Action

    The default policies.yaml comes with a PII guardrail enabled to block any request containing an email address. Let's test it.

    curl -s -X POST "http://localhost:8000/v1/chat/completions" \
      -H "Authorization: Bearer $OPENAI_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "model": "gpt-3.5-turbo",
        "messages": [{"role": "user", "content": "My email address is test@example.com"}]
      }' | jq
    

    You'll see a response with finish_reason: "content_filter", confirming the block. Congratulations! You've just seen a guardrail in action without writing any code.

For agents

This page has a .md twin and JSON over the API.

Was this helpful?

Anonymous feedback helps us improve pages and translations.