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
import uuid

sorin = SorinClient(agent_key="your-agent-key")

# Typical agent loop pattern
request_id = str(uuid.uuid4())

plan = {
    "connector": "github",
    "action": "comment-pr",
    "resource_type": "pull_request",
    "resource_id": "org/repo#42",
}

# 1. Log the intent before acting
sorin.capture_intent(
    plan=plan,
    reasoning="Adding a review comment to summarize CI results",
    request_id=request_id,
)

# 2. Check authorization
auth = sorin.authorize(
    action=plan["action"],
    connector=plan["connector"],
    resource_id=plan["resource_id"],
    request_id=request_id,
)

if auth.get("allowed"):
    # 3. Perform the action
    ...
else:
    print(f"Blocked: {auth.get('reason')}")

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.0.tar.gz (5.0 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.0-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sorin_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 5.0 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.0.tar.gz
Algorithm Hash digest
SHA256 2efeae91f64d66f0152aab5239ab9e0262d8f9289fc4b2b06dd45105b614aa81
MD5 21267e2c6125d3bf38989a711fd091f2
BLAKE2b-256 dd28170071552e5a7773ebbfbfb708b592a6f3360fd4ec7600ef61adda1cc0a1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sorin_sdk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.2 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dda13fa1d7ddb9b8274569708247c01e0de752c1c2db09093080fae62a6a14bf
MD5 52dcb55e58faef3eefe3246eca075067
BLAKE2b-256 0f6516c25c86a3d42407cd8907c7449b485346b66e6039ffea62d057314fdc83

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