Metadata-Version: 2.4
Name: reva-ai-authz
Version: 1.0.0
Summary: Reva AI agent authorization, proxy, and observability SDK (FastAPI, LangChain, LangGraph, CrewAI, AutoGen, MCP)
Author-email: "Reva AI, Inc." <engineering@reva.ai>
Maintainer-email: "Reva AI, Inc." <engineering@reva.ai>
License: Reva AI SDK — Proprietary Software License
        Copyright (c) 2026 Reva AI, Inc. All rights reserved.
        
        IMPORTANT — READ CAREFULLY. This is a license agreement, not a sale. The
        "reva-ai" software, including all source code, object code, documentation,
        and related materials (collectively, the "Software"), is the proprietary and
        confidential property of Reva AI, Inc. ("Reva") and is protected by copyright
        and other intellectual-property laws and treaties.
        
        1. Grant of License.
           Subject to the terms of a valid written commercial agreement and/or active
           subscription with Reva (a "Commercial Agreement"), Reva grants you a
           limited, non-exclusive, non-transferable, non-sublicensable license to
           install and use the Software solely to integrate your applications with the
           Reva platform, and only for the term and scope set out in that Commercial
           Agreement. Absent a Commercial Agreement, no rights are granted other than
           the right to evaluate the Software for internal assessment purposes.
        
        2. Restrictions.
           You may not, except to the extent expressly permitted by a Commercial
           Agreement or by applicable law that cannot be contractually waived:
           (a) copy, modify, or create derivative works of the Software;
           (b) distribute, sell, lease, rent, lend, or otherwise make the Software
               available to any third party;
           (c) reverse engineer, decompile, or disassemble the Software, or attempt to
               derive its source code where provided only in non-source form;
           (d) remove, alter, or obscure any proprietary notices; or
           (e) use the Software to build a competing product or service.
        
        3. Ownership.
           The Software is licensed, not sold. Reva and its licensors retain all right,
           title, and interest in and to the Software, including all intellectual
           property rights therein. All rights not expressly granted are reserved.
        
        4. Confidentiality.
           The Software embodies valuable trade secrets of Reva. You agree to protect
           it with at least the same degree of care you use for your own confidential
           information, and no less than a reasonable degree of care.
        
        5. No Warranty.
           THE SOFTWARE IS PROVIDED "AS IS" AND "AS AVAILABLE", WITHOUT WARRANTY OF ANY
           KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
           MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
        
        6. Limitation of Liability.
           TO THE MAXIMUM EXTENT PERMITTED BY LAW, IN NO EVENT WILL REVA BE LIABLE FOR
           ANY INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL, OR PUNITIVE DAMAGES, OR FOR
           ANY LOSS OF PROFITS, REVENUE, DATA, OR USE, ARISING OUT OF OR RELATED TO THE
           SOFTWARE, WHETHER IN CONTRACT, TORT, OR OTHERWISE, EVEN IF ADVISED OF THE
           POSSIBILITY OF SUCH DAMAGES.
        
        7. Termination.
           This license terminates automatically if you breach it or upon expiry or
           termination of the applicable Commercial Agreement. Upon termination you
           must cease all use of the Software and destroy all copies in your control.
        
        For licensing inquiries, contact: legal@reva.ai
        
Project-URL: Homepage, https://reva.ai
Project-URL: Documentation, https://reva.ai/docs
Project-URL: Source Code, https://gitlab.com/reva-ai
Keywords: authorization,policy,pdp,cedar,ai-security,agents,nhi,guardrails,rtg,mcp,langchain,langgraph
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: Other/Proprietary License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
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 :: Software Development :: Libraries :: Python Modules
Classifier: Framework :: FastAPI
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: fastapi>=0.109
Requires-Dist: httpx>=0.25
Requires-Dist: pydantic>=2.5
Dynamic: license-file

# Reva AI SDK

Installable Python SDK for Reva AI authorization, discovery, and proxy helpers.
It lets your agents (FastAPI, LangChain, LangGraph, CrewAI, AutoGen) and MCP
servers enforce decisions from the Reva Trust Gateway (RTG / PDP) on every hop.

## Installation

```bash
pip install reva-ai-authz
```



Requires Python 3.10+.

## Quick start

```python
from reva_ai.sdk.ai import reva_ai_authorise
```

## RTG Authentication

Set `RTG_AUTH_TOKEN` when the Reva platform requires a per-tenant API key in
addition to `RTG_URL`.

```bash
export RTG_URL="https://rtg.example.com"
export RTG_AUTH_TOKEN="..."
```

When `RTG_AUTH_TOKEN` is set, SDK calls to RTG PDP evaluation, token
enrichment, final-turn recording, and discovery logging include the API key on
a dedicated header:

```http
X-API-Token: <RTG_AUTH_TOKEN>
Authorization: Bearer <end-user JWT>      # unchanged
```

The `Authorization` header is left untouched so it continues to carry the
end-user token that PDP needs for policy evaluation. The gateway prefers
`X-API-Token` for perimeter authentication and falls back to `Authorization`
only when `X-API-Token` is absent. If `RTG_AUTH_TOKEN` is unset, the SDK adds
no `X-API-Token` header.

## License

Proprietary — © Reva AI, Inc. All rights reserved. Use of this SDK requires a
valid commercial agreement with Reva. See the [LICENSE](LICENSE) file for terms.
For licensing inquiries, contact legal@reva.ai.
