Skip to main content

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.

Metadata

Release files for hejdar 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hejdar 0.1.0
File Size Uploaded Provenance Actions
hejdar-0.1.0.tar.gz 4.9 kB Without provenance Details for hejdar-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for hejdar 0.1.0
File Interpreter ABI Platform Actions
hejdar-0.1.0-py3-none-any.whl Python 3 none any Details for hejdar-0.1.0-py3-none-any.whl

Total release size: 9.9 kB

Release files / hejdar-0.1.0.tar.gz

Download URL hejdar-0.1.0.tar.gz
Size 4.9 kB
Tags Source
SHA-256 checksum
How to use checksums
04f97aeda99e4c90c989838617be955d69846e9a276de531f2a75b8c1d6ae138
BLAKE2b-256 checksum
How to use checksums
b0a39025f3ec328522efcd7d510bddc98f0dbd15dbede34e5480084b7d64d7a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release files / hejdar-0.1.0-py3-none-any.whl

Download URL hejdar-0.1.0-py3-none-any.whl
Size 5.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d8a882b6b648103d1f90e7992e1f4ef5d9ebbc6ab60e39dc2c58a050192e73ee
BLAKE2b-256 checksum
How to use checksums
af76f31ca63098cb15a1d2e924ba4f4eccf94db613acfe824bef3d4ddde42c47
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Security for hejdar 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page