Metadata-Version: 2.3
Name: vijil-dome
Version: 1.0.14
Summary: 
Author: Pradeep Das
Author-email: pradeep@vijil.ai
Requires-Python: >=3.11,<3.13
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Provides-Extra: embeddings
Provides-Extra: google
Provides-Extra: langchain
Provides-Extra: opentelemetry
Requires-Dist: annoy (>=1.17.3,<2.0.0) ; extra == "embeddings"
Requires-Dist: detect-secrets (>=1.5.0,<2.0.0)
Requires-Dist: flashtext (>=2.7,<3.0)
Requires-Dist: google-api-python-client (>=2.176.0,<3.0.0) ; extra == "google"
Requires-Dist: grpcio (>=1.73.1,<2.0.0)
Requires-Dist: huggingface-hub (>=0.33.2,<0.34.0)
Requires-Dist: litellm (>=1.74.0.post1,<2.0.0)
Requires-Dist: nest-asyncio (>=1.6.0,<2.0.0)
Requires-Dist: numpy (>=2.3.1,<3.0.0)
Requires-Dist: openai (>=1.93.2,<2.0.0)
Requires-Dist: opentelemetry-api (>=1.34.1,<2.0.0) ; extra == "opentelemetry"
Requires-Dist: opentelemetry-exporter-gcp-monitoring (>=1.9.0a0,<2.0.0) ; extra == "opentelemetry"
Requires-Dist: opentelemetry-exporter-gcp-trace (>=1.9.0,<2.0.0) ; extra == "opentelemetry"
Requires-Dist: opentelemetry-exporter-otlp (>=1.34.1,<2.0.0) ; extra == "opentelemetry"
Requires-Dist: opentelemetry-exporter-otlp-proto-common (>=1.34.1,<2.0.0) ; extra == "opentelemetry"
Requires-Dist: opentelemetry-exporter-otlp-proto-grpc (>=1.34.1,<2.0.0) ; extra == "opentelemetry"
Requires-Dist: opentelemetry-exporter-otlp-proto-http (>=1.34.1,<2.0.0) ; extra == "opentelemetry"
Requires-Dist: opentelemetry-instrumentation (>=0.55b1,<0.56) ; extra == "opentelemetry"
Requires-Dist: opentelemetry-instrumentation-asyncio (>=0.55b1,<0.56) ; extra == "opentelemetry"
Requires-Dist: opentelemetry-instrumentation-logging (>=0.55b1,<0.56) ; extra == "opentelemetry"
Requires-Dist: opentelemetry-instrumentation-threading (>=0.55b1,<0.56) ; extra == "opentelemetry"
Requires-Dist: opentelemetry-propagator-gcp (>=1.9.0,<2.0.0) ; extra == "opentelemetry"
Requires-Dist: opentelemetry-proto (>=1.34.1,<2.0.0) ; extra == "opentelemetry"
Requires-Dist: opentelemetry-resourcedetector-gcp (>=1.9.0a0,<2.0.0) ; extra == "opentelemetry"
Requires-Dist: opentelemetry-sdk (>=1.34.1,<2.0.0) ; extra == "opentelemetry"
Requires-Dist: opentelemetry-semantic-conventions (>=0.55b1,<0.56) ; extra == "opentelemetry"
Requires-Dist: pandas (>=2.3.1,<3.0.0)
Requires-Dist: presidio_analyzer (>=2.2.358,<3.0.0)
Requires-Dist: presidio_anonymizer (>=2.2.358,<3.0.0)
Requires-Dist: pydantic (>=2.11.7,<3.0.0)
Requires-Dist: pytest (>=8.4.1,<9.0.0)
Requires-Dist: pytest-asyncio (>=1.0.0,<2.0.0)
Requires-Dist: python-dotenv (>=1.1.1,<2.0.0)
Requires-Dist: scipy (>=1.16.0,<2.0.0)
Requires-Dist: sentence-transformers (>=5.0.0,<6.0.0)
Requires-Dist: toml (>=0.10.2,<0.11.0)
Requires-Dist: torch (>=2.7.1,<3.0.0)
Requires-Dist: tqdm (>=4.67.1,<5.0.0)
Requires-Dist: transformers (>=4.53.1,<5.0.0)
Description-Content-Type: text/markdown

