Skip to main content

Quantitative AI governance — works immediately, no signup required. 10 free evaluations/day.

Project description

AEGIS Python SDK

Quantitative AI governance — works immediately, no signup required.

AEGIS evaluates engineering proposals through 6 mathematical gates — risk, profit, novelty, complexity, quality, and utility — using Bayesian posterior analysis and KL divergence drift detection.

Quick Start (no signup needed)

pip install aegis-governance
from aegis import Aegis

client = Aegis()  # Works immediately — 10 free evaluations/day

decision = client.evaluate(
    proposal_summary="Add Redis caching layer to reduce API latency",
    risk_baseline=0.02,
    risk_proposed=0.05,
    novelty_score=0.75,
    complexity_score=0.8,
    quality_score=0.9,
)

print(decision.status)      # "proceed"
print(decision.remaining)   # 9 sandbox evaluations left today

No API key, no signup, no configuration. The gate engine runs server-side — your code hits the same evaluation engine used in production.

For Production Use

Get a free API key at portal.undercurrentholdings.com for 100 evaluations/month:

client = Aegis(api_key="uk_live_xxx")  # or set AEGIS_API_KEY env var

Features

Feature Description
Sandbox mode 10 free evaluations/day, no signup required
6 Bayesian gates Risk, profit, novelty, complexity, quality, utility
KL divergence drift Detects when your risk baseline shifts
Shadow mode Evaluate without enforcing (calibration)
Typed responses Full dataclass types with IDE autocomplete
Async support AsyncAegis with identical API surface
Retry + backoff Automatic retry on transient failures (429, 5xx)
Idempotency Safe retries — SDK auto-sends Idempotency-Key on every /evaluate; server honors it with a 24h dedup window (AEGIS v4.6.137+, IETF draft-07). Pass idempotency_key="..." for cross-process dedup. decision_id stable across replays; request_id fresh per HTTP call — use decision_id for log correlation.
TLS enforced HTTPS always on, no opt-out

Quick Risk Check

result = client.risk_check(
    risk_score=0.15,
    threshold=0.3,
    action_description="Deploy to production",
)
print(result.safe)  # True

Async Usage

from aegis import AsyncAegis

async with AsyncAegis() as client:  # sandbox mode works here too
    decision = await client.evaluate(
        proposal_summary="Migrate database to Postgres 17",
        estimated_impact="high",
    )

Gate Results

Access individual gate evaluations:

decision = client.evaluate(proposal_summary="...")

if decision.gates:
    print(decision.gates.risk)        # GateResult(passed=True, value=0.05, ...)
    print(decision.gates.novelty)     # GateResult(passed=True, value=0.75, ...)
    print(decision.gates.complexity)  # GateResult(passed=True, value=0.80, ...)

Error Handling

import aegis

try:
    decision = client.evaluate(proposal_summary="...")
except aegis.SandboxLimitError as e:
    print(f"Sandbox limit reached. Sign up at {e.upgrade_url}")
except aegis.AuthenticationError:
    print("Invalid API key")
except aegis.RateLimitError as e:
    print(f"Rate limited. Retry after {e.retry_after}s")
except aegis.ValidationError as e:
    print(f"Bad request: {e.message}")
except aegis.AegisError as e:
    print(f"API error: {e.message} (request_id={e.request_id})")

Configuration

client = Aegis(
    api_key="uk_live_xxx",       # omit for sandbox mode
    base_url="https://...",      # or AEGIS_BASE_URL env var
    timeout=60.0,                # seconds (default: 30)
    max_retries=3,               # retry attempts (default: 2)
)

Customer Management

client = Aegis(api_key="uk_live_xxx")

profile = client.get_profile()
print(profile.tier)              # "professional"

usage = client.get_usage()
print(usage.total_evaluations)   # 847

keys = client.list_keys()
new_key = client.create_key("CI Pipeline")

Pricing

Tier Monthly Evaluations Rate Limit
Sandbox Free 10/day No signup
Community Free 100/month 60/min
Professional $3,500 10,000/month 100/min
Enterprise $18,000 100,000/month 1,000/min

Full pricing details

Links

License

Apache 2.0 - see LICENSE for details.

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

aegis_governance-0.4.1.tar.gz (26.4 kB view details)

Uploaded Source

Built Distribution

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

aegis_governance-0.4.1-py3-none-any.whl (23.6 kB view details)

Uploaded Python 3

File details

Details for the file aegis_governance-0.4.1.tar.gz.

File metadata

  • Download URL: aegis_governance-0.4.1.tar.gz
  • Upload date:
  • Size: 26.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for aegis_governance-0.4.1.tar.gz
Algorithm Hash digest
SHA256 5437bf9d027181771df2b48765173c4e81d2160ab56d50e48ee47af54f8af444
MD5 4e651c51339de090ceb49448b32bec13
BLAKE2b-256 741286f5801da0f1799a4ffe4d3e0a7da494b1847a7eecbf18aed266cd6f40c9

See more details on using hashes here.

Provenance

The following attestation bundles were made for aegis_governance-0.4.1.tar.gz:

Publisher: sdk-publish.yml on undercurrentai/aegis-governance

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aegis_governance-0.4.1-py3-none-any.whl.

File metadata

File hashes

Hashes for aegis_governance-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 509829fbe34b71a1e01587e15a324670d479ff088a6f8073144c533bd6a04d59
MD5 86feab4377d5c3e8ef8fc2bddf2b290c
BLAKE2b-256 2185c7cc1717bd522e2d800dc5415dbfb2b79d9269c9eee8f4bbe28a8a275e88

See more details on using hashes here.

Provenance

The following attestation bundles were made for aegis_governance-0.4.1-py3-none-any.whl:

Publisher: sdk-publish.yml on undercurrentai/aegis-governance

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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