Explainable autonomous execution policy engine for OpenClaw workflows
Project description
OpenClaw Alignment
Explainable autonomous execution policy engine for low-touch, auditable agent execution
English (Primary) | Chinese (Simplified)
2.0.0 Highlights
- Policy lifecycle:
hint -> candidate -> confirmed -> suspended -> archived - Canonical local storage:
.openclaw_memory/policy/ - Policy-first supervision CLI:
openclaw-align policy ... - Stable Python API for confirmation, policy storage, and Markdown conversion/export
- Optional Phase 3 extras remain available through
openclaw-alignment[phase3]
Installation
PyPI
python3 -m pip install openclaw-alignment
Optional Phase 3 extras:
python3 -m pip install "openclaw-alignment[phase3]"
Source checkout
git clone https://github.com/412984588/openclaw-alignment.git
cd openclaw-alignment
python3 -m pip install -e ".[dev]"
CLI Entry Points
openclaw-align: primary console entry pointopenclaw-alignment: compatibility console aliaspython -m openclaw_align: module entry point
Initialize policy memory and inspect the current lifecycle state:
openclaw-align init
openclaw-align analyze
openclaw-align policy status
openclaw-align policy recent
init provisions:
.openclaw_memory/policy/rules.json.openclaw_memory/policy/playbooks.json.openclaw_memory/policy/policy_events.jsonl.openclaw_memory/USER.md.openclaw_memory/SOUL.md.openclaw_memory/AGENTS.md
Low-frequency supervision commands:
openclaw-align policy status
openclaw-align policy recent
openclaw-align policy risky
openclaw-align policy suspended
python -m openclaw_align policy status
Public Python API
The lib package exposes the supported policy-facing surface:
from lib import (
ConfirmationAPI,
PolicyEvent,
PolicyStore,
Playbook,
Rule,
MarkdownToPolicyConverter,
PolicyToMarkdownExporter,
create_api,
)
ConfirmationAPI/create_api: runtime confirmation and feedback loop integrationPolicyStore: canonical policy asset persistenceRule,Playbook,PolicyEvent: public policy modelsMarkdownToPolicyConverter: convert Markdown memory into policy assetsPolicyToMarkdownExporter: export canonical policy assets back to Markdown
Verification
python3 -m pytest tests/ -v
python3 scripts/check_docs_consistency.py
python3 -m ruff check lib tests scripts
python3 -m openclaw_align policy status
openclaw-align policy status
Core Modules
lib/policy_models.py: canonicalRule,Playbook, andPolicyEventmodelslib/policy_store.py: canonicalPolicyStoreand policy asset persistencelib/policy_resolution.py: scope inference and precedence resolutionlib/confirmation.py: runtime truth loop, event recording, and feedback applicationlib/promotion.py: promotion gates forcandidate -> confirmedlib/demotion.py: suspension, reactivation, and archive gateslib/learner.py: weak-hint derivation and strong-evidence aggregationlib/api.py: stable confirmation API surfacelib/cli.py: initialization, status, supervision, export, and inspection commandslib/environment.py: interaction environmentState: State data class (17 dimensions)Action: Action data class (11 dimensions)
lib/contracts.py: single source of truth for state and action dimensions
Optional Phase 3 Modules
lib/distributed_trainer.pylib/hyperparameter_tuner.pylib/monitoring.pylib/performance_optimizer.py
Test Coverage
- Total Tests: 169
- Local Validation:
python3 -m pytest tests/ -v - Coverage Areas: policy lifecycle promotion and suspension, scope precedence, public surface hard cut, canonical policy storage, CLI supervision, confirmation policy, RL core, optional Phase 3 modules, and docs/contract drift guards
Release and Versioning
- Versioning: SemVer
- Current release line:
2.x - Release runbook:
RELEASING.md/RELEASING.zh-CN.md - Changelog:
CHANGELOG.md
Documentation
- Architecture:
docs/architecture.md - Reward model:
docs/reward-model.md - Configuration:
docs/configuration.md - Optional dependencies:
docs/phase3-optional-deps.md - Contributing:
CONTRIBUTING.md - Security:
SECURITY.md - Support:
SUPPORT.md
License
MIT
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 openclaw_alignment-2.0.0.tar.gz.
File metadata
- Download URL: openclaw_alignment-2.0.0.tar.gz
- Upload date:
- Size: 219.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
10c8140bde4167a1e30e9522e8d1d78b163040d88af0904e5f089654841224d8
|
|
| MD5 |
1470c97603b9e465140ef461bd3e9189
|
|
| BLAKE2b-256 |
a7dc90a9cd1f7b6a1d3c1b8e3be30eabe38777506d70738477ebc9b13ab66f57
|
File details
Details for the file openclaw_alignment-2.0.0-py3-none-any.whl.
File metadata
- Download URL: openclaw_alignment-2.0.0-py3-none-any.whl
- Upload date:
- Size: 90.1 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 |
ee2cff49c913d22440634969546a2fe76533eb01469cca4aae1c3a91ee97f81f
|
|
| MD5 |
aaa91d8621bc1b8271b805b8a866489a
|
|
| BLAKE2b-256 |
90e9c57b4ae507cb5d4c87b76ec16f113a83764a22cb210f77579aa102ceb966
|