Declarative governance + tool-ontology engine for Agent Runtime control planes — bring your own YAML (Layer 2), get tool governance + semantic query + governance audit (Layer 1).
Project description
openclaw-ontology-engine
Declarative governance + tool-ontology engine for Agent Runtime control planes. Bring your own YAML (Layer 2), get tool governance + semantic query + governance audit + declared-state convergence (Layer 1).
Extracted from a production Agent Runtime (openclaw-model-bridge) that runs 40+ scheduled jobs against a multi-provider LLM gateway — every rule in this engine exists because a real production incident demanded it (90 invariants, 23 meta-rules, 14 silent-failure scanners and counting).
Two-layer architecture
| Layer | What | Who writes it |
|---|---|---|
| Layer 1 — engine (this package) | Tool Ontology engine, 5 check executors, meta-rule discovery (MRD) scanners, convergence framework, three-stage gates | project-agnostic, pip install |
| Layer 2 — config (your repo) | tool_ontology.yaml, governance_ontology.yaml, domain_ontology.yaml, policy_ontology.yaml, convergence_ontology.yaml |
you |
The engine never hardcodes your project: all Layer 2 config is injected via two environment variables.
Quick start
pip install openclaw-ontology-engine
# Point the engine at YOUR config + YOUR project root
export ONTOLOGY_CONFIG_DIR=/path/to/your/ontology
export ONTOLOGY_PROJECT_ROOT=/path/to/your/repo
# Audit your invariants (exit 1 on violation — CI-friendly)
openclaw-ontology-audit
# Query your tool ontology
openclaw-ontology-query
from ontology_engine.engine import ToolOntology, evaluate_policy, find_by_domain
from ontology_engine import governance_checker
onto = ToolOntology() # reads ONTOLOGY_CONFIG_DIR
print(onto.allowed_tools()) # your declared tool whitelist
print(find_by_domain("Actor")) # your domain instances
print(evaluate_policy("max-tools-per-agent")) # your declared policy limits
What you get
- Tool governance — declarative whitelist / schema / alias resolution / semantic classification, replacing hardcoded tool lists.
- Governance audit — invariants with declaration + runtime verification
layers, executed by 5 check types (
file_contains,file_not_contains,python_assert, …). - Meta-rule discovery (MRD) — proactive scanners for whole bug classes
(silent
except: pass, log-to-stdout pollution, push-route bypasses, …) with project patterns supplied viamrd_scan_patternsin your YAML. - Convergence framework — verifies your declared state (job registry, service list) actually matches runtime state (crontab, launchd), with per-spec dry-run/machine-sync escalation.
- Three-stage gates — pre-check / runtime-gate / post-verify policy observation at the request boundary (shadow mode by default).
A complete worked example (a fictional WeatherBot runtime, nothing shared
with the host project) lives in
examples/minimal_consumer/.
Documentation
- Extension guide — 60-second onboarding
- Packaging design — architecture & roadmap
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_ontology_engine-0.1.0.tar.gz.
File metadata
- Download URL: openclaw_ontology_engine-0.1.0.tar.gz
- Upload date:
- Size: 326.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a58c7cde2346077cb8738faaf411547b640aae0a5c3dba00707181071a2a1702
|
|
| MD5 |
63c8b49d1e1abdab38c541a44597e7b4
|
|
| BLAKE2b-256 |
cf157f33e74e9d6e9a47472bdd6ffed24cf349a91990231351a1113959c18845
|
File details
Details for the file openclaw_ontology_engine-0.1.0-py3-none-any.whl.
File metadata
- Download URL: openclaw_ontology_engine-0.1.0-py3-none-any.whl
- Upload date:
- Size: 313.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4aa8f97a9dda1ad9aaa3dcbeb63f325d6103985edc5cedfc1dbfaee17d5f6da8
|
|
| MD5 |
9302c0e711a0c92137b31e9cc5bb4f33
|
|
| BLAKE2b-256 |
cd4fc22a7a415f1db008fceb8dcaf26ff480d70ad36990f04ace83b595a86ae3
|