Python SDK for Sorin — AI agent governance and security
Project description
sorin-sdk
Python SDK for the Sorin agent authorization and observability platform.
Install
pip install sorin-sdk
For local development:
pip install -e ./python
Usage
LLM Inference (Anthropic)
from sorin import SorinLLM
client = SorinLLM(agent_key="your-agent-key")
response = client.messages.create(
model="claude-sonnet-4-20250514",
max_tokens=100,
messages=[{"role": "user", "content": "Hello"}]
)
LLM Inference (OpenAI)
from sorin import SorinOpenAI
client = SorinOpenAI(agent_key="your-agent-key")
response = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": "Hello"}]
)
Agent Actions (GitHub, etc.)
from sorin import SorinClient
sorin = SorinClient(agent_key="your-agent-key")
# Check authorization before acting (reasoning is optional)
auth = sorin.authorize(
action="comment-pr",
connector="github",
resource_id="org/repo#42",
reasoning="Adding a review comment to summarize CI results",
)
if auth.get("allowed"):
# Perform the action
...
else:
print(f"Blocked: {auth.get('reason')}")
MCP Server
The package ships a sorin CLI that connects any MCP-compatible AI coding tool to the Sorin MCP server.
Claude Code — registers the server automatically:
sorin mcp install --key <your-sorin-agent-key>
Cursor, Windsurf, VS Code, or any host that uses mcpServers JSON config — prints the config block to paste in:
sorin mcp install --key <your-sorin-agent-key> --json
Config file locations:
- Cursor:
~/.cursor/mcp.json - Windsurf:
~/.codeium/windsurf/mcp_config.json - VS Code:
.vscode/mcp.json(workspace) or user settings
Restart your editor after installing to connect.
Links
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sorin_sdk-0.1.7.tar.gz.
File metadata
- Download URL: sorin_sdk-0.1.7.tar.gz
- Upload date:
- Size: 11.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4622e2c92b660bb6addb471063719d21d617cc35d13c7739ae13fcb0ab316cff
|
|
| MD5 |
e72721d89621264793a76e313a4c5ee6
|
|
| BLAKE2b-256 |
95bfd8b998a40785890064bd340406d0769668ee325d882f429e50e77179b2fb
|
File details
Details for the file sorin_sdk-0.1.7-py3-none-any.whl.
File metadata
- Download URL: sorin_sdk-0.1.7-py3-none-any.whl
- Upload date:
- Size: 8.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
60e8f92cb4b47b019836e88ab7aeea6922a0e06ebca4aa13da126c4b0a138db5
|
|
| MD5 |
d50669fc5962ae04c38565ff9e37897c
|
|
| BLAKE2b-256 |
259e04d1a4c0eccff2145354bcaaeca9618492433375c6861f3043a7a58ec2a1
|