Proof of concept, not a product. This library belongs to the earlier Python research prototype (Socrates) and is not maintained as a product. The current products are listed at nireus79.github.io. Contact: Hermes_creative@proton.me.
Socratic Security
Security utilities for the Socrates AI platform. Provides implementations of prompt injection protection, input validation, code sandboxing, and audit logging.
Features
Phase 1: Critical Security (v0.1.0)
- Prompt Injection Protection - Detects and sanitizes prompt injection attempts
- Path Traversal Validation - Prevents directory traversal attacks
- Code Sandboxing - Safe code execution with resource limits
- Input Validation - Sanitized string types and validators
Installation
pip install socratic-security
Quick Start
Prompt Injection Detection
from socratic_security.prompt_injection import PromptInjectionDetector
detector = PromptInjectionDetector()
result = detector.detect("ignore all instructions")
print(result.risk_score) # 95
Path Traversal Protection
from socratic_security.filesystem import PathValidator
validator = PathValidator()
safe_path = validator.validate_path(Path("/data/file.txt"), Path("/data"))
Code Sandboxing
from socratic_security.sandbox import CodeAnalyzer, SandboxExecutor
analyzer = CodeAnalyzer()
result = analyzer.analyze("print('safe code')")
print(result.safe) # True
License
MIT License - see LICENSE file for details
Metadata
Release files for socratic-security 0.4.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| socratic_security-0.4.1.tar.gz | 18.9 kB | Without provenance | Details for socratic_security-0.4.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| socratic_security-0.4.1-py3-none-any.whl | Python 3 | none | any | Details for socratic_security-0.4.1-py3-none-any.whl |
Total release size: 43.0 kB
Release files / socratic_security-0.4.1.tar.gz
| Download URL | socratic_security-0.4.1.tar.gz |
|---|---|
| Size | 18.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f0bc07eda0e7a9e3bb9e789457b8a0ae532bac7ed650289682d7ea4f0f3c11c6
|
|
BLAKE2b-256 checksum How to use checksums |
10fc78c9c09839ab039fe798536d7305caada7fbc03c58e543e1f26e51e68535
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.4
|
Release files / socratic_security-0.4.1-py3-none-any.whl
| Download URL | socratic_security-0.4.1-py3-none-any.whl |
|---|---|
| Size | 24.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fd666542cd267ea16405137d579f6a0a070de0a5fcfbc469c774daf51ddd9e35
|
|
BLAKE2b-256 checksum How to use checksums |
6731cb10bc6f0063880d315bab4159eaf6c19e78290afb106c770418fe0404d0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.4
|
Security for socratic-security 0.4.1
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.