rotagent
A Python library for secure agent-orchestrator communication using JWT-based authentication with RSA keypairs.
Features
- 🔐 AgentAuth: Flask decorator for securing agent endpoints with JWT verification
- 📡 OrchestratorClient: Async client for sending signed requests to agents
- 🔑 KeyManager: RSA keypair generation and public key loading
- 🛠️ DevTools: Development utilities for key setup and token generation
Installation
pip install rotagent
Quick Start
Agent Side (Flask Application)
from flask import Flask, request, jsonify
from rotagent import AgentAuth
app = Flask(__name__)
auth = AgentAuth(keys_dir="./authorized_keys")
@app.route("/agent", methods=["POST"])
@auth.require_auth
def agent_endpoint():
data = request.get_json()
# Your agent logic here
return jsonify({"response": "Hello from agent!"})
Orchestrator Side
import aiohttp
from rotagent import OrchestratorClient
async def call_agent():
async with aiohttp.ClientSession() as session:
response = await OrchestratorClient.send_secure_request(
session=session,
url="http://agent-url.com",
payload={"query": "What movies are playing?"},
issuer_id="my_orchestrator",
private_key_pem=private_key_pem # Your RSA private key
)
return response
Development Setup
Generate development keys for testing:
from rotagent import DevTools
# Generate keys - saves public key to disk, prints private key for .env
DevTools.setup_persistent_keys(keys_dir="authorized_keys", issuer_id="dev_postman")
# Generate a test token for Postman/curl testing
token, body = DevTools.generate_bearer_token(query="test query")
Environment Variables
APP_ENV: Set todevelopmentto disable security checks (replay protection, body hash verification)
Security Features
- JWT-based authentication with RS256 signing
- Replay attack protection with JTI (JWT ID) tracking
- Body tampering detection via SHA256 content hashing
- Hot-reload of public keys (no restart needed when adding new orchestrators)
License
MIT License
Metadata
Release files for rotagent 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| rotagent-0.1.0.tar.gz | 7.3 kB | Without provenance | Details for rotagent-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| rotagent-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for rotagent-0.1.0-py3-none-any.whl |
Total release size: 15.7 kB
Release files / rotagent-0.1.0.tar.gz
| Download URL | rotagent-0.1.0.tar.gz |
|---|---|
| Size | 7.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
389bdcf68d967fe0409ca769b1c80bf0bf46946432c9d50b391d11c3c76c7cdf
|
|
BLAKE2b-256 checksum How to use checksums |
57c8203c83d28b9643e26b5d698fb276ade95b1f06ec61df5d9a37915e910820
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.11
|
Release files / rotagent-0.1.0-py3-none-any.whl
| Download URL | rotagent-0.1.0-py3-none-any.whl |
|---|---|
| Size | 8.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1c06177f434eea034188c5acfe46659582fda3941b923524d1d856a8e44d8e2c
|
|
BLAKE2b-256 checksum How to use checksums |
87060bb9804b4d9420c3aedea3f6af2ebc58737d85415fb42e44a05c550029bb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.11
|
Security for rotagent 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.