Cryptographic AI compliance verification in one line of code. Zero dependencies.
Project description
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.
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 acgs2_core-0.1.0.tar.gz.
File metadata
- Download URL: acgs2_core-0.1.0.tar.gz
- Upload date:
- Size: 18.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
921b4bbd92c92f80656173b34d63686dcc79c59492dbaa7825dcf39851fccaf2
|
|
| MD5 |
4c77c77f90a6ef69f3a0301fda6c76ca
|
|
| BLAKE2b-256 |
ba33a0d80552b87f2ce8e352358d7b9bf960b301f6580421913b5ec63dd1a857
|
File details
Details for the file acgs2_core-0.1.0-py3-none-any.whl.
File metadata
- Download URL: acgs2_core-0.1.0-py3-none-any.whl
- Upload date:
- Size: 20.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6f4a4c7af30053534af9ec244ed9628809c9f729be293df2545737cc9e1d93c1
|
|
| MD5 |
d3fd77aec5c5593c49c8201d54b36e43
|
|
| BLAKE2b-256 |
2a4b96fb6113c61f10696919c6409207e9faa2029b770250693d8da1792a7879
|