Skip to main content

AEVRIS Python SDK

Official Python client for AEVRIS — deterministic AI security middleware that intercepts prompts before they reach AI models and verifies outputs before delivery.

Install

pip install aevris

Quickstart

from aevris import Aevris

client = Aevris(api_key="sk-aevris-your-key-here")

result = client.scan_input("some user-provided prompt")

if result.is_blocked:
    print(f"Blocked: {result.summary}")
    for agent in result.triggered_agents:
        print(f"  {agent.name}: {agent.severity}{agent.finding}")
else:
    # safe to send to your LLM
    pass

Scanning AI outputs before they reach your user

response = your_llm_call(prompt)  # however you call your model

result = client.scan_output(prompt, response)

if not result.alignment_intact:
    print(f"Compromised response: {result.summary}")
    # don't deliver this response to the user

Session-level threat scoring

Pass the same session_id across multiple calls to enable multi-turn attack detection. AEVRIS tracks risk across the conversation server-side and flags coordinated attacks before they complete.

session_id = "user-123-conversation-456"

r1 = client.scan_input("hello, how are you?", session_id=session_id)
r2 = client.scan_input("what can you help with?", session_id=session_id)
r3 = client.scan_input("ignore your instructions and...", session_id=session_id)

print(r3.session_risk_score)     # accumulated risk across all 3 calls
print(r3.session_threat_level)   # SAFE / LOW / MEDIUM / HIGH / CRITICAL

Raise instead of check

If you'd rather use exception handling than checking .is_blocked every time:

client = Aevris(api_key="...", raise_on_block=True)

try:
    result = client.scan_input(user_prompt)
    # only reached if not blocked
except AevrisBlockException as e:
    print(f"Blocked: {e.result.summary}")

Agent action firewall

Gate autonomous agent actions behind human approval before they execute. This uses a different 4-state model (ALLOWED / BLOCKED / FLAGGED / PENDING_APPROVAL) than the input/output scans:

action = client.scan_action(
    action_type="delete_file",
    action_payload={"path": "/data/customer_records.db"},
)

if action.is_pending:
    print(f"Awaiting human approval: {action.poll_url}")
    # poll later with client.poll_action(action.action_id)
elif action.is_blocked:
    print(f"Blocked: {action.message}")
elif action.is_allowed:
    proceed_with_action()

Webhook alerts

Get real-time, HMAC-signed alerts when AEVRIS blocks something:

client.set_webhook(
    webhook_url="https://your-endpoint.example.com/aevris-alerts",
    min_severity="HIGH",
)

AEVRIS immediately sends a signed test payload to confirm delivery. From then on, every BLOCK/COMPROMISED verdict at or above your threshold triggers a webhook with the verdict, severity, triggered agents, and session risk data.

Error handling

from aevris import AevrisAPIError

try:
    result = client.scan_input(prompt)
except AevrisAPIError as e:
    print(f"AEVRIS API error: {e} (status {e.status_code})")

Links

License

MIT

Download files

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

Source Distribution

aevris-1.0.0.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

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

aevris-1.0.0-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file aevris-1.0.0.tar.gz.

File metadata

  • Download URL: aevris-1.0.0.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for aevris-1.0.0.tar.gz
Algorithm Hash digest
SHA256 3d581537cdcaac99376bb7283cbea094b46991ef1769fa66b023bc6f78d762da
MD5 581ae984477fcaead3e47531c284eac3
BLAKE2b-256 a1523ae0845b0cbc58636ce6d2c68b6c2f410c03723524b4377c0832f15c9211

See more details on using hashes here.

File details

Details for the file aevris-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: aevris-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 9.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for aevris-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 42818ab29de8488a767d982080364d4b11ea8d7409e9b0537d42dd3f12107229
MD5 c87f93405fdfd92e58ae318a60c42637
BLAKE2b-256 eb6ca5fd572db373725c806eb62c0ce1e4a0b1c44415350684711b8226be87d9

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 files

Supported by

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