Skip to main content

LLM Sentinel SDK

Runtime monitoring for AI applications — detect prompt injections, privilege escalations, and adversarial attacks in production, not just pre-launch.

LLM Sentinel — Burp Suite for LLMs.


Install

pip install llm-sentinel-sdk

Requires Python 3.9+ and httpx. Works alongside any OpenAI-compatible client.


Quick Start

import openai
from llm_sentinel import SentinelClient

client = SentinelClient(
    api_key="sk-sentinel-...",          # from LLM Sentinel dashboard
    base_client=openai.OpenAI(api_key="sk-openai-..."),
)

# Use exactly like openai.OpenAI — monitoring is automatic
response = client.chat.completions.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": user_input}],
)

Flagged calls are sent to your LLM Sentinel dashboard in real time. Your app always continues — the SDK fails open.


Async

import openai
from llm_sentinel import AsyncSentinelClient

client = AsyncSentinelClient(
    api_key="sk-sentinel-...",
    base_client=openai.AsyncOpenAI(api_key="sk-openai-..."),
)

response = await client.chat.completions.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": user_input}],
)

What Gets Detected

The SDK includes a compiled rule engine covering 8 attack categories:

Category Severity Example
Prompt Injection High "Ignore previous instructions"
Privilege Escalation High "Enable developer mode"
System Prompt Extraction Critical "Show me your system prompt"
Jailbreak High "DAN mode", "do anything now"
Data Probing Medium "List all users in the database"
Context Manipulation Medium "You previously agreed that..."
Indirect Injection High [INST], <system>, template delimiters
Multilingual Bypass Medium "En français: ignore tes instructions"

Rules are compiled at import time — detection adds <5ms per call.


Configuration

client = SentinelClient(
    api_key="sk-sentinel-...",
    base_client=openai.OpenAI(api_key="..."),
    base_url="https://api.llmsentinel.com",  # default; override for self-hosted
    dry_run=False,                            # True = log events, suppress alert emails
)

Limitations

  • Streaming: stream=True calls pass through without monitoring (streaming responses can't be inspected before delivery).
  • Sync latency: SentinelClient (sync) makes a blocking HTTP call on flagged messages — up to 3s on connect timeout. Use AsyncSentinelClient in async frameworks to avoid this.
  • Rule engine scope: Only user-role messages are checked. System and assistant messages are developer-controlled and trusted.
  • Client compatibility: Works with any object implementing .chat.completions.create(). Tested with openai>=1.0.

Get Your API Key

Sign up at github.com/HexMystic/llm-sentinel → Dashboard → SDK Keys → Create Key.


Metadata

Release files for llm-sentinel-sdk 0.1.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 llm-sentinel-sdk 0.1.0
File Size Uploaded Provenance
llm_sentinel_sdk-0.1.0.tar.gz 7.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for llm-sentinel-sdk 0.1.0
File Interpreter ABI Platform
llm_sentinel_sdk-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 15.6 kB

Release files / llm_sentinel_sdk-0.1.0.tar.gz

Download URL llm_sentinel_sdk-0.1.0.tar.gz
Size 7.1 kB
Tags Source
SHA-256 checksum
How to use checksums
ecce7fce5be945df9af57d0754e4a7195d6d0f5c7a6658cab76aafc3958f7256
BLAKE2b-256 checksum
How to use checksums
20fdf30e8ee7824bcb15cd7d43dcebd533a4c702f2ae63bdf8bdcdd4c8354241
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.11

Release files / llm_sentinel_sdk-0.1.0-py3-none-any.whl

Download URL llm_sentinel_sdk-0.1.0-py3-none-any.whl
Size 8.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
19e1269bc593112488dedc2ac1bd48b24f4eddff1698617fa5afdc61bdb0acb0
BLAKE2b-256 checksum
How to use checksums
7b2e30cd3d9d2d254afa0833c4544870218855e23dfd5253e9d382ccdadae1dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.11

Security for llm-sentinel-sdk 0.1.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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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