PYTHON POLICY LIBRARY

Your rules.
Inside your agent stack.

Check proposed actions against a versioned constitution. Add Python wrappers, role separation, and configurable audit evidence to the agent framework you already use.

For Python developers adding governance to an existing agent application.

Minimal validation example

Start with one explicit rule.

rules:
  - id: no-wire
    text: Block unauthorized wires
    severity: critical
    keywords: [wire transfer]
send invoice email
valid → True
wire transfer $1000
violation → raises
Keyword matching illustrates a policy check. It does not execute or authorize a payment.
BetaRelease 2.12.0Python 3.10+Apache-2.0View evidence

WHERE IT FITS

A clear place in your stack.

Use this for local constitutional checks and role-aware wrappers. Its legitimacy receipts are distinct from gove-zone receipts; the bridge to the kernel is experimental.

  1. 01

    Define the constitution

    Put your action rules in YAML and retain their version.

  2. 02

    Check the proposed action

    Validate against configured keyword and regex rules, or use governed wrappers.

  3. 03

    Enforce + inspect

    Use the separate execution gate and explicitly configure the audit evidence you need.

A small starting point, with room to integrate.

RULES
Deterministic keyword and regex checks.
ROLES
Separate proposer, validator, and executor responsibilities.
RECEIPTS
Use the library’s legitimacy contract on configured paths.
AUDIT
Choose full audit mode and storage intentionally.

INSIDE THE PRODUCT

Capabilities you can inspect.

Follow each behavior to its implementation or maintained documentation.

01

Keep the framework you use

ACGS-Lite leaves planning, model calls, memory, and orchestration in your application. It adds checks and wrappers around the actions you choose.

Inspect the source
02

Give roles explicit responsibilities

Governed wrappers support proposer, validator, and executor separation. The governed agent checks its assigned role and the requested governance action.

Inspect the source
03

Use the execution contract

The separate legitimacy gate checks receipt fields, integrity, execution state, and supplied call boundaries before invoking a wrapped function.

Inspect the source
04

Configure the evidence you retain

Full AuditLog supports chain verification and JSON export. The engine’s default fast audit mode is an aggregate path without chain hashing.

Inspect the source

LOCAL EVALUATION

Make one rule observable.

Install the released library, then try the maintained README validation example. Move to the five-minute guide for role checks and the explicit execution gate.

  1. Install the release

    Use Python 3.10 or later and install acgs-lite==2.12.0 in your environment.

  2. Validate two proposed actions

    The example accepts an invoice-email description and raises ConstitutionalViolationError for a wire-transfer description.

  3. Wire the execution path

    The validation call is only a rule check. Follow the guide to integrate receipt checks, execution, and a full audit log.

Open full setup instructions Open the pinned checkout
Python · validation only
pip install acgs-lite==2.12.0
from acgs_lite import Constitution, GovernanceEngine

constitution = Constitution.from_yaml_str(
    "rules:\n  - {id: no-wire, text: Block unauthorized wires, "
    "severity: critical, keywords: [wire transfer]}"
)
engine = GovernanceEngine(constitution)

print(engine.validate("send invoice email", agent_id="demo").valid)
engine.validate("wire transfer $1000", agent_id="demo")

Expected: True, then ConstitutionalViolationError. No email or transfer is executed.

Copy the example or select the code manually.

DESIGN AROUND THE BOUNDARY

Know the scope.

The integration and operating conditions are part of the product decision.

What does the rule engine understand?

The inspected checks use deterministic keyword and regex matching. They are not semantic understanding, universal content moderation, or automatic detection of every sensitive action.

Is every decision durably audited by default?

No. The engine defaults to fast, aggregate auditing. Pass an explicit AuditLog or full audit mode for chain evidence, and configure persistent storage if you need durability.

Does a Lite check equal a gove-zone decision?

No. These packages have different receipt contracts. A successful rule check is not the kernel execution gate. The gove bridge is marked experimental.

What is its current maturity?

The package is Beta. The README reports no independently confirmed production users. Signing keys, trusted verification, identity, storage, and operations remain deployment responsibilities. Control-mapping reports are self-assessments, not certificates.

SOURCE, RELEASE, AND CHECKS

Evidence with a reference.

GitHub release v2.12.0 was published August 15. Package maturity is Beta; individual adapters have their own stability labels.

INSPECTED SOURCESource: 2.12.0963977e63b51

Reviewed 2026-09-08. Source version and published release are tracked separately.

CI SNAPSHOT · 2026-09-08Selected CI checks passed

The inspected head passed Python 3.10-3.13 tests, package checks, docs checks, and governance regression gates. Main CI excludes slow, benchmark, and end-to-end tests.

Read the workflow evidence

FROM READING TO EVALUATION

Start with the source.

Follow one example. Inspect the result. Decide whether it fits your workflow.