Skip to main content

auctra (Python SDK)

Stage 0/1 Python client for issue, action.execute, consume_execution_lease, and evidence.verify. with_execution_lease is the protected consume-then-run helper. ALLOW alone is not permission to invoke the tool.

Requires Python 3.9+.

pip install auctra==0.3.10
# local dev: pip install -e packages/python-sdk

Quick start (with intent anchor)

Every governed action requires create_intent first, then pass the returned intent (id + anchor_token) on execute:

from auctra import Auctra

client = Auctra(api_key="auctra_...", base_url="https://app.auctra.tech")

agent_id = "your-agent-uuid"
expires_at = "2027-01-01T00:00:00Z"

client.authority.issue(
    subject=agent_id,
    capabilities=["send_payment"],
    expires_at=expires_at,
    max_amount=500,
    max_lifetime_actions=100,
    max_lifetime_amount=10_000,
    currency="USD",
)

created = client.create_intent(
    title="Pay matched vendor invoices",
    intent_type="payment",
    risk_level="high",
    max_risk_level="critical",
    allowed_action_types=["send_payment"],
    expires_at=expires_at,
)
intent = created["intent"]

preview = client.action.evaluate(
    agent_id=agent_id,
    action_type="send_payment",
    payload={"amount": 50, "currency": "USD"},
    intent=intent,
)

decision = client.action.execute(
    agent_id=agent_id,
    action_type="send_payment",
    payload={"amount": 50, "currency": "USD", "target": "vendor:acme"},
    intent=intent,
    action={
        "target": "vendor:acme",
        "description": "Net-30 invoice payment",
        "risk_level": "medium",
    },
)

print(decision["decision"])

from auctra import with_execution_lease

def invoke_tool(allowed):
    # side effect only after consume
    return allowed["action_request_id"]

if decision["decision"] == "allowed":
    with_execution_lease(client, decision, invoke_tool)

client.evidence.verify(payload=decision["evidence_payload"], evidence=decision["evidence"])

New-client gotcha

Sending only claimed_intent_id (without intent_anchor_token or the intent object) returns require_approval (low) or blocked (medium+) with a reason about the missing anchor. Pass intent= from create_intent, or set both claimed_intent_id and intent_anchor_token explicitly. Missing intent entirely on medium+ is now blocked.

See docs/integrations/intent-anchors.md.

Threat-engine helpers (Engine 03 + 12)

Lifetime budgets — cap total actions or spend across the delegation lifetime:

client.authority.issue(
    subject=agent_id,
    capabilities=["send_payment"],
    expires_at=expires_at,
    max_lifetime_actions=50,
    max_lifetime_amount=25_000,
    currency="USD",
)

Untrusted tool/MCP outputs — declare provenance on medium+ / tool-sourced / RAG paths so responses cannot authorize the next action (Authority Gate blocks without metadata.inputs):

from auctra import action_metadata_with_inputs, declare_tool_response_input

tool_input = declare_tool_response_input(
    tool_name="fetch_invoice",
    content_hash="sha256:…",
)

decision = client.action.execute(
    agent_id=agent_id,
    action_type="send_payment",
    payload={"amount": 50, "currency": "USD"},
    intent=intent,
    action={
        "target": "vendor:acme",
        "metadata": action_metadata_with_inputs(tool_input),
    },
)

Pass multiple inputs: action_metadata_with_inputs(a, b) or {"inputs": [a, b]} in action["metadata"].

Authority Gate responses — evaluate/execute may include gate_transcript (defense-in-depth layers) and threat_engines on the JSON body, aligned with @auctra/sdk@0.7.7. See docs/security/authority-gate.md.

Declare fetch/egress destinations via action["metadata"]["fetch"] / egress_host_allowlist, and MCP install trust via mcp_install + supply_chain_attestation (Engines 13–15) — same opt-in honesty model as tool attestation.

Public surface

declare_tool_response_input | action_metadata_with_inputs | InputProvenance
on_allowed | assert_authority_live
client.create_intent | list_intents
client.list_agents | create_agent | get_agent
client.list_api_keys
client.approve_action_request | reject_action_request
client.list_policies | create_policy | simulate_policy | publish_policy
client.get_authority_graph | get_authority_liveness | list_action_types | list_workload_identities
client.list_siem_endpoints | create_siem_endpoint | delete_siem_endpoint
client.list_incidents | open_incident | resolve_incident
client.list_compliance_packs | run_compliance_pack | list_compliance_runs
client.authority.issue | verify | delegate | revoke
client.action.evaluate | execute  (parent_action_id, execute_after)
client.get_action_request
client.evidence.verify

Metadata

Release files for auctra 0.3.10

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

Source distribution (sdist)

Source distribution for auctra 0.3.10
File Size Uploaded Provenance
auctra-0.3.10.tar.gz 12.5 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 24.5 kB

Release files / auctra-0.3.10.tar.gz

Download URL auctra-0.3.10.tar.gz
Size 12.5 kB
Tags Source
SHA-256 checksum
How to use checksums
759fc2c99ed7dca0285e4b66b6cb2a1b328dec424c8bc85170ce067a78ce1fd3
BLAKE2b-256 checksum
How to use checksums
66340a52300bca7f3a866cd2ac857e27a956f1377d6584af2abe498649739a71
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.15

Release files / auctra-0.3.10-py3-none-any.whl

Download URL auctra-0.3.10-py3-none-any.whl
Size 12.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
15ed5cd8837c120e1ebaffdb5efee6cd2fc5259c8eee6bdfd56f8fa16af87ce2
BLAKE2b-256 checksum
How to use checksums
e6d1abc82e4a5b9ac15760263b243600bbd2d4d5fb55fab080c4813254692475
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.15

Security for auctra 0.3.10

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.

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