Skip to main content

DBL Gateway

Project description

dbl-gateway

pytest PyPI Python >=3.11

When organizations deploy LLM systems, they quickly need to answer three questions: Who asked what, what was permitted, and what actually happened.

dbl-gateway is the reference runtime implementation of the DBL execution boundary for the Deterministic Boundary Layer. It accepts declared intents, enforces policy decisions, and records everything as an append-only, digest-pinned event stream.

Part of the Deterministic Boundary Layer architecture.

Model

Every request passes through the same deterministic chain:

INTENT  ->  DECISION  ->  PROOF  ->  EXECUTION

INTENT records what was asked.
DECISION records what policy allowed.
PROOF records what will be sent.
EXECUTION records what happened.

Only DECISION events are normative. Execution output never feeds back into policy.

Example

Send an intent through POST /ingress/intent and read events through GET /tail?stream_id=default&since=0.

See docs/QUICKSTART.md for the full envelope example.

Zero-Config Demo

No API keys, no .env editing. See the full governance pipeline in 60 seconds:

docker compose --profile demo up --build

Open http://localhost:8010/ui/ and click Start Demo.

Or locally:

GATEWAY_DEMO_MODE=1 dbl-gateway serve

The stub provider generates synthetic responses through the full INTENT, DECISION, PROOF, EXECUTION chain. Demo mode also enables context resolution by default so observer replay works without extra env setup.

One-Command Start

Configure .env once from ​.env.example, set one provider key or local Ollama, then start the gateway with:

docker compose up --build

Open http://localhost:8010/ui/ to watch the event chain in real time.

On Windows, use:

.\run_demo.ps1

Observer UI

Install

pip install dbl-gateway

Or from source:

pip install -e .

Run With Docker

cp .env.example .env
# add one provider key or configure local Ollama in .env
docker compose up --build

Supports OpenAI, Anthropic, or local Ollama. One active provider is enough to run the gateway.

.env is local and must not be committed. Copy .env.example and configure it for your environment.

Run Locally

export DBL_GATEWAY_DB=./data/trail.sqlite
export DBL_GATEWAY_POLICY_MODULE=dbl_policy.allow_all
export DBL_GATEWAY_POLICY_OBJECT=policy
export OPENAI_API_KEY=sk-...

dbl-gateway serve --host 127.0.0.1 --port 8010

Observer

Open /ui to watch the event chain in real time.

The built-in observer includes the event stream, decision replay, chain verification, manual intent submission, and the integrated demo controller.

Discovery

The runtime exposes three machine-readable discovery surfaces:

  • GET /capabilities
  • GET /surfaces
  • GET /intent-template

Together they describe what the gateway can do, which surfaces exist, and how to speak valid ingress envelopes.

Documentation

See:

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

dbl_gateway-0.9.8.tar.gz (108.9 kB view details)

Uploaded Source

Built Distribution

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

dbl_gateway-0.9.8-py3-none-any.whl (92.1 kB view details)

Uploaded Python 3

File details

Details for the file dbl_gateway-0.9.8.tar.gz.

File metadata

  • Download URL: dbl_gateway-0.9.8.tar.gz
  • Upload date:
  • Size: 108.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for dbl_gateway-0.9.8.tar.gz
Algorithm Hash digest
SHA256 c17a879ca4cc4f74e84e608c33ce3c2d7c95b4593961a153e96cc7e0284e9bda
MD5 f7882a1b7e480c4fe09ecac6b60e4900
BLAKE2b-256 f0e2757757b39c43fb54853be1e5bc027745e79c8b8886775747032db9c041e3

See more details on using hashes here.

File details

Details for the file dbl_gateway-0.9.8-py3-none-any.whl.

File metadata

  • Download URL: dbl_gateway-0.9.8-py3-none-any.whl
  • Upload date:
  • Size: 92.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for dbl_gateway-0.9.8-py3-none-any.whl
Algorithm Hash digest
SHA256 532bfc1a41d3e02f1618decfe5406aaa189e0f97d9a6838b9f42023b4d79a53b
MD5 e4d5a53557c7690835571a2e0f8bf400
BLAKE2b-256 d8459db4d4286d60170e0b083455c0970211c9a8b2cbe756ed0d00e92991767f

See more details on using hashes here.

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