Skip to main content

Hejdar AI governance SDK — policy evaluation for AI agents

Project description

Hejdar Python SDK

Policy evaluation for AI agents. Check actions against Hejdar governance rules before execution.

Install

pip install hejdar

Quickstart

from hejdar import Hejdar, HejdarDeniedError, HejdarNetworkError

client = Hejdar(api_key="hejdar_sk_...")

try:
    result = client.check(
        agent_id="finance-assistant",
        action_type="WRITE_DB",
        data_classification="PII",
        environment="production",
    )
    if result.allowed:
        # Proceed with action
        pass
except HejdarDeniedError as e:
    # Blocked in enforce mode
    print(f"Denied: {e.reason_code}")
except HejdarNetworkError:
    # API unreachable — fail closed (treat as deny)
    pass

Modes

  • Observe (shadow): Returns WOULD_DENY / WOULD_REQUIRE_APPROVAL — logs a warning, never raises. Use to trial policies.
  • Enforce: Returns DENY / REQUIRE_APPROVAL — raises HejdarDeniedError and blocks execution.

Async

result = await client.check_async(agent_id="...", action_type="READ_DB")

API Reference

check(agent_id, action_type, data_classification="INTERNAL", environment="production", ...) — see docstrings.

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

hejdar-0.1.0.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

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

hejdar-0.1.0-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hejdar-0.1.0.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for hejdar-0.1.0.tar.gz
Algorithm Hash digest
SHA256 04f97aeda99e4c90c989838617be955d69846e9a276de531f2a75b8c1d6ae138
MD5 4c31583f234d36749c028b5254efb44e
BLAKE2b-256 b0a39025f3ec328522efcd7d510bddc98f0dbd15dbede34e5480084b7d64d7a3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hejdar-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for hejdar-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d8a882b6b648103d1f90e7992e1f4ef5d9ebbc6ab60e39dc2c58a050192e73ee
MD5 91ea04c5c65960add6ac32b102463eb6
BLAKE2b-256 af76f31ca63098cb15a1d2e924ba4f4eccf94db613acfe824bef3d4ddde42c47

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