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

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.1
File Size Uploaded
once_agent_sdk-0.1.1.tar.gz 17.1 kB Details

Built distribution (wheel)

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

Total release size: 29.3 kB

Release files / once_agent_sdk-0.1.1.tar.gz

Download URL once_agent_sdk-0.1.1.tar.gz
Size 17.1 kB
Tags Source
SHA-256 checksum
How to use checksums
8fb2b092f0560c6926b9e2a5b9bb212b7f4bcc5712f9417150b3778f7f5d7b80
BLAKE2b-256 checksum
How to use checksums
b1341c8054e84a0ca38506ec56a140f3cd09b3e8a410591cc2ff4ec1c193a018
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.1-py3-none-any.whl

Download URL once_agent_sdk-0.1.1-py3-none-any.whl
Size 12.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5328a55b6da4cee3579d9dc22832c9622e0d97162eb74980fc2f2deb18eeef06
BLAKE2b-256 checksum
How to use checksums
39bedad5c2f7067e753227393a10c9c30194c4e6c3cff667e6af24e8e5c55bac
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.1 This release

2 release files

0.1.0

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