Skip to main content

Agent recovery control plane SDK: protect agent actions so a failed credential parks the run and resumes exactly-once, without duplicating side effects. LangGraph, OpenAI Agents, and Anthropic tool-use adapters included.

Project description

revive-sdk

Agent recovery control plane SDK for Python. Wrap an agent's real-world action so that when its credential fails, the run parks, the right account owner reconnects, and the run resumes — without ever duplicating a side effect that already committed.

pip install revive-sdk

Protect one action

from revive import ReviveClient, ReviveParkedError

revive = ReviveClient("https://revivelabs.app", api_key="rv_live_…")

try:
    result = revive.protect_action(
        run_id=run_id,
        connection_id="conn_microsoft_ops",
        action_key="send_followup_email",
        execute=lambda: graph_send_mail(message),   # your real side effect
    )
    # executed exactly once; a retry returns the stored result, never re-sends
except ReviveParkedError as parked:
    # the credential is dead — send parked.parked.recovery_url to the account owner
    notify(parked.parked.recovery_url)

protect_action registers the action, gates execution on the ledger verdict (safe_to_execute / already_committed / reconcile_first), records the attempt, and opens a recovery case when the credential is rejected. Idempotency keys are derived from run_id + action_key unless you pass idem_key.

Framework adapters

# OpenAI Agents SDK — protect a function tool
from revive.adapters.openai_agents import revive_tool

@revive_tool(revive, connection_id="conn_microsoft_ops")
def send_followup_email(run_id: str, to: str, subject: str) -> dict:
    ...

# Anthropic tool use — guard the tool-execution side of the loop
from revive.adapters.anthropic_tools import ReviveToolGuard
guard = ReviveToolGuard(revive, connection_id="conn_microsoft_ops",
                        protected={"send_email", "create_ticket"})

# LangGraph — see revive.adapters.langgraph (install with: pip install "revive-sdk[langgraph]")

What Revive is not

Revive does not take custody of provider tokens — that stays with your credential vault (Nango, Auth0, Entra). It coordinates the in-flight run around a credential change: park, verify identity, fence stale workers, reconcile, resume.

Self-hosting (optional)

The package also ships the local park/resume engine (Engine, CheckpointStore, PostgresCheckpointStore) for running the recovery loop in-process instead of against the hosted control plane. See the repository.

Extras: revive-sdk[langgraph], revive-sdk[temporal], revive-sdk[postgres].

License: Apache-2.0 · https://revivelabs.app

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

revive_sdk-0.1.0.tar.gz (38.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

revive_sdk-0.1.0-py3-none-any.whl (26.9 kB view details)

Uploaded Python 3

File details

Details for the file revive_sdk-0.1.0.tar.gz.

File metadata

  • Download URL: revive_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 38.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.19

File hashes

Hashes for revive_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8243a271d57bc6e8a0e294637c11ef124887c6174f28ccb92e8af05f4ce522a6
MD5 7b39dac6ce6a6530511bcacd89211a5e
BLAKE2b-256 71baf74b61d7a9019c6c5421bcfef3c2e8cafcd100a8940a43836eba9cc52814

See more details on using hashes here.

File details

Details for the file revive_sdk-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: revive_sdk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 26.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.19

File hashes

Hashes for revive_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 10096ee4d03adbb6c49f9cbb71c8736a173dca3a3c237cbe33e0cb7d5becdfb0
MD5 4f672e466146cb9dddeb50f07cd9d32c
BLAKE2b-256 a9e03f28294409f281bd04a341fd3ddb05cb82764a78cf236cb11ec2f12c5b33

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page