airg-client
Python client for the AI Runtime Governor – a runtime governance layer for AI agents.
The Governor evaluates every tool invocation against configurable policies and returns an allow / block / review decision before the tool executes.
Installation
pip install airg-client
Requires Python 3.9 or later. Create an API key in the AIRG dashboard.
Quick start
import os
from airg import AIRG
client = AIRG(
base_url="https://api.airg.nov-tia.com",
api_key=os.environ["GOVERNOR_API_KEY"],
)
decision = client.evaluate(
tool="issue_refund",
args={"order_id": "A-1001", "amount": 40, "currency": "GBP"},
context={"session_id": "abc-123"},
)
print(decision["decision"]) # "allow" | "review"
print(decision["risk_score"]) # 0 – 100
print(decision["explanation"])
Configuration
| Environment variable | Description |
|---|---|
GOVERNOR_URL |
Base URL of the Governor service (default http://localhost:8000; the hosted service is https://api.airg.nov-tia.com) |
GOVERNOR_API_KEY |
API key (airg_…) |
Or pass them explicitly:
client = AIRG(api_key="airg_...", base_url="https://api.airg.nov-tia.com")
API
AIRG(*, api_key=None, base_url=None, timeout=10.0)
Create a client. Reads GOVERNOR_API_KEY and GOVERNOR_URL from
environment variables when not provided.
client.evaluate(tool, args, context=None, *, review_mode="hold", hold_timeout=60) → dict
Evaluate a tool call. Returns the decision dict:
{
"decision": "allow", # "allow" | "block" | "review"
"risk_score": 0.15,
"explanation": "Low-risk read operation",
"policy_ids": ["shell-guard"],
"modified_args": None,
}
Raises BlockedError if the decision is "block".
Review decisions. By default (review_mode="hold", since 0.4.0) a
"review" decision waits up to hold_timeout seconds for a reviewer. The
call returns only if the action is approved; otherwise it raises
ReviewRejectedError or ReviewExpiredError, so your code does not run it.
client.evaluate("wire_transfer", {"amount": 250000}, hold_timeout=120)
# returns once approved; raises ReviewRejectedError or ReviewExpiredError otherwise
To get the decision back at once instead, pass review_mode="proceed". Your
code must then not run the action until a reviewer approves it; the first
time this happens the client emits a ReviewNotEnforcedWarning.
Upgrading from 0.3.x: review_mode used to default to "proceed". Code
that relied on that and handles reviews itself should pass
review_mode="proceed" explicitly.
hold_timeout is capped at 300 seconds by the Governor.
client.scan(text, agent_id=None, session_id=None, context=None) → dict
Scan agent output for threats before sending to users.
client.verify(action_id, tool, result, context=None) → dict
Post-execution verification. Raises VerificationError on violations.
client.ingest_spans(spans) → dict
Batch-ingest agent trace spans.
client.list_traces(**filters) → list
List traces with optional filters (agent_id, session_id, has_blocks, limit, offset).
client.get_trace(trace_id) → dict
Fetch full trace detail.
client.delete_trace(trace_id) → dict
Delete all spans for a trace.
Exceptions
| Exception | Description |
|---|---|
AIRGError |
Base exception |
BlockedError |
Governor blocked the action |
ReviewRejectedError |
Human reviewer rejected |
ReviewExpiredError |
Review timed out |
VerificationError |
Post-execution violation |
ReviewNotEnforcedWarning |
Warning: a "review" decision returned without waiting (review_mode="proceed") |
Requirements
- Python ≥ 3.9
- httpx ≥ 0.24.0
Links
- Documentation: https://app.airg.nov-tia.com/docs
- Developer site: https://developers.airg.nov-tia.com/
- TypeScript SDK:
@novtia-npm/airg-clienton npm
License
MIT © 2026 NOVTIA LTD. The full text is in the LICENSE file included in the package.
Metadata
Release files for airg-client 0.4.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| airg_client-0.4.2.tar.gz | 7.2 kB | Without provenance | Details for airg_client-0.4.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| airg_client-0.4.2-py3-none-any.whl | Python 3 | none | any | Details for airg_client-0.4.2-py3-none-any.whl |
Total release size: 15.4 kB
Release files / airg_client-0.4.2.tar.gz
| Download URL | airg_client-0.4.2.tar.gz |
|---|---|
| Size | 7.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7ff3df7526dba456ba5ca43bdfa690933a317ffb42c150cb1dc839f6539d75d4
|
|
BLAKE2b-256 checksum How to use checksums |
98e76279f3eac4f78656fa673c2ffc9b17887ef2fac6c0ef31f95b0ea629ba4c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.10
|
Release files / airg_client-0.4.2-py3-none-any.whl
| Download URL | airg_client-0.4.2-py3-none-any.whl |
|---|---|
| Size | 8.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8f626f45b46efa7a3bebfae8d072a137d83dccdd43015be00d92c96e48fc634b
|
|
BLAKE2b-256 checksum How to use checksums |
50233a63ad4105a149356382927a72d0a0ce6a89411adb34dd5a944880095394
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.10
|
Security for airg-client 0.4.2
Provenance
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
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.