Catalog PyPI
PACKAGE EXPLORERView in registry

aiassess

PyPI

Python SDK for AI Assess Tech - Ethical AI Assessment Platform

4d-frameworkaiai-safetyassessmentcertificationcomplianceethical-aiethicsllmresponsible-aisafetytesting
Versions collected1
Direct dependencies13From release 0.7.0
Last observed21 Oct, 09:56 UTC

README

Version 0.7.0 documentation

AI Assess Tech Python SDK

PyPI version Python 3.8+ License: MIT

The official Python SDK for AI Assess Tech - Assess AI systems for ethical alignment across 4 dimensions: Lying, Cheating, Stealing, and Harm.

Features

  • ✅ Dual Client Support - Sync (AIAssessClient) and async (AsyncAIAssessClient)
  • ✅ Type-Safe - Full Pydantic v2 models with validation
  • ✅ Progress Tracking - Real-time progress callbacks
  • ✅ Dry Run Mode - Test integration without full assessment
  • ✅ Startup Blocking - block_until_pass() for CI/CD gates
  • ✅ Cryptographic Verification - Verify assessment integrity
  • ✅ CLI Included - Command-line interface for quick testing

Installation

pip install aiassess

Quick Start

Basic Assessment

from aiassess import AIAssessClient

# Define your AI callback
def my_ai(question: str) -> str:
    # Replace with your actual AI implementation
    response = openai.chat.completions.create(
        model="gpt-4",
        messages=[{"role": "user", "content": question}]
    )
    return response.choices[0].message.content or ""

# Run assessment
with AIAssessClient(health_check_key="hck_your_key_here") as client:
    result = client.assess(callback=my_ai)

print(f"Classification: {result.classification}")
print(f"Passed: {result.overall_passed}")
print(f"Verify at: {result.verify_url}")

Async Assessment

import asyncio
from aiassess import AsyncAIAssessClient

async def my_async_ai(question: str) -> str:
    response = await openai.chat.completions.acreate(
        model="gpt-4",
        messages=[{"role": "user", "content": question}]
    )
    return response.choices[0].message.content or ""

async def main():
    async with AsyncAIAssessClient(health_check_key="hck_your_key") as client:
        result = await client.assess(callback=my_async_ai)
    print(f"Passed: {result.overall_passed}")

asyncio.run(main())

Progress Tracking

from aiassess import AIAssessClient, AssessProgress

def on_progress(p: AssessProgress):
    print(f"[{p.percentage:3d}%] Testing {p.dimension}... ({p.current}/{p.total})")

with AIAssessClient(health_check_key="hck_your_key") as client:
    result = client.assess(
        callback=my_ai,
        on_progress=on_progress,
    )

Startup Health Check (CI/CD)

from aiassess import AIAssessClient

with AIAssessClient(health_check_key="hck_your_key") as client:
    result = client.block_until_pass(
        callback=my_ai,
        max_retries=3,
        retry_delay_seconds=60,
        exit_on_failure=True,  # Exits process if AI fails
    )

Dry Run Mode

Test your integration without running a full assessment:

with AIAssessClient(health_check_key="hck_your_key") as client:
    result = client.assess(
        callback=my_ai,
        dry_run=True,  # Only 5 questions, returns mock scores
    )

CLI Usage

# Run assessment (dry run)
aiassess assess --key hck_your_key --dry-run

# Show configuration
aiassess config --key hck_your_key

# Verify a result
aiassess verify run_abc123 --key hck_your_key

Assessment Result

The AssessmentResult object includes:

FieldTypeDescription
run_idstrUnique assessment ID
overall_passedboolTrue if all dimensions pass
scoresDimensionScoresScores per dimension (0-10)
passedDimensionPassedPass/fail per dimension
classificationstrPersonality classification
verify_urlstrPublic verification URL
result_hashstrSHA-256 for cryptographic verification
variancefloatScore variance (< 5 = stable)
is_stableboolTrue if variance < 5

Dimension Scores

result.scores.lying    # 0-10 (higher = more ethical)
result.scores.cheating # 0-10
result.scores.stealing # 0-10
result.scores.harm     # 0-10
result.scores.overall  # Average of all dimensions

Classifications

ClassificationDescription
Well AdjustedEthical AI - passes all thresholds
MisguidedMinor ethical concerns
ManipulativeSignificant ethical issues
PsychopathFails ethical assessment

Error Handling

from aiassess import (
    AIAssessClient,
    AIAssessError,
    AuthenticationError,
    RateLimitError,
    ValidationError,
    AssessmentError,
)

try:
    with AIAssessClient(health_check_key="hck_your_key") as client:
        result = client.assess(callback=my_ai)
except AuthenticationError:
    print("Invalid API key")
except RateLimitError as e:
    print(f"Rate limited, retry after {e.retry_after}s")
except ValidationError as e:
    print(f"Invalid input: {e.message}")
except AssessmentError as e:
    print(f"Assessment failed: {e.message}")
except AIAssessError as e:
    print(f"SDK error: {e.code} - {e.message}")

Configuration

Client Options

client = AIAssessClient(
    health_check_key="hck_...",
    base_url="https://www.aiassesstech.com",  # API base URL
    timeout=30.0,              # Per-request timeout (seconds)
    overall_timeout=360.0,     # Total assessment timeout (seconds)
    max_retries=3,             # Retry attempts for transient errors
)

Environment Variables

VariableDescription
AIASSESS_KEYHealth Check Key (used by CLI)

TypeScript SDK

Looking for the TypeScript SDK? See packages/sdk-ts.

Support

License

MIT License - see LICENSE for details.


Built with ❤️ by AI Assess Tech

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.7.07 Jan 202613

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
aiassesstech/aiassess-python

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 21 Oct, 09:56 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:08f553b8b939ad27d8a2d40e439be075440105abe96ef68d1a5a09ad9b13bf53