Skip to main content

TrigGuard LiteLLM (trigguard-litellm)

Authorize LLM/provider effects with TrigGuard. Two explicit modes — do not confuse them.

TRIGGUARD_PROTECTED (FULLY_ENFORCED)

TrigGuard controls the final provider execution path:

Application → ExecutionIntent → Gateway (Rust Authority) → PERMIT + EAT
  → execution-proxy (PE verify + consume) → llm connector
  → server-owned provider credential → provider effect
from trigguard_litellm import protected_completion

result = protected_completion(
    proxy_url="https://execution-proxy.example",
    trigguard_api_key="tg_live_...",
    model="gpt-4o-mini",
    messages=[{"role": "user", "content": "hello"}],
    provider="openai",
    org_id="org_...",
    mode="TRIGGUARD_PROTECTED",
)

Requirements

  • Provider secrets live only on the execution-proxy host: TRIGGUARD_SERVER_OWNED_LLM_API_KEY (or TRIGGUARD_SERVER_OWNED_OPENAI_API_KEY)
  • Agent process must not hold OPENAI_API_KEY / equivalent (direct bypass blocked)
  • Caller-supplied api_key in the proxy target/payload is rejected
  • Disposable hermetic canary: TRIGGUARD_LLM_DISPOSABLE_STUB=1 on the proxy

Presented PERMIT, HTTP 200, and OBSERVE are never enough.

UNPROTECTED_OR_PARTIAL (PARTIALLY_ENFORCED)

Your workload retains provider credentials and may still call the provider outside TrigGuard. The LiteLLM callback requires PERMIT + EAT before continuing, but there is no PE consume and no credential sovereignty.

import litellm
from trigguard_litellm import TrigGuardLiteLLMCallback

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

Do not market this mode as fully protected. There is no “green shield” for PARTIAL mode.

Set mode via constructor or TRIGGUARD_LITELLM_MODE=TRIGGUARD_PROTECTED|UNPROTECTED_OR_PARTIAL.

Install

pip install trigguard-litellm
# optional LiteLLM runtime
pip install 'trigguard-litellm[litellm]'
  • Support matrix: docs/SUPPORT_MATRIX.md
  • Adapter contract: docs/adapters/ADAPTER_ENFORCEMENT_CONTRACT.md
  • Execution proxy: packages/trigguard-execution-proxy

Metadata

Release files for trigguard-litellm 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for trigguard-litellm 0.2.0
File Size Uploaded Provenance
trigguard_litellm-0.2.0.tar.gz 10.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for trigguard-litellm 0.2.0
File Interpreter ABI Platform
trigguard_litellm-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 19.9 kB

Release files / trigguard_litellm-0.2.0.tar.gz

Download URL trigguard_litellm-0.2.0.tar.gz
Size 10.4 kB
Tags Source
SHA-256 checksum
How to use checksums
bd1342b1151242a898b0f28b6c4d0ebaf54f75b9b032c7f21d28dc196f1c92b6
BLAKE2b-256 checksum
How to use checksums
ca9376f002675c09925f4b102aeb0041b9b2c46938d2e37a1d65c2711c4c2cfd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.15

Release files / trigguard_litellm-0.2.0-py3-none-any.whl

Download URL trigguard_litellm-0.2.0-py3-none-any.whl
Size 9.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3ad7b161f8360fd6c64390a0e8c363ad2d52f30e0657b262e717baa702b26aa1
BLAKE2b-256 checksum
How to use checksums
34449a12c750c8bd7496b6c2bd3612807f4a1f92855e3af10f0cd888a2d77e42
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.15

Security for trigguard-litellm 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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