You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+29-1Lines changed: 29 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,6 +48,7 @@ This tool provides a basic security layer only. Always implement additional secu
48
48
49
49
-**Prompt Injection Detection**: Detects potential prompt injections using pre-trained models like DeBERTa, DistilBERT, and ONNX versions.
50
50
-**Content Safety with Groq Models**: Supports Groq-hosted safeguard models, including `openai/gpt-oss-safeguard-20b`.
51
+
-**LangChain Guardrail Runnable**: Adds `PytectorGuard` for LCEL pipelines (`guard | prompt | llm`) so unsafe prompts can be blocked before model execution.
51
52
-**Keyword-Based Blocking**: Provides restrictive keyword filtering for both input and output layers with customizable keyword lists for immediate security control.
52
53
-**Customizable Detection**: Allows switching between local model inference and API-based detection (Groq) with customizable thresholds.
53
54
-**Flexible Model Options**: Use pre-defined models or provide a custom model URL.
@@ -112,6 +113,10 @@ pip install pytector
112
113
pip install pytector[gguf]
113
114
```
114
115
**Note:** Installing `llama-cpp-python` may require C++ build tools (like a C++ compiler and CMake) to be installed on your system, especially if pre-compiled versions (wheels) are not available for your OS/architecture. Please refer to the [`llama-cpp-python` documentation](https://github.com/abetlen/llama-cpp-python) for detailed installation instructions and prerequisites.
116
+
-**LangChain Integration:** To use the LCEL guardrail runnable, install the `langchain` extra:
117
+
```bash
118
+
pip install pytector[langchain]
119
+
```
115
120
116
121
Alternatively, you can install Pytector directly from the source code:
117
122
@@ -130,7 +135,7 @@ To use Pytector, import the `PromptInjectionDetector` class and create an instan
130
135
## Notebook Demo
131
136
132
137
An end-to-end Jupyter notebook is available at `notebooks/pytector_demo.ipynb`.
133
-
It covers local inference, keyword blocking, Groq integration with `openai/gpt-oss-safeguard-20b`, and both Prompt Guard 2 models (`meta-llama/llama-prompt-guard-2-22m` and `meta-llama/llama-prompt-guard-2-86m`).
138
+
It covers local inference, keyword blocking, Groq integration with `openai/gpt-oss-safeguard-20b`, both Prompt Guard 2 models (`meta-llama/llama-prompt-guard-2-22m` and `meta-llama/llama-prompt-guard-2-86m`), and LangChain LCEL guardrail usage.
134
139
135
140
### Groq Migration Note (March 5, 2026)
136
141
`meta-llama/llama-guard-4-12b` was deprecated in favor of `openai/gpt-oss-safeguard-20b`.
0 commit comments