Explainable autonomous execution policy engine for low-touch, auditable agent execution
English (Primary) | Chinese (Simplified)
- Policy lifecycle:
hint -> candidate -> confirmed -> suspended -> archived - Canonical local storage:
.clawpolicy/policy/ - Policy-first supervision CLI:
clawpolicy policy ... - Stable Python API for confirmation, policy storage, and Markdown conversion/export
- Optional Phase 3 extras remain available through
clawpolicy[phase3]
python3 -m pip install clawpolicyOptional Phase 3 extras:
python3 -m pip install "clawpolicy[phase3]"git clone https://github.com/DZMing/clawpolicy.git
cd clawpolicy
python3 -m pip install -e ".[dev]"clawpolicy: primary console entry pointpython -m clawpolicy: module entry point
Initialize policy memory and inspect the current lifecycle state:
clawpolicy init
clawpolicy analyze
clawpolicy policy status
clawpolicy policy recentinit provisions:
.clawpolicy/policy/rules.json.clawpolicy/policy/playbooks.json.clawpolicy/policy/policy_events.jsonl.clawpolicy/USER.md.clawpolicy/SOUL.md.clawpolicy/AGENTS.md
Low-frequency supervision commands:
clawpolicy policy status
clawpolicy policy recent
clawpolicy policy risky
clawpolicy policy suspended
python -m clawpolicy policy statusThe clawpolicy package exposes the supported policy-facing surface:
from clawpolicy 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
python3 -m pytest tests/ -v
python3 scripts/check_docs_consistency.py
python3 -m ruff check lib tests scripts
python3 -m clawpolicy policy status
clawpolicy policy statuslib/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
lib/distributed_trainer.pylib/hyperparameter_tuner.pylib/monitoring.pylib/performance_optimizer.py
- Total Tests: 183
- 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
- Canonical code and license source:
https://github.com/DZMing/clawpolicy - Canonical repository license:
MIT(seeLICENSEandLICENSE_SOURCE_OF_TRUTH.md) - ClawHub role: distribution/discovery listing, not the authoritative legal source for repository licensing
If any ClawHub listing metadata drifts from the repository, the GitHub repository remains authoritative for code provenance, license, and release truth.
- Versioning: SemVer
- Current release line:
3.x - Release runbook:
RELEASING.md/RELEASING.zh-CN.md - Changelog:
CHANGELOG.md
- 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
MIT