Skip to main content

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 (Claude Code & Cursor)

The package ships a sorin CLI that installs the Sorin MCP server into your AI coding tool:

# Claude Code — registers the server automatically
sorin mcp install --key <your-sorin-agent-key>

# Cursor — prints JSON to paste into ~/.cursor/mcp.json
sorin mcp install --key <your-sorin-agent-key> --cursor

Restart your editor after installing to connect to the server.

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sorin_sdk-0.1.3.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sorin_sdk-0.1.3-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file sorin_sdk-0.1.3.tar.gz.

File metadata

  • Download URL: sorin_sdk-0.1.3.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for sorin_sdk-0.1.3.tar.gz
Algorithm Hash digest
SHA256 7d30258d14b8a5973f52dcbcb0d84b193a30f08d5d5063b5ac5d04a8a4202207
MD5 e8047579b2de54ce2cf8570c6caf312e
BLAKE2b-256 800fcf348d31945f8ac6a9a15dc73bea8dc3c01cf2fb30aac006bc90b0887dff

See more details on using hashes here.

File details

Details for the file sorin_sdk-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: sorin_sdk-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for sorin_sdk-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d48ae4e7ebe03ea68ef835f0035b7ae8c8d4efedf682d460f5665e7f622a4307
MD5 178a4409ff5d4d71e645d07268dc2cd4
BLAKE2b-256 acc43b8d62de29cc4dfae4dc2f81ce394bfac26a5cce792cbf13a4ab2bfcd58c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page