Skip to main content

trigguard-litellm

LiteLLM callback that gates every model call through TrigGuard POST /execute.

LiteLLM can only halt a call by raising. Those raises are control flow, not a binary error model.

Gateway Meaning Callback
PERMIT Authorized; caller may execute return (continue)
DENY Explicitly do not execute (terminal) TrigGuardDenied
ESCALATE Do not execute yet; approval required TrigGuardEscalationRequired
SILENCE No actionable authorization TrigGuardNoDecision (fail closed, not a denial)

ESCALATE ≠ DENY. SILENCE ≠ DENY. SILENCE ≠ PERMIT. OBSERVE does not proceed.

Install

pip install trigguard-litellm
# optional: pip install 'trigguard-litellm[litellm]'

Usage

import litellm
from trigguard_litellm import TrigGuardLiteLLMCallback

litellm.callbacks = [
    TrigGuardLiteLLMCallback(
        gateway_url="https://api.trigguardai.com",
        api_key="tg_live_...",
    )
]

Constructor arguments default to TRIGGUARD_GATEWAY_URL and TRIGGUARD_API_KEY.

Imperative gate (no LiteLLM required):

from trigguard_litellm import TrigGuardPolicyGate

gate = TrigGuardPolicyGate(
    gateway_url="https://api.trigguardai.com",
    api_key="tg_live_...",
)
result = gate.authorize(context={"model": "gpt-4o"})

Related

  • @trigguard/execution-sdk — Node client for the same /execute rail
  • trigguard on PyPI — Python SDK (authorize / verify)

Download files

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

Source Distribution

trigguard_litellm-0.1.1.tar.gz (10.5 kB view details)

Uploaded Source

Built Distribution

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

trigguard_litellm-0.1.1-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file trigguard_litellm-0.1.1.tar.gz.

File metadata

  • Download URL: trigguard_litellm-0.1.1.tar.gz
  • Upload date:
  • Size: 10.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for trigguard_litellm-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0030fa5b8ebcab026cd7e3a50c696c3cb4b79290d9d968bae933529f970e051b
MD5 4ed0cccc135c33f75235f7a2e1a48e6c
BLAKE2b-256 d4c568003a91a7655eaf7400e2cb9e4bb2f17583cf5e2a77e410f0226accd8d6

See more details on using hashes here.

File details

Details for the file trigguard_litellm-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for trigguard_litellm-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7236db65e1e1ed0989ea1e7a3e7e1e6d7707a9fb3c63861a336d96fc67d27515
MD5 b8b8ac65e1d6808d12a0877dd63a0a7e
BLAKE2b-256 397efa2d9215d633fccd3fb2dfafe9315fa3db986238d839c3270d9548662a1f

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page