A runtime governance layer that enforces hard behavioral bounds in autonomous agents.
Project description
Governance
Governance is a rigorous engineering kernel for AI agents. It enforces the "World & IBM" 15-point checklist for safe, deterministic, and bounded autonomous systems.
It sits between your agent's brain and its hands, translating abstract signals (reward, novelty, urgency) into hard execution boundaries.
The 15-Point Governance Checklist
This package solves the "Unbounded Behavior" problem by default.
1. Unbounded Behavior
“We cannot allow systems that run indefinitely.”
- Solution:
governancestrictly ties execution to a finite budget (effort,persistence). When budget reaches zero, the agent HALTS. No infinite loops, no endless retries.
2. Runtime Control
“Policies written before deployment don’t matter at runtime.”
- Solution: Dynamic
step()evaluation updates control state during execution. Ifriskspikes orprogressstalls, the kernel intervenes immediately, overriding the agent's intent.
3. Deterministic Behavior
“We need predictable outcomes, not vibes.”
- Solution: The kernel is a deterministic state machine. Same signal sequence $\rightarrow$ Same internal state $\rightarrow$ Same halt decision. Zero stochasticity in enforcement.
4. Explainable Halting
“If it stops, we must know why.”
- Solution: Every halt returns a precise
FailureType(EXHAUSTION,STAGNATION,OVERRISK,SAFETY) and a human-readable reason string.
5. Fail-Closed Semantics
“When something goes wrong, stop — don’t guess.”
- Solution: If telemetry is missing or trust is low, the kernel defaults to safety. Once halted, the system remains halted (terminal state) until explicit manual reset.
6. Physical Enforcement
“Advisory systems are not governance.”
- Solution: The
InProcessEnforcer(and future proxy/sidecar patterns) physically blocks tool execution when the kernel halts. It raisesEnforcementBlocked, preventing the action from occurring.
7. Auditability & Traceability
“Show us exactly what happened.”
- Solution:
AuditLoggerrecords an immutable, append-only ledger of every step, signal, budget state, and decision.
8. Accountability Attribution
“Who authorized this action?”
- Solution: Every decision is cryptographically linked to a specific step and agent identity in the audit log.
9. Risk Containment
“The system must not escalate itself.”
- Solution: Explicit
riskbudget. As urgency scales, risk tolerance may increase slightly, but hard caps (max_risk) prevent catastrophic escalation.
10. Progress vs Activity Discrimination
“Busy ≠ productive.”
- Solution: The
stagnation_windowdetects "spinning" (actions with low reward). It depleteseffortrapidly when an agent is active but ineffective.
11. Resilience to Bad Telemetry
“If sensors lie, slow down.”
- Solution: The
trustsignal dampens positive inputs (reward/novelty) validation but passes negative inputs (difficulty/urgency) fully. Noisy data leads to conservative behavior.
12. Model-Agnosticism
“We will swap models constantly.”
- Solution: Works with LangChain, AutoGen, CrewAI, or raw loops. It checks signals, not prompts or model weights.
13. Human Override & Recovery
“Humans must remain the final authority.”
- Solution:
reset()is a privileged operation. The system cannot restart itself; a human (or supervisor process) must authorize a new budget.
14. Compliance Readiness
“We don’t want to rebuild this for every law.”
- Solution: Generates standardized JSON artifacts (
trace.json) suitable for regulatory introspection.
15. Scalability Across Agent Systems
“This won’t be one agent.”
- Solution:
SystemGovernormanages shared budget pools across swarms, detecting cascades and ensuring no single agent hogs resources.
Installation
pip install agentharnessengine
(Note: Requires Python 3.10+)
Quick Start
from governance import GovernanceKernel, step, Signals
# 1. Initialize the Kernel
kernel = GovernanceKernel()
# 2. Run your agent loop
while True:
# ... Agent thinks and chooses an action ...
# 3. Feed signals to Governance
# reward: 0.0-1.0 (Did we make progress?)
# novelty: 0.0-1.0 (Is this new info?)
# urgency: 0.0-1.0 (Are we out of time?)
result = step(kernel, Signals(reward=0.5, novelty=0.1, urgency=0.0))
# 4. ENFORCE
if result.halted:
print(f"🛑 HALTED: {result.failure} - {result.reason}")
break
# 5. Execute action only if allowed
print(f"✅ GO: Effort={result.budget.effort:.2f}")
How It Works
Pressure (unbounded, accumulates) $\rightarrow$ Budget (bounded [0,1], generally decreases).
- Effort: Fuel. Burns with time and activity.
- Risk: Thermometer. Freezes actions when too hot.
- Persistence: Grip strength. How long to try before giving up.
- Exploration: Leash length. How far to stray for new info.
Unlike RL or policies, Governance is not trying to maximize reward. It is trying to guarantee limits.
Architecture
Environment (Signals)
│
▼
[Governance Kernel] ──▶ Audit Log
│
▼
Decision (Halt/Go)
│
▼
Enforcement
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 agentharnessengine-0.7.0.tar.gz.
File metadata
- Download URL: agentharnessengine-0.7.0.tar.gz
- Upload date:
- Size: 96.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7dad88cfb2ed30f36086a27e096e23650facc35e0e309c9972eca05bc0e09e75
|
|
| MD5 |
7119df0e1f840b57826ef470d03ab501
|
|
| BLAKE2b-256 |
be53c82ab2c51d566baad737c0ee5bc0f8960e74177812e7721769ff6f263a4e
|
Provenance
The following attestation bundles were made for agentharnessengine-0.7.0.tar.gz:
Publisher:
publish.yml on Sarthaksahu777/Agent-Harness
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agentharnessengine-0.7.0.tar.gz -
Subject digest:
7dad88cfb2ed30f36086a27e096e23650facc35e0e309c9972eca05bc0e09e75 - Sigstore transparency entry: 872152949
- Sigstore integration time:
-
Permalink:
Sarthaksahu777/Agent-Harness@3915576f0f2a0ddf250fd61846d62c7a69ec4f81 -
Branch / Tag:
refs/tags/v0.5 - Owner: https://github.com/Sarthaksahu777
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3915576f0f2a0ddf250fd61846d62c7a69ec4f81 -
Trigger Event:
release
-
Statement type:
File details
Details for the file agentharnessengine-0.7.0-py3-none-any.whl.
File metadata
- Download URL: agentharnessengine-0.7.0-py3-none-any.whl
- Upload date:
- Size: 50.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d65f6f3a8d754f1b6efac99607ceed947b0ed770583542d447534639418a7839
|
|
| MD5 |
42c7a3f5562a6b0c4d64d885d296721e
|
|
| BLAKE2b-256 |
ac4f65f3785b3d337908ee054c8b5dc65e9491ef7725d7e612b790cb8b02430b
|
Provenance
The following attestation bundles were made for agentharnessengine-0.7.0-py3-none-any.whl:
Publisher:
publish.yml on Sarthaksahu777/Agent-Harness
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agentharnessengine-0.7.0-py3-none-any.whl -
Subject digest:
d65f6f3a8d754f1b6efac99607ceed947b0ed770583542d447534639418a7839 - Sigstore transparency entry: 872152953
- Sigstore integration time:
-
Permalink:
Sarthaksahu777/Agent-Harness@3915576f0f2a0ddf250fd61846d62c7a69ec4f81 -
Branch / Tag:
refs/tags/v0.5 - Owner: https://github.com/Sarthaksahu777
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3915576f0f2a0ddf250fd61846d62c7a69ec4f81 -
Trigger Event:
release
-
Statement type: