Skip to main content

Python client and CLI for SAS - Symbiotic Autoprotection System.

Project description

sas-client

Python client and CLI for SAS - Symbiotic Autoprotection System.

SAS is a structural coherence audit API for generative AI outputs. It exposes operational endpoints for hallucination / semantic rupture detection using the κD = 0.56 threshold.


Install

pip install sas-client

For local development from source:

pip install -e .[dev]

Quick Start

from sas_client import SASClient

client = SASClient(api_key="sas_test_key_2026")

result = client.diff(
    text_a="Python is a programming language used for data analysis.",
    text_b="A python is a large tropical snake."
)

print(result["isi"])
print(result["verdict"])
print(result.get("evidence", {}).get("fired_modules"))

API Key

The hosted SAS API expects an API key for protected endpoints.

client = SASClient(api_key="sas_test_key_2026")

Or use an environment variable:

export SAS_API_KEY="sas_test_key_2026"

Windows PowerShell:

$env:SAS_API_KEY="sas_test_key_2026"

Usage

Health

from sas_client import SASClient

client = SASClient()
print(client.health())

Audit one text

from sas_client import SASClient

client = SASClient(api_key="sas_test_key_2026")

result = client.audit(
    "Paris is the capital of France. The Eiffel Tower is located in Berlin."
)

print(result)

Compare two texts

from sas_client import SASClient

client = SASClient(api_key="sas_test_key_2026")

result = client.diff(
    text_a="Python is a programming language commonly used for automation.",
    text_b="A python is a large tropical snake."
)

print(result["isi"])
print(result["verdict"])

Public stats

from sas_client import SASClient

client = SASClient()
print(client.public_stats())
print(client.public_activity(limit=10))

CLI

After installation, the sas command is available.

sas health
sas public-stats
sas public-activity --limit 10
sas audit "Paris is the capital of France. The Eiffel Tower is located in Berlin." --api-key sas_test_key_2026
sas diff "Python is a programming language." "A python is a snake." --api-key sas_test_key_2026

Override the API URL:

sas --base-url https://your-sas-instance.example.com health

Privacy

This client does not collect telemetry.

Requests are sent only to the configured SAS API base URL.


License

GPL-3.0 + Durante Invariance License.

The SAS framework and κD = 0.56 require attribution to Gonzalo Emir Durante and citation of the public SAS repository / DOI when used for semantic invariance, hallucination detection, or similar structural coherence auditing purposes.

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

sas_client-0.1.0.tar.gz (19.6 kB view details)

Uploaded Source

Built Distribution

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

sas_client-0.1.0-py3-none-any.whl (20.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sas_client-0.1.0.tar.gz
  • Upload date:
  • Size: 19.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for sas_client-0.1.0.tar.gz
Algorithm Hash digest
SHA256 20215ab0992175dc5d858af13585d8169fbfff2db9c8e4a27b98ec6698bc1997
MD5 bddbf0976ebb5e19cd77e9e1bae39d7d
BLAKE2b-256 2dc8a4dcf91e0d1200e7cd579cb8623aa1c9ac6e243f121aa9eb3b32fa4b8746

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sas_client-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 20.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for sas_client-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d2718bdd9aba4a93cec2071f34cf1fde6eedbac98838f5e339014bf21110a6b4
MD5 77a0b82fa2dcf7443162a16409d802f6
BLAKE2b-256 6cbd21f7681f726fb4e4a746c98159c7b0d2d9fbcbbc8a966947a96f5b065fdb

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