Skip to main content

Bring Your Own Client

AgentRein’s SDK contains zero connector logic. There are no Stripe, GitHub, or Slack classes to import from agentrein. Instead, you install and initialize your own standard SDK clients as you normally would, then pass them to wrap().

How the Proxy Works

wrap() returns a proxy that is transparent to your code — types, autocompletion, and runtime behavior are all preserved. When you call any method on the wrapped client:
  1. The proxy captures the method path and arguments
  2. Your original SDK method executes normally
  3. AgentRein logs the action to the backend
  4. If the call throws, AgentRein triggers a LIFO rollback of all previous actions in the session
In TypeScript, step 3 is fire-and-forget (non-blocking). In Python (v1, synchronous), this logging call completes before wrap() returns.
Python-specific: wrap the specific object whose methods you’re about to call directly, not a top-level client several calls away. Many Python SDKs return a new, unwrapped object from getter methods (get_repo(), etc.). If your workflow needs to track a multi-step chain, wrap the specific resource object right before calling logged methods on it.

Connector Prefix & Total Action Coverage

The connector string passed to wrap() must match the prefix registered in the backend rollback registry. AgentRein supports 142 actions across 9 connectors:

GitHub Connector Actions (20 Actions)

Files

Issues & Comments

Pull Requests & Comments

Releases

Reviews

Workflows

Users


Slack Connector Actions (24 Actions)

Messages

Channels

Files

Reactions & Stars

User Profile & User Groups


Stripe Connector Actions (10 Actions)

Invoices & Customers

Charges & Refunds

Coupons & Meter Events

Payment Methods


HubSpot Connector Actions (17 Actions)

CRM Objects

Engagements, Associations & Lists


Salesforce Connector Actions (28 Actions)

Objects & Records


Notion Connector Actions (9 Actions)

Pages & Database Items


Gmail Connector Actions (16 Actions)

Messages & Drafts

Threads & Labels


Google Drive Connector Actions (10 Actions)

Files & Drives


Google Sheets Connector Actions (8 Actions)

Spreadsheets, Sheets & Values