Skip to main content

Public ACGS Lite package for constitutional governance in AI agents. Enforce rules, audit decisions, and prevent self-validation in production.

Project description

acgs-lite

PyPI Python License: AGPL-3.0

Constitutional governance infrastructure for AI agents.

acgs-lite lets you define constitutional rules in YAML or code, validate inputs and outputs deterministically, enforce MACI role separation, and maintain tamper-evident audit trails. Install name: acgs-lite. Import namespace: acgs_lite.

Installation

acgs-lite supports Python 3.10+.

pip install acgs-lite
pip install acgs-lite[anthropic]
pip install acgs-lite[openai]
pip install acgs-lite[langchain]
pip install acgs-lite[mcp]
pip install acgs-lite[gitlab]
pip install acgs-lite[server]
pip install acgs-lite[pdf]
pip install acgs-lite[all]

Quick Start

from acgs_lite import Constitution, GovernedAgent

constitution = Constitution.from_template("general")
agent = GovernedAgent(my_agent, constitution=constitution)
result = agent.run("process this request")

Custom Rules

from acgs_lite import Constitution, GovernedAgent, Rule, Severity

constitution = Constitution.from_rules([
    Rule(
        id="NO-PII",
        text="Do not include personally identifiable information",
        severity=Severity.CRITICAL,
        keywords=["ssn", "social security", "passport"],
    ),
    Rule(
        id="NO-HARM",
        text="Do not provide harmful instructions",
        severity=Severity.HIGH,
        keywords=["malware", "exploit"],
    ),
])

agent = GovernedAgent(my_agent, constitution=constitution)
result = agent.run("summarize the report")

YAML Rules

# rules.yaml
rules:
  - id: NO-PII
    text: Never include personally identifiable information
    severity: CRITICAL
    keywords: [ssn, social security, passport]
  - id: NO-MEDICAL-ADVICE
    text: Do not provide specific medical diagnoses
    severity: HIGH
    keywords: [diagnose, prescription, dosage]
from acgs_lite import Constitution, GovernedAgent

constitution = Constitution.from_yaml("rules.yaml")
agent = GovernedAgent(my_agent, constitution=constitution)

MACI Role Separation

from acgs_lite import Constitution, GovernedAgent, MACIRole

constitution = Constitution.from_template("general")
agent = GovernedAgent(
    my_agent,
    constitution=constitution,
    maci_role=MACIRole.PROPOSER,
    enforce_maci=True,
)

result = agent.run("draft deployment plan", governance_action="propose")

Compliance Assessment

from acgs_lite.compliance import MultiFrameworkAssessor

assessor = MultiFrameworkAssessor()
report = assessor.assess(
    {
        "system_id": "claims-triage",
        "jurisdiction": "european_union",
        "domain": "healthcare",
    }
)

print(report.frameworks_assessed)
print(f"Coverage: {report.acgs_lite_total_coverage:.0%}")

HTTP Middleware

from acgs_lite import Constitution
from acgs_lite.middleware import GovernanceASGIMiddleware

constitution = Constitution.from_template("general")
app.add_middleware(
    GovernanceASGIMiddleware,
    constitution=constitution,
    strict=False,
    validate_responses=True,
)

Async Execution

result = await agent.arun("async task")

Key Features

  • Deterministic constitutional validation with YAML rules, regex support, severity levels, merge/diff helpers, and hash verification.
  • MACI role separation with explicit proposer, validator, executor, and observer boundaries.
  • Compliance helpers spanning EU AI Act, NIST AI RMF, ISO 42001, SOC 2 + AI, HIPAA
    • AI, GDPR Article 22, ECOA/FCRA, NYC LL 144, and OECD AI.
  • Tamper-evident audit trails with SHA-256 chain verification and telemetry hooks.
  • Optional integrations for Anthropic, OpenAI, LangChain, LiteLLM, Google GenAI, LlamaIndex, AutoGen, MCP, GitLab CI/CD, A2A, CrewAI, and ASGI/FastAPI servers.
  • Constrained output and remediation-oriented retry flows for stricter production governance.

CLI

acgs init
acgs assess --jurisdiction EU
acgs report --pdf
acgs lint rules.yaml
acgs test --fixtures tests.yaml
acgs eu-ai-act --domain healthcare
acgs refusal "approve deployment"
acgs observe "action" --prometheus

License

AGPL-3.0-or-later. Commercial licensing is available for proprietary or SaaS embedding; 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_lite-2.5.2.tar.gz (895.5 kB view details)

Uploaded Source

Built Distribution

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

acgs_lite-2.5.2-py3-none-any.whl (699.8 kB view details)

Uploaded Python 3

File details

Details for the file acgs_lite-2.5.2.tar.gz.

File metadata

  • Download URL: acgs_lite-2.5.2.tar.gz
  • Upload date:
  • Size: 895.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for acgs_lite-2.5.2.tar.gz
Algorithm Hash digest
SHA256 95e7526bea8d9ee74d2cab4554847d253b975b6564782a2999387c4ed099dc3a
MD5 96aabf84469e7308bdbbfa5de2a39b61
BLAKE2b-256 bcd45ed38b83e768e3dd5ccb87cde31557528a8534c0e069962abef5b88bcb51

See more details on using hashes here.

File details

Details for the file acgs_lite-2.5.2-py3-none-any.whl.

File metadata

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

File hashes

Hashes for acgs_lite-2.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5c683e551ce692f0f966612164ccc8c6cea6e243c66b634f156586445832dbb5
MD5 f683b480fd64f888a13b88f01946266c
BLAKE2b-256 14ce88e47d7a1a2e66c73740023a554b9de341aa9ec2dc803afc41633cd276fd

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