Skip to main content

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

coreason_constitution-0.1.0.tar.gz (18.1 kB view details)

Uploaded Source

Built Distribution

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

coreason_constitution-0.1.0-py3-none-any.whl (30.0 kB view details)

Uploaded Python 3

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

Hashes for coreason_constitution-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b1040d8fc49f07b7ef367650ac2635c2a32ac71d32da344b11573a384554bab0
MD5 277183d49f988926d87695739c64249a
BLAKE2b-256 2dbc73717cfc28114c13c9e7557170db576812b1f9baad0ede4a22054bdf85e4

See more details on using hashes here.

Provenance

The following attestation bundles were made for coreason_constitution-0.1.0.tar.gz:

Publisher: publish.yml on CoReason-AI/coreason-constitution

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file coreason_constitution-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for coreason_constitution-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 685cc61ae4d4475fd22e8883d1936672d8adfcf99564701422fb9b80ecfc234b
MD5 cb7fa0d617c0bc353502c57677aab31d
BLAKE2b-256 f3a5e017313eeeeb2a31bf37fd3052f1d26bbf6c711aa19fc85a51230128064c

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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