Skip to main content
Archived

This project has been archived by its maintainers, and is no longer receiving any updates.

Socratic Security

Enterprise-grade security utilities for the Socrates AI platform. Provides production-ready 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

Release files for socratic-security 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for socratic-security 0.4.0
File Size Uploaded
socratic_security-0.4.0.tar.gz 19.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for socratic-security 0.4.0
File Interpreter ABI Platform
socratic_security-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 43.6 kB

Release files / socratic_security-0.4.0.tar.gz

Download URL socratic_security-0.4.0.tar.gz
Size 19.3 kB
Tags Source
SHA-256 checksum
How to use checksums
e557b6cedd54e591e6da5628a7e755ba2071e4614c340e4f7b3b7ffbc2a584d8
BLAKE2b-256 checksum
How to use checksums
9e691e6d15dbc1030747ff87e6532c7d6654d1b27268e4190c0cc2652a054e9b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / socratic_security-0.4.0-py3-none-any.whl

Download URL socratic_security-0.4.0-py3-none-any.whl
Size 24.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
271fc6de1fe78fa278f3e0c2029471476207570902ccffa4e5f29082b9ba3466
BLAKE2b-256 checksum
How to use checksums
31f51f72955b421213e26fab8d1d22392510c4b295dfb14a169792fb9082334d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page