Skip to main content

nooa-governance

Object-oriented cost, retry, and timeout governance for NOOA agents — baked into the agent's own class, not bolted on as an external proxy.

Why

A June 2026 preprint catalogued 63 LLM-agent budget-overrun incidents across 21 orchestration frameworks, with uncontrolled retry loops as a leading cause. Every existing fix (agent-gov, LiteLLM per-key budgets, Microsoft's Agent Governance Toolkit) works as a reverse proxy sitting between the agent and the LLM provider — external, opaque to the agent's own codebase, untestable alongside the agent's own logic.

NOOA agents are plain Python classes. That makes a different answer possible: governance as an ordinary, inheritable, unit-testable mixin, living in the same codebase as the agent it governs.

Install

pip install nooa-governance

Usage

from nooa import Agent
from nooa.unifiedllm.registry import get_llm_client
from nooa_governance import GovernedMixin

llm = get_llm_client("gemini/gemini-3.5-flash-lite")

class MyAgent(GovernedMixin, Agent, llm=llm):
    def __init__(self):
        super().__init__()
        self.init_governance(max_calls=10, max_retries_per_call=2, timeout_s=30.0)

    async def _do_the_llm_thing(self, x: str) -> str:
        """..."""
        ...

    async def do_the_thing(self, x: str) -> str:
        return await self.governed_call("_do_the_llm_thing", lambda: self._do_the_llm_thing(x))

Every governed call is checked against a hard call budget before any LLM spend happens, retried a bounded number of times with exponential backoff on failure, and time-limited per attempt — never delegated to the LLM, so enforcement holds no matter what the model decides to do. agent.governance_report() gives a deterministic audit trail: calls made, retries used, failures, and a per-attempt log.

What this doesn't do (yet)

calls_made counts governed method invocations, not raw LLM API calls — NOOA's execution strategy can make more than one real model round-trip per method call, so this is a solid retry/circuit-breaker mechanism but an imperfect proxy for exact dollar cost. A future version should hook into NOOA's own tracing or LiteLLM's token-usage callbacks for precise cost accounting.

Full example

A complete, real application built on this library — a claim/due-diligence verification agent with a live dashboard, Docker, and Kubernetes manifests — is in the same repository: github.com/malikbello/governed-research-agent.

License

Apache-2.0

Metadata

Release files for nooa-governance 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nooa-governance 0.1.0
File Size Uploaded
nooa_governance-0.1.0.tar.gz 38.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nooa-governance 0.1.0
File Interpreter ABI Platform
nooa_governance-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 47.1 kB

Release files / nooa_governance-0.1.0.tar.gz

Download URL nooa_governance-0.1.0.tar.gz
Size 38.3 kB
Tags Source
SHA-256 checksum
How to use checksums
7188df3db971ce4c6e7831ce99c3a8cf8f0e63212ec5ef66af4ceca4f6ec1f26
BLAKE2b-256 checksum
How to use checksums
94b8286b8a0ce1b230f4e910fb175a90e6b0d50b46b1e74f2de1ff71c6daceb3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 20, 2026.

Transparency log

Release files / nooa_governance-0.1.0-py3-none-any.whl

Download URL nooa_governance-0.1.0-py3-none-any.whl
Size 8.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6ebdeb5e139b0fc5028bac0155b4b8062b617eb28f62f8643ef953365ff60fb1
BLAKE2b-256 checksum
How to use checksums
f4b1726e8e590a4fa4b0485b9b0b7709140c0b18bed1617dc19faad0425eb1d1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 20, 2026.

Transparency log

Release history Release notifications | RSS feed

0.1.1

2 release files

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page