Metadata-Version: 2.3
Name: eigenscope-sdk
Version: 0.2.16
Summary: EigenScope Open-Core Python SDK (decompose/rehydrate), RAG/tool quarantine adapters, multimodal helpers, and TransformerLens/pyvene subspace hooks
Requires-Python: >=3.9
License: Apache-2.0
Author: Aikhomu L F Okoedion, Guardian AI Inc.
Project-URL: Documentation, https://eigenscope.guardianai.network/integrations
Project-URL: Homepage, https://eigenscope.guardianai.network
Project-URL: Repository, https://github.com/LuckyOkoedion/eigenscope-integration-lab
Project-URL: Security, https://eigenscope.guardianai.network/security
Keywords: eigenscope, ai-security, privacy, prompt-injection, rag-security, mechanistic-interpretability
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software 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
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Provides-Extra: model
Requires-Dist: torch>=2.6,<3; extra == "model"
Requires-Dist: transformers>=4.51,<6; extra == "model"
Description-Content-Type: text/markdown

# eigenscope-sdk

Official Python SDK, CLI, RAG gate adapters, multimodal client, and loaded-model subspace hooks for **EigenScope**.

EigenScope enforces an explicit security boundary owned by your application:

```text
raw input -> eigenscope.decompose(...) -> your model/provider call -> eigenscope.rehydrate(...)
```

Your application keeps full ownership of model credentials, provider selection, and execution—never wrapping or routing model-provider SDKs through third-party proxies.

## Installation

```bash
pip install eigenscope-sdk==0.2.16
```

With optional PyTorch / Hugging Face model-hook runtime dependencies (`connect_model`):

```bash
pip install "eigenscope-sdk[model]==0.2.16"
```

## Quick Start (Text & Tool Output Protection)

```python
import os
from eigenscope_sdk import EigenScopeClient, DOMAIN_SEPARATION_POLICIES

client = EigenScopeClient(
    base_url="https://eigenscope.guardianai.network",  # or loopback http://127.0.0.1:8443 sidecar
    bearer_token=os.environ["EIGENSCOPE_API_KEY"],
)

decomposed = client.decompose(
    "Analyze Q4 acquisition terms for Redwood Biologics ($4,850,000 escrow).",
    policy=DOMAIN_SEPARATION_POLICIES["LEGAL_CONTRACT_MA_ANALYTICS"],
)

try:
    # Pass decomposed["task_core"] to your own model or provider call
    model_reply = your_model_call(decomposed["task_core"])
    restored = client.rehydrate(
        vault_ticket=decomposed["vault_ticket"],
        llm_task_output=model_reply,
    )
    print(restored["rehydrated_text"])
finally:
    client.scrub(decomposed["vault_ticket"])
```

## Included Modules & Adapters

- **`EigenScopeClient`**: Fail-closed client for `/v1/decompose`, `/v1/rehydrate`, `/v1/vault/scrub`, `/v1/latent/project`, RAG endpoints (`/v1/rag/ingest`, `/v1/rag/retrieve`, `/v1/rag/evaluate`), and multimodal endpoints (`/v1/decompose/audio`, `/v1/decompose/image`, `/v1/decompose/video`, `/v1/rehydrate/media`).
- **Domain Policies (`DOMAIN_SEPARATION_POLICIES`)**: Pre-configured policies including `CODING_AGENT_FIREWALL`, `UNTRUSTED_TOOL_IPI_FIREWALL`, `HEALTHCARE_CLINICAL_PHI`, `LEGAL_CONTRACT_MA_ANALYTICS`, `TELECOM_6G_SEMANTIC_RAN`, `ROBOTICS_EMBODIED_VLA`, and `OIL_GAS_PRODUCTION_OPS`.
- **RAG & Tool Quarantine (`eigenscope_sdk.adapters`)**: `EigenScopeCandidateGate`, `EigenScopeLangChainRetriever`, `EigenScopeLlamaIndexPostprocessor`, `EigenScopeHaystackGate`, `ToolOutputQuarantine`, and `sanitize_tool_result`.
- **Loaded-Model Hooks (`connect_model`)**: Direct residual-stream projection and suppression hooks (`OrthoCoreResidualHook`, `create_residual_clamping_hook`) for self-hosted Hugging Face, TransformerLens, and pyvene deployments.
- **CLI (`eigenscope`)**: `eigenscope init`, `eigenscope doctor`, `eigenscope ci-verify`, and `eigenscope model-check` (also runnable via `python -m eigenscope_sdk`).

## Documentation & Security

- Documentation & Integration Guides: https://eigenscope.guardianai.network/integrations
- OpenAPI Schema & Registry: https://eigenscope.guardianai.network/registry
- Artifact Verification: https://eigenscope.guardianai.network/security

## License

Apache-2.0 — Copyright (c) Guardian AI Inc.
