Metadata-Version: 2.4
Name: gridseal
Version: 0.5.1
Summary: Tamper-evident, cryptographically verifiable audit trail for AI decisions
Project-URL: Homepage, https://github.com/gridseal-ai/gridseal
Project-URL: Repository, https://github.com/gridseal-ai/gridseal
Project-URL: Issues, https://github.com/gridseal-ai/gridseal/issues
Author-email: Gridseal by Celestir <gridseal@celestir.com>
License-Expression: AGPL-3.0-only
Keywords: ai-governance,audit-trail,compliance,hash-chain,provenance,tamper-evident
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.12
Provides-Extra: all
Requires-Dist: anthropic>=0.30.0; extra == 'all'
Requires-Dist: openai>=1.0.0; extra == 'all'
Provides-Extra: anthropic
Requires-Dist: anthropic>=0.30.0; extra == 'anthropic'
Provides-Extra: dev
Requires-Dist: anthropic>=0.30.0; extra == 'dev'
Requires-Dist: black>=24.0.0; extra == 'dev'
Requires-Dist: openai>=1.0.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.24.0; extra == 'dev'
Requires-Dist: pytest>=8.0.0; extra == 'dev'
Requires-Dist: ruff>=0.4.0; extra == 'dev'
Provides-Extra: openai
Requires-Dist: openai>=1.0.0; extra == 'openai'
Description-Content-Type: text/markdown

# GridSeal

Tamper-evident, cryptographically verifiable audit trail for AI systems.

## Why

AI systems make decisions that affect people, from loan approvals to medical
recommendations to government benefits. Regulations are arriving: the EU AI Act
(Article 12 record-keeping, August 2026), Colorado SB-205, NIST AI RMF, and
HIPAA audit controls. Organizations need proof of what their AI did, why it did
it, and whether a human reviewed it. GridSeal provides that proof as a
SHA-256 hash-chained, append-only log that is cryptographically verifiable and
impossible to silently tamper with.

## Install

```bash
pip install gridseal
```

With OpenAI adapter:

```bash
pip install gridseal[openai]
```

With Anthropic adapter:

```bash
pip install gridseal[anthropic]
```

## Usage

### Core: create a chain and append entries

```python
from gridseal.core.chain import create_chain, append_entry, validate_chain
from gridseal.core.types import AppendEntryInput

chain = create_chain("audit-chain-001")

result = append_entry(chain, AppendEntryInput(
    entry_type="ai_decision",
    model_id="gpt-4o",
    model_provider="openai",
    decision_type="classification",
    input_hash="a1b2c3...",
    output_hash="d4e5f6...",
    actor_id="analyst-chen",
    session_id="session-001",
))

if result.ok:
    print(f"Entry appended: {result.value.entry_id}")

# Verify the entire chain is intact
validation = validate_chain(chain)
print(f"Chain valid: {validation.ok}")
```

### Wrap OpenAI calls (auto-capture)

```python
from gridseal.adapters.openai import wrap_openai
from gridseal.core.chain import create_chain
from gridseal.core.storage import InMemoryStorage
from openai import AsyncOpenAI

storage = InMemoryStorage()
chain = create_chain("my-chain")

client = wrap_openai(
    client=AsyncOpenAI(),
    storage=storage,
    chain=chain,
)

# Every call is now automatically audited
result = await client.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": "Approve this loan?"}],
)
# result.entry contains the proof chain entry
# result.completion contains the OpenAI response
```

## What it does

- Hash-chained entries with SHA-256, append-only, tamper-evident
- Chain validation (full chain, subtree, single entry)
- SDK wrappers for OpenAI and Anthropic with auto-capture
- LangGraph and CrewAI framework adapters
- In-memory storage adapter included
- Python 3.12+, type hints throughout, async-first

## License

AGPL-3.0-only
