Skip to main content

once-agent-sdk

Execution safety for consequential AI agent tool calls.

Once helps applications avoid blindly repeating real-world side effects after ambiguous outcomes such as timeouts, crashes, lost responses, queue redelivery, or agent retries.

Examples include refunds, payments, payouts, bookings, orders, provisioning, deployments, API mutations, and other operations that change external state.

Install

pip install once-agent-sdk

Quick start

from once_agent import Once

once = Once()

order_id = "order_123"
operation_id = Once.id("refund", order_id)

result = once.execute(
    operation_id=operation_id,
    provider="my-provider",
    action={
        "type": "refund",
        "order_id": order_id,
    },
)

Set your Once API key in the environment:

ONCE_API_KEY=your_api_key

Do not commit API keys to source control.

Why stable operation identity matters

If an external action succeeds but its response is lost, retrying the action without knowing the prior outcome can duplicate the real-world side effect.

Once.id(...) generates a deterministic operation ID, so retries of the same logical operation can retain the same identity.

a = Once.id("refund", "order_123")
b = Once.id("refund", "order_123")

assert a == b

Claim boundary

Once does not claim universal exactly-once execution.

Execution safety depends on stable operation identity, durable Once state, the provider integration, and sufficiently authoritative provider truth. When an outcome cannot be established safely, Once can preserve uncertainty instead of blindly repeating the external action.

Release files for once-agent-sdk 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 once-agent-sdk 0.1.0
File Size Uploaded
once_agent_sdk-0.1.0.tar.gz 5.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for once-agent-sdk 0.1.0
File Interpreter ABI Platform
once_agent_sdk-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 10.0 kB

Release files / once_agent_sdk-0.1.0.tar.gz

Download URL once_agent_sdk-0.1.0.tar.gz
Size 5.0 kB
Tags Source
SHA-256 checksum
How to use checksums
4fd4d8ea65719d30801334d47e34a4d5f78dfd3be5774f2cbadf828077356448
BLAKE2b-256 checksum
How to use checksums
4ee4dbbd3d9ab7f24c67f058b86ae3d0b3aa094a7444b14dfb95897641a3995b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

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

Download URL once_agent_sdk-0.1.0-py3-none-any.whl
Size 4.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bf7ecef9d04cb6563c443cd2006ceaac28a26c58a89d5e48a406fe96b490acff
BLAKE2b-256 checksum
How to use checksums
b8cb8fb59f86f3bde9f394456b1cabbf8ae6fb11233d03cf529fc6e4d8d18618
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

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