# Vijil Dome

[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
![Python Version](https://img.shields.io/pypi/pyversions/vijil-dome)
[![Downloads](https://static.pepy.tech/badge/vijil-dome)](https://pepy.tech/project/vijil-dome)
[![Docs](https://img.shields.io/badge/Docs-blue?link=https%3A%2F%2Fdocs.vijil.ai%2Fdome%2Fintro.html)](https://docs.vijil.ai/dome/intro.html)

**Vijil Dome** is a fast, lightweight, and highly configurable library for adding runtime guardrails to your AI agents. It combines top open-source LLM safety tools with proprietary Vijil models to detect and respond to unsafe content — with built-in support for observability, tracing, and popular agent frameworks.


## 🚀 Installation

Install the core library:

```bash
pip install vijil-dome
```

Optional extras for common integrations:

* `opentelemetry` – OTel-compatible tracing/logging
* `google` – GCP-native metrics and logging
* `langchain` – Seamless integration with LangChain/LangGraph
* `embeddings` – Fast similarity search using `annoy`

> ⚠️ Note: `annoy` is not currently compatible with agents built using Google ADK + Cloud Run. Use in-memory embeddings in those cases.


## 🔒 Guarding Agents in One Line

```python
from vijil_dome import Dome

dome = Dome()

query = "How can I rob a bank?"
input_scan = dome.guard_input(query)
print(input_scan.is_safe(), input_scan.guarded_response())

# Get a response from your agent 

response = "Here's how to rob a bank!"
output_scan = dome.guard_output(response)
print(output_scan.is_safe(), output_scan.guarded_response())
```

By default, Dome:

* Scans inputs for prompt injections, jailbreaks, and toxicity
* Scans outputs for toxicity and masks PII


## ⚙️ Configuration Options

You can configure Dome using a TOML file or a Python dictionary.

### Example TOML

```toml
[guardrail]
input-guards = ["prompt-injection", "input-toxicity"]
output-guards = ["output-toxicity"]
input-early-exit = false

[prompt-injection]
type = "security"
early-exit = false
methods = ["prompt-injection-deberta-v3-base", "security-llm"]

[prompt-injection.security-llm]
model_name = "gpt-4o"

[input-toxicity]
type = "moderation"
methods = ["moderations-oai-api"]

[output-toxicity]
type = "moderation"
methods = ["moderation-prompt-engineering"]
```

### Same Configuration in Python

```python
config = {
    "input-guards": ["prompt-injection", "input-toxicity"],
    "output-guards": ["output-toxicity"],
    "input-early-exit": False,
    "prompt-injection": {
        "type": "security",
        "early-exit": False,
        "methods": ["prompt-injection-deberta-v3-base", "security-llm"],
        "security-llm": {
            "model_name": "gpt-4o"
        }
    },
    "input-toxicity": {
        "type": "moderation",
        "methods": ["moderations-oai-api"]
    },
    "output-toxicity": {
        "type": "moderation",
        "methods": ["moderation-prompt-engineering"]
    },
}
```

Dome includes nearly 20 prebuilt guardrails and supports building your own!

👉 For the full list of guardrail methods, advanced config options, and extensibility, check out the [Docs](https://docs.vijil.ai/dome/intro.html).

## 🔌 Compatibility

Dome works with **any agent framework or LLM** — it operates directly on strings, so there's no dependency on your stack!

For popular frameworks, we provide dedicated wrappers and tutorials to make integration seamless:

* [**Google ADK**](https://docs.vijil.ai/dome/tutorials/adk.html)
* [**LangChain & LangGraph**](https://docs.vijil.ai/dome/tutorials/)

### Observability Integrations:

Dome is compatible with the following observability framworks out of the box

* **OpenTelemetry**
* **Weave** (Weights & Biases)
* **AgentOps**
* **Google Cloud Trace**

See the [documentation](https://docs.vijil.ai/dome/tutorials/observability.html) for more details


📚 Learn More
---
Get detailed guides, examples, and custom guardrail walkthroughs in the [official documentation →](https://docs.vijil.ai/dome/intro.html)

Have more questions, or want us to include another guardrailing technique? Reach out to us at contact@vijil.ai!

