Metadata-Version: 2.4
Name: qortara-protocol
Version: 0.1.2
Summary: Shared Pydantic models and JSON Schema for the Qortara Governance wire protocol.
Project-URL: Homepage, https://qortara.com/governance
Author-email: MythologIQ Labs <team@mythologiq.studio>
License: Apache-2.0
License-File: LICENSE
License-File: NOTICE
Keywords: agents,ai,governance,protocol,pydantic,qortara,schema
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
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 :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Requires-Dist: cryptography>=46.0.7
Requires-Dist: pydantic>=2.13.1
Provides-Extra: dev
Requires-Dist: pytest>=9.0.3; extra == 'dev'
Description-Content-Type: text/markdown

# qortara-protocol

Shared Pydantic models and JSON Schema for the Qortara Governance wire protocol.

This package defines the request/response contract between a Qortara Governance client SDK and its sidecar, plus the evidence and attestation structures emitted by the system. It is the single source of truth for downstream SDKs (`qortara-governance-langchain` and future framework adapters) and for any compatible sidecar implementation.

## What's in here

| Model | Role |
|---|---|
| `ActionRequest` | The action a client wishes to perform, serialized for policy evaluation |
| `ActionDecision` | The sidecar's response — allow / deny / require_approval / exempt |
| `EvidenceRecord` | The durable record of what happened, emitted after execution |
| `PortableTrustAttestation` | Ed25519-signed credential describing the subject's trust posture |
| `SidecarHealth` | Sidecar introspection, for liveness probes and diagnostics |
| `PolicyCacheState` | Pinned-policy-pack state, for audit and cache coherence |

JSON Schema files for each model are distributed in the `schema/` directory alongside the Python source. Use the schemas if you are implementing a non-Python client or need language-agnostic validation.

## Install

```bash
pip install qortara-protocol
```

Requires Python 3.10+, Pydantic 2.13+, cryptography 46+.

## Usage

```python
from qortara_protocol import ActionRequest, ActionDecision

req = ActionRequest(
    subject_id="agent-42",
    action_kind="tool.invoke",
    resource={"type": "Tool", "name": "send_email", "args": {...}},
)
# Serialize and send to the sidecar; deserialize the response:
decision = ActionDecision.model_validate_json(sidecar_response_body)
```

## Stability

Alpha. The protocol is versioned via schema filenames (`*-v0.1.json`). Breaking changes will bump the schema version and this package's minor version together.

## License

Apache-2.0. See [LICENSE](LICENSE).
