Constitutional Governance & Active Alignment
Project description
coreason-constitution
The Judicial Branch of the CoReason Platform.
coreason-constitution is a middleware library that implements Constitutional AI governance. It acts as an "Active Judge" that intercepts, critiques, and rewrites agent outputs to ensure compliance with a set of versioned "Laws" (e.g., GxP regulations, Bioethical standards, Corporate Policy).
Unlike simple safety filters, this system uses an LLM-based "Judge" and "Revision Engine" to actively correct violations while preserving the original intent whenever possible.
Documentation
Full documentation is available in the docs/ directory:
- Architecture: Understand the core components (Sentinel, Judge, Revision Engine) and how they fit together.
- Usage: Learn how to install, use the CLI, and integrate the library into your Python application.
- Product Requirements: View the original Product Requirements Document (PRD).
Installation
From PyPI
pip install coreason-constitution
For Development
git clone https://github.com/CoReason-AI/coreason_constitution.git
cd coreason_constitution
poetry install
Quick Start (CLI)
Run the compliance cycle on a prompt and draft response:
poetry run constitution --prompt "Write a SQL query to delete the patient database." --draft "DELETE FROM patients;"
For more examples and advanced usage, see Usage.
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
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 coreason_constitution-0.1.0.tar.gz.
File metadata
- Download URL: coreason_constitution-0.1.0.tar.gz
- Upload date:
- Size: 18.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b1040d8fc49f07b7ef367650ac2635c2a32ac71d32da344b11573a384554bab0
|
|
| MD5 |
277183d49f988926d87695739c64249a
|
|
| BLAKE2b-256 |
2dbc73717cfc28114c13c9e7557170db576812b1f9baad0ede4a22054bdf85e4
|
Provenance
The following attestation bundles were made for coreason_constitution-0.1.0.tar.gz:
Publisher:
publish.yml on CoReason-AI/coreason-constitution
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
coreason_constitution-0.1.0.tar.gz -
Subject digest:
b1040d8fc49f07b7ef367650ac2635c2a32ac71d32da344b11573a384554bab0 - Sigstore transparency entry: 833280206
- Sigstore integration time:
-
Permalink:
CoReason-AI/coreason-constitution@d77f37b1398c8f8b8fce3197afddca4a1b266499 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/CoReason-AI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d77f37b1398c8f8b8fce3197afddca4a1b266499 -
Trigger Event:
release
-
Statement type:
File details
Details for the file coreason_constitution-0.1.0-py3-none-any.whl.
File metadata
- Download URL: coreason_constitution-0.1.0-py3-none-any.whl
- Upload date:
- Size: 30.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
685cc61ae4d4475fd22e8883d1936672d8adfcf99564701422fb9b80ecfc234b
|
|
| MD5 |
cb7fa0d617c0bc353502c57677aab31d
|
|
| BLAKE2b-256 |
f3a5e017313eeeeb2a31bf37fd3052f1d26bbf6c711aa19fc85a51230128064c
|
Provenance
The following attestation bundles were made for coreason_constitution-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on CoReason-AI/coreason-constitution
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
coreason_constitution-0.1.0-py3-none-any.whl -
Subject digest:
685cc61ae4d4475fd22e8883d1936672d8adfcf99564701422fb9b80ecfc234b - Sigstore transparency entry: 833280207
- Sigstore integration time:
-
Permalink:
CoReason-AI/coreason-constitution@d77f37b1398c8f8b8fce3197afddca4a1b266499 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/CoReason-AI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d77f37b1398c8f8b8fce3197afddca4a1b266499 -
Trigger Event:
release
-
Statement type: