ACGS-2 Core
Cryptographic AI compliance verification in one line of code.
What is ACGS-2?
ACGS-2 (Adaptive Constitutional Governance System) provides cryptographic proof of AI compliance, not just logs.
from acgs2_core import verify
result = verify("Your AI output here")
print(result.compliant) # True
print(result.proof_hash) # cdd01ef066bc6cf2a1b2c3d4...
One line of code. Provable compliance. Sub-millisecond latency.
Installation
pip install acgs2-core
Zero dependencies. Pure Python. Works everywhere.
Quick Start
Basic Verification
from acgs2_core import verify
# Verify AI output
result = verify("The weather today is sunny and 72°F.")
if result.compliant:
print(f"✓ Compliant | Proof: {result.proof_hash[:16]}...")
else:
for violation in result.violations:
print(f"✗ {violation.rule_id}: {violation.description}")
Check for PII Leakage
from acgs2_core import verify
# This will detect SSN patterns
result = verify("Contact John at 123-45-6789 for more info.")
print(result.compliant) # False
print(result.violations[0].rule_id) # "no-ssn"
print(result.violations[0].severity) # "critical"
Custom Policies
from acgs2_core import Validator, Policy, PolicyType
validator = Validator()
# Add custom policy
validator.add_policy(Policy(
id="no-competitor-names",
name="No Competitor Mentions",
description="Prevent mentioning competitor names",
policy_type=PolicyType.PATTERN,
rule=r"\b(CompetitorA|CompetitorB)\b",
severity="medium"
))
result = validator.verify("Our product is better than CompetitorA.")
print(result.compliant) # False (or True in non-strict mode)
Strict Mode
from acgs2_core import Validator
# Strict mode: any violation = non-compliant
validator = Validator(strict_mode=True)
result = validator.verify("Call me at 555-1234") # Phone number detected
print(result.compliant) # False (medium severity, but strict mode)
Features
| Feature | Description |
|---|---|
| Cryptographic Proofs | SHA-256 hashes anchored to constitutional hash |
| PII Detection | SSN, credit cards, emails, phone numbers |
| Custom Policies | Regex patterns or custom functions |
| Sub-ms Latency | Designed for real-time verification |
| Zero Dependencies | Pure Python, no bloat |
| Type Hints | Full typing support |
Built-in Policies
| Policy ID | Description | Severity |
|---|---|---|
no-ssn |
Social Security Numbers | critical |
no-credit-card |
Credit card numbers | critical |
no-email-leak |
Email addresses | high |
no-phone |
Phone numbers | medium |
no-harmful-content |
Harmful keywords | high |
API Reference
verify(content, context=None, policies=None)
Quick verification using default validator.
result = verify("content to check")
Validator
Full-featured validator with customization.
validator = Validator(
include_default_policies=True,
strict_mode=False
)
VerificationResult
Result object with all verification details.
result.compliant # bool
result.proof_hash # str
result.constitutional_anchor # str ("cdd01ef066bc6cf2")
result.timestamp # datetime
result.latency_ms # float
result.violations # List[Violation]
result.metadata # Dict
The Story Behind ACGS-2
This project was built from scratch over 2 years by a solo developer who started with zero coding experience.
622,000+ lines of code. 52 integrated systems. Sub-millisecond latency.
Enterprise Version
Need more features?
- Blockchain anchoring (Ethereum, Solana, Arweave)
- Multi-agent verification (MACI framework)
- Real-time semantic analysis
- Compliance certifications (SOC2, HIPAA, EU AI Act)
- SLA & dedicated support
Contributing
Contributions welcome! See CONTRIBUTING.md
# Setup development environment
git clone https://github.com/acgs2/acgs2-core.git
cd acgs2-core
pip install -e ".[dev]"
pytest
License
MIT License - Use it however you want.
Links
Constitutional Hash: cdd01ef066bc6cf2
Built with obsession. Shared with hope.
Metadata
Release files for acgs2-core 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| acgs2_core-0.1.0.tar.gz | 18.9 kB | Without provenance | Details for acgs2_core-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| acgs2_core-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for acgs2_core-0.1.0-py3-none-any.whl |
Total release size: 39.2 kB
Release files / acgs2_core-0.1.0.tar.gz
| Download URL | acgs2_core-0.1.0.tar.gz |
|---|---|
| Size | 18.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
921b4bbd92c92f80656173b34d63686dcc79c59492dbaa7825dcf39851fccaf2
|
|
BLAKE2b-256 checksum How to use checksums |
ba33a0d80552b87f2ce8e352358d7b9bf960b301f6580421913b5ec63dd1a857
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / acgs2_core-0.1.0-py3-none-any.whl
| Download URL | acgs2_core-0.1.0-py3-none-any.whl |
|---|---|
| Size | 20.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6f4a4c7af30053534af9ec244ed9628809c9f729be293df2545737cc9e1d93c1
|
|
BLAKE2b-256 checksum How to use checksums |
2a4b96fb6113c61f10696919c6409207e9faa2029b770250693d8da1792a7879
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Security for acgs2-core 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.