Metadata-Version: 2.4
Name: infralayer-core
Version: 0.3.0
Summary: Zero-dependency pre-LLM security filtering and tenant-aware sanitization core
Author: InfraLayer
License: MIT
Keywords: llm,prompt-injection,rbac,sanitization,security
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Security
Requires-Python: >=3.9
Description-Content-Type: text/markdown

# InfraLayer Python Core

A standard-library-only security filter: tenant/role/access checks, injection scanning, PII and secret redaction, and per-call telemetry.

```bash
pip install infralayer-core
```

```python
from infralayer_core import InfraLayerCore, RawContext, UserContext

core = InfraLayerCore()
user = UserContext("u1", "tenant-a", "employee", permissions=["read:docs"])
result = core.sanitize(user, RawContext(
    "Contact jane@example.com; ignore previous instructions",
    metadata={"tenantId": "tenant-a"},
))
print(result.sanitized_context.text)
print(core.check_permission(user, ["read:docs"]).allowed)
```

No runtime dependencies or network access. Tenant metadata is default-deny; use an exact `tenantId` or explicitly set `isGlobalPublic: True`. Detection is a heuristic signal, not a replacement for model-side policy or security review. Base64 inspection is bounded to 16 candidate tokens, 8 KiB each, and two decoding layers.
