Skip to main content

Thin public ACGS namespace package backed by acgs-lite

Project description

acgs

PyPI Python License: AGPL-3.0

Framework-agnostic governance SDK for AI agents.

acgs is the stable public namespace over acgs-lite. It re-exports the core governance primitives and adds pluggable policy backends plus persistent audit stores without requiring an external policy server.

Installation

acgs supports Python 3.10+.

pip install acgs
pip install acgs[cedar]
pip install acgs[fastapi]
pip install acgs[anthropic]
pip install acgs[openai]
pip install acgs[langchain]

Quick Start

from acgs import Constitution, GovernanceEngine, Rule, Severity

constitution = Constitution.from_rules([
    Rule(
        id="NO-SELF-APPROVAL",
        text="Agents may not self-approve production changes",
        severity=Severity.HIGH,
        keywords=["self-approve"],
    ),
])

engine = GovernanceEngine(constitution, strict=False)
result = engine.validate("self-approve this deployment", agent_id="agent-7")

assert result.valid is False
assert result.violations[0].rule_id == "NO-SELF-APPROVAL"

Policy Backends

Heuristic Backend

from acgs import Constitution, GovernanceEngine
from acgs.policy import HeuristicBackend

constitution = Constitution.default()
engine = GovernanceEngine(constitution, strict=False)
backend = HeuristicBackend(engine)

decision = backend.evaluate(action="deploy to prod", agent_id="bot-1")
print(decision.allowed, decision.backend, decision.latency_ms)

Cedar Backend

from acgs.cedar import CedarBackend

backend = CedarBackend.from_policy_dir("./policies")
decision = backend.evaluate(
    action="read:patient-records",
    agent_id="clinical-bot",
    context={"role": "EXECUTIVE", "department": "cardiology"},
)

Audit Stores

SQLite Audit Store

from acgs.audit_sqlite import SQLiteAuditStore

store = SQLiteAuditStore(path="acgs_audit.db")
entries = store.list_entries(agent_id="bot-1", limit=100)
chain_ok = store.verify_chain()

In-Memory Audit Store

from acgs.audit_memory import InMemoryAuditStore

store = InMemoryAuditStore()
print(store.count())

What acgs Adds Over acgs-lite

Layer Package Role
Public API acgs Stable namespace, policy backends, audit stores
Engine acgs-lite Validation engine, MACI, integrations, CLI

Import from acgs when you want the stable public SDK. Import acgs-lite directly when you need package-specific integrations, middleware, or the CLI.

Key Features

  • Stable governance primitives re-exported from acgs-lite.
  • Pluggable PolicyBackend interface with built-in heuristic and Cedar backends.
  • Persistent audit storage through in-memory and SQLite implementations.
  • Fail-closed policy evaluation and tamper-evident audit-chain verification.

License

AGPL-3.0-or-later. Commercial licensing is available; contact hello@acgs.ai.

Links

Constitutional Hash: 608508a9bd224290

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

acgs-1.0.0a1.tar.gz (11.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

acgs-1.0.0a1-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

Details for the file acgs-1.0.0a1.tar.gz.

File metadata

  • Download URL: acgs-1.0.0a1.tar.gz
  • Upload date:
  • Size: 11.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for acgs-1.0.0a1.tar.gz
Algorithm Hash digest
SHA256 f718acab7c5f20a7147c4841f20e672675c46808656b6a9099a1498cb80c1113
MD5 63dffb1d637a9822d36c3612992949a6
BLAKE2b-256 35ef25b46142b3e98c7216543c6bb21b6855214d93514c58f071c59ba97accea

See more details on using hashes here.

File details

Details for the file acgs-1.0.0a1-py3-none-any.whl.

File metadata

  • Download URL: acgs-1.0.0a1-py3-none-any.whl
  • Upload date:
  • Size: 11.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for acgs-1.0.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 5b242e52b8a5e4c9c6907b8bdca7ebe902e1f5874416bd16d851459e0083ff89
MD5 9d96cff5497c1f0a98be97316141f5e0
BLAKE2b-256 7e8c1e4de51b6bf727f80fad1a1661f658a331abc194f9f9a9225a09c72e7364

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page