Python SDK for Sentinel human-in-the-loop oversight
Project description
Sentinel SDK
Oversight infrastructure for AI agents.
Sentinel adds human-in-the-loop approval to any Python function your agent calls.
Wrap the function with @oversight, and the SDK pauses execution, requests
approval, and only runs once a human approves.
Install
pip install sentinel-oversight
Quick start
# 1. Create an account at https://app.pauseapi.app/signup
# Copy the API key it returns.
# 2. Wrap your function:
from sentinel import configure, oversight
configure(api_key="sk_live_…")
@oversight(
risk_level="high",
approvers=["sms:+15551234567", "alice@acme.com"],
timeout_seconds=300,
)
def transfer_funds(amount: int, recipient: str):
return stripe.transfers.create(amount=amount, destination=recipient)
When your agent calls transfer_funds(1000, "acct_xyz"):
- Sentinel pauses execution and creates an approval on the backend.
- Notifications fire to every approver in the list (rules below).
- A human clicks Approve from a signed text/email link or the dashboard.
- The wrapped function runs, and its return value flows back to the caller.
If rejected → ApprovalRejected(reason) is raised. If no response within
timeout_seconds → ApprovalTimeout is raised (unless fallback="execute").
Approver formats
Each entry in approvers=[...] is a string. The format determines the channel.
| Format | Channel | Example |
|---|---|---|
name@company.com |
alice@acme.com |
|
mailto:name@company.com |
Email (explicit) | mailto:alice@acme.com |
sms:+15551234567 |
SMS (Twilio) | sms:+14155550123 |
You can mix formats — every approver receives a notification, the first decision wins.
Notification routing
- Email — fires if
RESEND_API_KEYis set AND any approver looks like an email address. Email contains signed approve/reject links (HMAC-SHA256, scoped to that action_id and timeout window). - SMS — fires if Twilio credentials are set AND an approver uses
sms:.
By default, emails send from onboarding@resend.dev. To get branded
approvals@yourdomain.app email, verify your domain in Resend (Pro plan).
Risk levels
risk_level is a string the dashboard uses for prioritization. Allowed values:
low, medium, high, critical. Required.
Configuration
Set via configure(...) or environment variables:
| Variable | Default | Description |
|---|---|---|
SENTINEL_API_URL |
https://api.pauseapi.app |
Base URL of the Sentinel backend |
SENTINEL_API_KEY |
required | Your tenant API key |
SENTINEL_TIMEOUT |
300 |
Default timeout_seconds |
SENTINEL_POLL_INTERVAL |
2 |
Seconds between status polls |
SENTINEL_FALLBACK |
reject |
reject or execute on timeout |
Exceptions
SentinelError— base class for all Sentinel errors.SentinelConfigError— SDK was used without anapi_key.SentinelAPIError(status_code, message, url)— backend returned a non-2xx.ApprovalRejected(reason, action_id)— a human rejected the request.ApprovalTimeout(action_id, timeout_seconds)— no decision before deadline.
Async
The decorator transparently supports async def functions:
@oversight(risk_level="medium", approvers=["alice@acme.com"])
async def send_email(to, body):
await mailgun.send(to=to, body=body)
Audit log
Every approval creates a hash-chained audit trail. Fetch it:
from sentinel import SentinelClient
client = SentinelClient()
events = client.list_audit_events(action_id="act_…") # or omit for full log
Each event has prev_hash and event_hash (SHA-256). Chain integrity can be
verified by recomputing sha256(prev_hash + json(payload)).
LangChain
from sentinel.adapters.langchain import SentinelCallbackHandler
agent.run("…", callbacks=[SentinelCallbackHandler(risk_level="high")])
Install with pip install sentinel-oversight[langchain].
Links
- Website: https://pauseapi.app
- Dashboard: https://app.pauseapi.app
- API repo: https://github.com/PetrefiedThunder/sentinel-api
- This SDK: https://github.com/PetrefiedThunder/sentinel-sdk
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sentinel_oversight-0.1.4.tar.gz.
File metadata
- Download URL: sentinel_oversight-0.1.4.tar.gz
- Upload date:
- Size: 8.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e29ee06b08f0fd762911853a33cef9d7823acbd878dd363eae62531600ff6ac3
|
|
| MD5 |
5585bf508ce666a985c151a3086cbe80
|
|
| BLAKE2b-256 |
f5ad4dd20eeabc4afab835303547ab4717bbb57ade500ebfd6483f37b871920e
|
Provenance
The following attestation bundles were made for sentinel_oversight-0.1.4.tar.gz:
Publisher:
publish.yml on PetrefiedThunder/sentinel-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sentinel_oversight-0.1.4.tar.gz -
Subject digest:
e29ee06b08f0fd762911853a33cef9d7823acbd878dd363eae62531600ff6ac3 - Sigstore transparency entry: 1628684482
- Sigstore integration time:
-
Permalink:
PetrefiedThunder/sentinel-sdk@31b6ba024fc3899af84295be64f6b8586e4a16fc -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/PetrefiedThunder
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@31b6ba024fc3899af84295be64f6b8586e4a16fc -
Trigger Event:
push
-
Statement type:
File details
Details for the file sentinel_oversight-0.1.4-py3-none-any.whl.
File metadata
- Download URL: sentinel_oversight-0.1.4-py3-none-any.whl
- Upload date:
- Size: 10.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8abe2b74035328d333becd0f243fdcfd7898920bedea1486e3bcf38febfd52db
|
|
| MD5 |
03babc6ee4c7cf3f827a07b4875077e4
|
|
| BLAKE2b-256 |
e03efa07a6c3da84c6c035a60a07405d7386c0ee4a30428deee38ed35ecc1ef7
|
Provenance
The following attestation bundles were made for sentinel_oversight-0.1.4-py3-none-any.whl:
Publisher:
publish.yml on PetrefiedThunder/sentinel-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sentinel_oversight-0.1.4-py3-none-any.whl -
Subject digest:
8abe2b74035328d333becd0f243fdcfd7898920bedea1486e3bcf38febfd52db - Sigstore transparency entry: 1628684514
- Sigstore integration time:
-
Permalink:
PetrefiedThunder/sentinel-sdk@31b6ba024fc3899af84295be64f6b8586e4a16fc -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/PetrefiedThunder
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@31b6ba024fc3899af84295be64f6b8586e4a16fc -
Trigger Event:
push
-
Statement type: