Ask Guardian before your AI agent acts. Guardian answers: allowed, waits for you, or blocked, using the rules you set in NrtVix.
pip install nrtvix Quick start In NrtVix, open Connected agents, choose your agent and press Create a key. Keep the key on your server, for example in an environment variable NRTVIX_API_KEY. Never put it in a browser or an app. from nrtvix import Guardian, NotPermitted guardian = Guardian() # reads NRTVIX_API_KEY try: with guardian.guard("refund_order", "ORDER-1042", amount=40, details="Damaged item"): issue_refund("ORDER-1042", 40) # runs only if Guardian allows it except NotPermitted as e: print("Not done:", e) # blocked, rejected by you, or expired guard() asks Guardian, waits while you approve or reject (if your rules say so), runs your block only when it is allowed, and then tells Guardian the action was done (or failed, if your block raised an error).
d = guardian.ask("view_customer_record", "jane@example.com") if d.waiting: d = guardian.wait(d, timeout=600) # raises nrtvix.Timeout if nobody decides in time if d.allowed: look_up_customer("jane@example.com") guardian.done(d) # Live mode: report it (each permission can be used once) Answer Meaning allow Go ahead. pending Waits for you (the owner). wait() checks until you decide. approved You approved it. Go ahead. rejected You rejected it. Do not do it. blocked Your rules (or Guardian's safety checks) block it. Do not do it. reviewable Blocked by default (for example a delete). Your agent may request_exception(d, reason). expired / revoked Nobody decided in time, or the permission was cancelled. Actions refund_order (with amount), view_customer_record, send_support_reply (text in details), export_customer_data and send_campaign (how many records or people in units), delete_database_record.
Agents start in Test mode, where Guardian accepts only names that start with DEMO- (for example DEMO-ORDER-1001). Switch the agent to Live on the Connect page when you are ready. In Test mode, use guard(..., report=False).
AuthError (wrong or revoked key), RateLimited, Blocked, Rejected, Expired, Timeout, APIError; all inherit from GuardianError. Network errors and server errors are retried twice with backoff.
Guardian(api_key="nvx_live_…", base_url="https://app.nrtvix.com/api/saas", timeout=10, retries=2) Webhooks Let NrtVix tell your server when something happens (add the address under Webhooks in the app):
from nrtvix import verify_webhook, challenge_response, InvalidSignature @app.post("/nrtvix/webhook") # Flask, FastAPI, Django: pass the raw body def hook(): try: event = verify_webhook(request.get_data(), request.headers["NrtVix-Signature"], os.environ["NRTVIX_WEBHOOK_SECRET"]) except InvalidSignature: return "", 400 if event["type"] == "webhook.verify": return challenge_response(event) # proves the address is yours; switches the webhook on if event["type"] == "request.waiting": notify_my_team(event["data"]) return "", 200 Events: request.allowed, request.waiting, request.approved, request.rejected, request.blocked, request.expired, action.done, action.failed, agent.paused (and webhook.test from the Send a test button).
No third-party dependencies. Python 3.9 or newer. MIT licence.
ai agents guardrails approvals nrtvix guardian llm
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
None of the files in this release were uploaded with provenance metadata.
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.
Nov 22, 2026 2 release files No provenance




