Public ACGS Lite package for constitutional governance in AI agents. Enforce rules, audit decisions, and prevent self-validation in production.
Project description
acgs-lite
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
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 acgs_lite-2.5.1.tar.gz.
File metadata
- Download URL: acgs_lite-2.5.1.tar.gz
- Upload date:
- Size: 892.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1a1bed065a94bd47076675f94f76f1f0c38a524fe72da35fa04a57620c089bda
|
|
| MD5 |
0d1090c5f988a33d731841ab0ab6f1fb
|
|
| BLAKE2b-256 |
3da5be5829a2fc597a1c49dd5442e272e0638ac25518b3a1bbc0ededc3eb7f8a
|
File details
Details for the file acgs_lite-2.5.1-py3-none-any.whl.
File metadata
- Download URL: acgs_lite-2.5.1-py3-none-any.whl
- Upload date:
- Size: 697.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9f50c5a9b041f1997c1f6f4b0799094e4f8aa841c8bf7c7f7c891b92686e905c
|
|
| MD5 |
1a444a905597d24725a27e3c9fff97e2
|
|
| BLAKE2b-256 |
e0d0dd99038844f0f59c0587801b186e577317dc19115e3119f3193dedc05665
|