Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

DAAI Console Python SDK

DAAI Console is a governance layer for AI automations. It lets developers intercept risky registered agent actions before execution, route them through policy and approval, and produce audit receipts.

This repository contains the public alpha Python SDK for DAAI Console.

What DAAI Console Is Not

DAAI Console is intentionally narrow in alpha. It is not:

  • Magic interception of arbitrary code
  • A browser automation framework
  • A replacement for MCP
  • An OS-wide agent scanner
  • A full enterprise security platform

Execution Boundary

DAAI Console governs proposal, policy, approval, status, and receipts.

The developer application owns real business execution, local business logic, executor functions, external integrations, and worker or cron triggers. Place this SDK before risky functions. The SDK does not execute callbacks inside intercept().

Install

From PyPI:

pip install daai-console

Alpha pinning:

pip install daai-console==0.1.0a2

Environment

Set these values in your server-side environment:

export DAAI_API_KEY="..."
export DAAI_WORKSPACE_KEY="..."
export DAAI_BASE_URL="https://your-daai-api.example.com"

Do not expose these values in browser code or frontend bundles.

Minimal Client Example

import os

from daai_console import DaaiClient

client = DaaiClient(
    base_url=os.environ["DAAI_BASE_URL"],
    api_key=os.environ["DAAI_API_KEY"],
    workspace_key=os.environ["DAAI_WORKSPACE_KEY"],
)

payload = {
    "invoice_id": "INV-1025",
    "customer_name": "Acme Finance",
    "amount": 1250,
}

proposal = client.intercept(
    action="send_invoice_reminder",
    payload=payload,
    idempotency_key="invoice-reminder:INV-1025",
)

print(proposal.governance_status.value)
print(proposal.executable)

status = client.status(proposal.action_run_id)

if status.executable:
    try:
        # Your app owns the real business execution.
        provider_result = send_invoice_reminder(payload)
        client.report_executed(
            proposal.action_run_id,
            execution_result={"provider_id": provider_result["id"]},
        )
    except Exception as exc:
        client.report_failed(
            proposal.action_run_id,
            execution_error=f"{type(exc).__name__}: {exc}",
        )
else:
    print("Not executable yet. Wait for approval or policy decision.")

Runtime Helper Example

The runtime helpers make the safe path easier: propose once, persist pending approvals locally, and run only after DAAI Console reports executable=true.

import os

from daai_console import (
    DaaiActionRunner,
    DaaiClient,
    PendingActionManager,
    SQLitePendingStore,
)

client = DaaiClient(
    base_url=os.environ["DAAI_BASE_URL"],
    api_key=os.environ["DAAI_API_KEY"],
    workspace_key=os.environ["DAAI_WORKSPACE_KEY"],
)
store = SQLitePendingStore("daai_pending_actions.sqlite3")
manager = PendingActionManager(client=client, pending_store=store)

manager.propose(
    action="send_invoice_reminder",
    payload={"invoice_id": "INV-1025", "amount": 1250},
    idempotency_key="invoice-reminder:INV-1025",
)


def send_invoice_reminder_executor(payload: dict) -> dict:
    # Keep your existing execution function here.
    return {"message_id": "example-local-result"}


runner = DaaiActionRunner(client=client, pending_store=store)
runner.when_executable(
    action="send_invoice_reminder",
    run=send_invoice_reminder_executor,
)

executed_count = runner.run_pending_once()
print(f"Executed {executed_count} approved action(s).")

Live Alpha Smoke Tests

The unit tests in tests/ are mocked SDK-internal tests. They do not call DAAI Console and should remain safe for normal local runs and CI.

The scripts in examples/live_*.py are opt-in live smoke tests for alpha testers with real DAAI Console credentials. They call the configured API and should be run manually against a staging or alpha workspace.

Before running live scripts, make sure the action is already registered in your DAAI Console workspace. The default expected action is send_invoice_reminder. You can override it with DAAI_TEST_ACTION_NAME.

Set required environment variables:

export DAAI_API_KEY="..."
export DAAI_WORKSPACE_KEY="..."
export DAAI_BASE_URL="https://stage.api.daaihq.com"

DAAI_BASE_URL must point to the API, not the dashboard. For staging, use https://stage.api.daaihq.com, not https://stage.daaihq.com.

Optional environment variables:

export DAAI_TEST_ACTION_NAME="send_invoice_reminder"
export DAAI_PENDING_DB_PATH="./daai_alpha_pending.db"

Run the low-level client smoke test:

python examples/live_client_smoke.py

Run the runtime smoke flow:

python examples/live_runtime_smoke.py propose
python examples/live_runtime_smoke.py list-pending

If the proposal returns pending_approval, approve it from the approval email or dashboard. The SDK does not auto-approve and does not bypass governance. After approval, run:

python examples/live_runtime_smoke.py run-pending

run-pending uses DaaiActionRunner and a fake executor. It only simulates execution, and only runs when DAAI Console reports executable=true.

If the API returns blocked or unknown_action, it usually means the action is not registered in the workspace, the API/workspace key belongs to another workspace, or the action name does not match exactly. Register the action in the dashboard first, then rerun the script with the same action name.

Security Notes

  • Store DAAI_API_KEY and DAAI_WORKSPACE_KEY server-side only.
  • Do not expose keys in browser or frontend code.
  • Approval links should not contain sensitive payload data.
  • Local pending stores may contain business payloads; treat them as sensitive.
  • The SDK does not execute callbacks inside intercept().
  • Rejected and blocked actions should not execute.

Known Limitations

  • Python SDK first.
  • Cooperative interception only.
  • Developers must register and gate actions explicitly.
  • No automatic arbitrary-code interception.
  • Staging alpha APIs may change.
  • No enterprise RBAC in alpha.

Alpha Docs

Metadata

Release files for daai-console 0.1.0a2

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

Source distribution (sdist)

Source distribution for daai-console 0.1.0a2
File Size Uploaded Provenance Actions
daai_console-0.1.0a2.tar.gz 22.3 kB With provenance Details for daai_console-0.1.0a2.tar.gz

Built distribution (wheel)

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

Total release size: 34.6 kB

Release files / daai_console-0.1.0a2.tar.gz

Download URL daai_console-0.1.0a2.tar.gz
Size 22.3 kB
Tags Source
SHA-256 checksum
How to use checksums
7cacf62b3cb868d22fd8856fd6f875bbffb73b1e84a8a802c5a45448a1e2518c
BLAKE2b-256 checksum
How to use checksums
57ffe72da3fd1f3baef15fe3a42ef87ce8b78a847af3c4757324da5cf5b0eca8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 24, 2026.

Transparency log

Release files / daai_console-0.1.0a2-py3-none-any.whl

Download URL daai_console-0.1.0a2-py3-none-any.whl
Size 12.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b2683313f153669d28c8a8bac6f59573ec8370f2c852cc47ccc7a504570a7db8
BLAKE2b-256 checksum
How to use checksums
9d3873f0b0a541b74cfcd7b64bf2e37800bd15997fb00d4ed591f16606a7bfd0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 24, 2026.

Transparency log

Security for daai-console 0.1.0a2

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for daai_console-0.1.0a2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 24, 2026.

Transparency log

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
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