Skip to main content

Local-first, agent-native inbound gate runtime.

Project description

OpenGates

Source-available runtime for filtering inbound through conversation.

OpenGates lets you define what you care about in a few files, then handles the inbound thread for you: decline, ask a bounded follow-up, or escalate with a clean summary. It is the runtime behind Ante, the hosted product.

What It Does

OpenGates is built for attention gating:

  • define a gate with Markdown files instead of a large config surface
  • run a threaded decision loop over inbound messages
  • return one of three outcomes: decline, clarify, or escalate
  • keep decision guardrails and persistence outside the model
  • ship with a minimal FastAPI UI and HTTP endpoints you can build on

Why This Exists

Outbound is getting cheaper every month. More agents will write to you, not fewer. If every inbound message can be polished, the bottleneck becomes judgment.

OpenGates is the runtime for that judgment layer:

  • local-first by default
  • file-based and auditable
  • useful without mailbox access
  • usable with heuristics today and stronger model providers later

Status

  • Source-available under Elastic License 2.0
  • Python 3.10+
  • Install from source today
  • PyPI package name: opengates

Quick Start

git clone https://github.com/nvsudo/opengates
cd opengates
uv sync
uv run opengates serve --host 127.0.0.1 --port 8000

Open http://127.0.0.1:8000/demo.

The repo includes a starter gate under gates/demo-investor. If you run from a clean working directory without a local ./gates, OpenGates falls back to the bundled starter gate packaged with the runtime.

Install Options

With uv:

uv sync
uv run opengates serve

With pip:

python -m venv .venv
source .venv/bin/activate
pip install -e .
opengates serve

How It Works

  1. A sender starts a thread through the built-in UI or an external client.
  2. OpenGates loads the gate bundle for that gate.
  3. A decision provider evaluates the current turn.
  4. The runtime enforces guardrails and returns decline, clarify, or escalate.
  5. Thread state, messages, decisions, and sender profile data are persisted locally.
  6. The built-in UI or your own frontend can render the next step.

Gate Bundle

Each gate lives in gates/<gate_id>/ and usually includes:

gates/my-gate/
  focus.md
  standards.md
  voice.md
  examples.md
  gate.yaml
  • focus.md: what the gate is for
  • standards.md: what good looks like
  • voice.md: how replies should sound
  • examples.md: examples that sharpen judgment
  • gate.yaml: optional UI and runtime settings

Common gate.yaml fields:

title: Investor Gate
assistant_name: OpenGates
surface_label: gate
public_path: /investor
max_clarification_rounds: 2
principal_email: founder@example.com

Supported UI fields include:

  • assistant_avatar
  • assistant_status
  • welcome_headline
  • welcome_body
  • composer_placeholder
  • invited_topics

Create a new gate from the starter bundle:

opengates init-gate --from demo-investor --to my-gate

Providers

OpenGates currently supports two decision paths:

  • heuristic: no API key required, good for obvious spam and explicit rules
  • openai: uses the OpenAI Responses API for more ambiguous cases

Use the OpenAI provider by creating a .env file in your working directory:

OPENGATES_PROVIDER=openai
OPENAI_API_KEY=your_key_here
OPENGATES_OPENAI_MODEL=gpt-5-mini
OPENGATES_DEBUG_PROMPTS=1

Notes:

  • .env and .env.local are read from the current working directory
  • if OPENGATES_CONFIG_DIR is set, config is read from there instead
  • if the OpenAI call fails, the runtime falls back to heuristics

Escalation Email

OpenGates can send an escalation email when:

  • principal_email is set in gate.yaml
  • SMTP settings are configured
OPENGATES_SMTP_HOST=smtp.example.com
OPENGATES_SMTP_PORT=587
OPENGATES_SMTP_USERNAME=...
OPENGATES_SMTP_PASSWORD=...
OPENGATES_SMTP_USE_TLS=1
OPENGATES_SMTP_USE_SSL=0
OPENGATES_NOTIFICATION_FROM_EMAIL=gatekeeper@example.com
OPENGATES_NOTIFICATION_FROM_NAME=OpenGates

CLI

opengates serve
opengates list-gates
opengates init-gate --from demo-investor --to my-gate

Project Layout

gates/
  demo-investor/
src/opengates/
  app.py
  runtime.py
  gates.py
  storage.py
  schemas.py
  providers/
  starter_gates/
  templates/
tests/

Development

Run tests:

uv run python -m pytest

Build the package:

uv build

License

OpenGates is source-available under Elastic License 2.0.

That means:

  • internal use is allowed, including inside commercial companies
  • modification is allowed
  • redistribution is allowed subject to the license terms
  • offering OpenGates itself as a hosted or managed service is not allowed

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

opengates-0.1.0.tar.gz (29.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

opengates-0.1.0-py3-none-any.whl (33.3 kB view details)

Uploaded Python 3

File details

Details for the file opengates-0.1.0.tar.gz.

File metadata

  • Download URL: opengates-0.1.0.tar.gz
  • Upload date:
  • Size: 29.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for opengates-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e1b07bedc465e8b10226f71228d6e75d64ec78271462b8bd29ba856fba7be728
MD5 e22d0668a2fccc427ec6ba239bca7b6d
BLAKE2b-256 e719b8a51cff152d2b741e80dd4c422b57c37fcac426bfcba3468081ac472627

See more details on using hashes here.

Provenance

The following attestation bundles were made for opengates-0.1.0.tar.gz:

Publisher: release.yml on nvsudo/opengates

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file opengates-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: opengates-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 33.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for opengates-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2ef8b3a9689ddef413f664703c602661f710cbe4f6b518b48c51d09ede2a78a7
MD5 94d234e0a6e838f2a72745df2a441510
BLAKE2b-256 794fa6abb22a7d69af9364d58100c2d284b313f826b226dda4fb40496958b148

See more details on using hashes here.

Provenance

The following attestation bundles were made for opengates-0.1.0-py3-none-any.whl:

Publisher: release.yml on nvsudo/opengates

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page