Metadata-Version: 2.4
Name: sentinelproxy
Version: 0.1.0
Summary: SentinelProxy integrations for LangChain and LiteLLM — mirror agent turns for self-healing evaluation.
Project-URL: Homepage, https://sentinelproxy.tomphillips.uk
Project-URL: Source, https://github.com/NeuralOversight/TomPhillips/tree/main/packages/sentinelproxy-python
Author-email: Tom Phillips <tom@tomphillips.uk>
License: MIT
Keywords: ai-safety,langchain,litellm,llm,observability,sentinelproxy
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.9
Requires-Dist: requests>=2.25
Provides-Extra: langchain
Requires-Dist: langchain-core>=0.1; extra == 'langchain'
Description-Content-Type: text/markdown

# sentinelproxy (Python)

Mirror your LangChain or LiteLLM agent turns to
[SentinelProxy](https://sentinelproxy.tomphillips.uk) — the self-healing layer
for AI agents. The judge catches hallucinations, prompt injections, PII leaks
and competitor mentions, then hands you a hardened system prompt.

## Install

```bash
pip install sentinelproxy            # core + LiteLLM
pip install "sentinelproxy[langchain]"   # + LangChain callback handler
```

Get a per-project API key from your dashboard → project → **Connect** tab.

## LangChain

```python
from sentinelproxy import SentinelProxyCallbackHandler

handler = SentinelProxyCallbackHandler(
    api_key="sk_sentinel_…",
    system_prompt="You are a support agent for Acme.",
)
llm.invoke(messages, config={"callbacks": [handler]})
```

## LiteLLM

```python
import litellm
from sentinelproxy import sentinel_litellm_callback

litellm.success_callback = [sentinel_litellm_callback("sk_sentinel_…")]
```

## Low-level client

```python
from sentinelproxy import SentinelClient

SentinelClient("sk_sentinel_…").log(
    system_prompt="You are a support agent for Acme.",
    user_input="Where's my order?",
    llm_response="Let me check…",
    latency_ms=820,
)
```

Logging is best-effort and off your critical path — failures are swallowed so
observability never breaks the agent (pass `raise_on_error=True` to
`SentinelClient` to surface them). PII is scrubbed at the SentinelProxy edge
before anything is stored.

## Build & publish

```bash
python -m build
python -m twine upload dist/*
```

## License

MIT
