Skip to main content

Comprehensive security utilities for the Socrates ecosystem

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

socratic_security-0.4.0.tar.gz (19.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

socratic_security-0.4.0-py3-none-any.whl (24.3 kB view details)

Uploaded Python 3

File details

Details for the file socratic_security-0.4.0.tar.gz.

File metadata

  • Download URL: socratic_security-0.4.0.tar.gz
  • Upload date:
  • Size: 19.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for socratic_security-0.4.0.tar.gz
Algorithm Hash digest
SHA256 e557b6cedd54e591e6da5628a7e755ba2071e4614c340e4f7b3b7ffbc2a584d8
MD5 9a29a68824ab8018ed6565971c04c775
BLAKE2b-256 9e691e6d15dbc1030747ff87e6532c7d6654d1b27268e4190c0cc2652a054e9b

See more details on using hashes here.

File details

Details for the file socratic_security-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for socratic_security-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 271fc6de1fe78fa278f3e0c2029471476207570902ccffa4e5f29082b9ba3466
MD5 ee62d06a876c30b911602535df523a9c
BLAKE2b-256 31f51f72955b421213e26fab8d1d22392510c4b295dfb14a169792fb9082334d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page