QuillGuard
A multi-layered security system for LLM applications, built on top of NeMo Guardrails.
Features
- NeMo Guardrails integration for content filtering
- OpenAI content generation with security checks
- Comprehensive security logging
- Easy-to-use SDK interface
- Configurable security rules
Installation
pip install quillguard
Quick Start
import asyncio
from duoguard_nemo import DuoGuardNemoSDK
async def main():
# Initialize the SDK
sdk = DuoGuardNemoSDK(
config_path="config", # Path to NeMo Guardrails config
openai_api_key="your-api-key", # Or use OPENAI_API_KEY env var
log_path="logs/security.log"
)
# Process a message
result = await sdk.process_message(
messages=[{"role": "user", "content": "Write an article about healthy eating."}],
system_prompt="You are an AI Article writer..."
)
if result["success"]:
print("Generated content:", result["response"])
else:
print("Error:", result["error"])
if __name__ == "__main__":
asyncio.run(main())
Configuration
NeMo Guardrails Config
Place your NeMo Guardrails configuration in the config directory. The SDK will use this for content filtering.
Environment Variables
OPENAI_API_KEY: Your OpenAI API key (optional if provided during initialization)
Security Logging
Security decisions and events are logged to logs/security.log by default. Each log entry includes:
- Timestamp
- Event type
- Message content
- Decision details
- Error information (if any)
Development
- Clone the repository
- Install development dependencies:
pip install -e ".[dev]"
- Run tests:
pytest
License
MIT License
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Metadata
Release files for quillguard 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| quillguard-0.1.0.tar.gz | 11.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| quillguard-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 26.7 kB
Release files / quillguard-0.1.0.tar.gz
| Download URL | quillguard-0.1.0.tar.gz |
|---|---|
| Size | 11.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
68e51dba495526e8227738c974d5586ae4b224fb48bab4ee300a3478d760998e
|
|
BLAKE2b-256 checksum How to use checksums |
777d41b03a268ffa46a39e2f258de11dd89e8f0ed5d51e694512f65a386e9132
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.11
|
Release files / quillguard-0.1.0-py3-none-any.whl
| Download URL | quillguard-0.1.0-py3-none-any.whl |
|---|---|
| Size | 15.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9b279989bef21deda45c7a5b8b72fcf7179a9a179328e6755e52ec2ef2d2a0d3
|
|
BLAKE2b-256 checksum How to use checksums |
3fa287c9d7f0816f5adc1ae9095496011c4c697030a0ff7c5e11fb15b8a9aad0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.11
|