The in-process authorization engine behind Watchlight Developer Edition.
watchlight-engine lets a Python agent make a real authorization decision — ALLOW / DENY — for a tool call, in-process, with zero infrastructure: no database, no network, no sidecar. It ships as a prebuilt, self-contained compiled wheel.
Most developers want the watchlight package, the Developer Edition with an ergonomic decorator API. This watchlight-engine package is the lower-level engine it embeds — install it directly only if you are building on the engine yourself.
pip install watchlight-engine Prebuilt wheels are provided for Linux (x86_64, aarch64), macOS (Apple Silicon and Intel), and Windows (x64), for CPython 3.9 and newer. No Rust toolchain is required.
import watchlight_engine engine = watchlight_engine.PolicyEngine() assert engine.ready() # Load a policy, then authorize a request — a real decision, in-process. engine.add_policy(policy_json) decision = engine.authorize(request_json) print(decision) # -> Allow / Deny with the governing reason When a policy is refused add_policy refuses a policy whose @enforcement_effect annotation the engine cannot honour: an effect value it does not implement, or an annotation name that is a near miss for enforcement_effect (such as @enforcement_efect). It raises watchlight_engine.PolicyAnnotationError, which is a ValueError, and does not load the policy. The exception has a .code, which is one of watchlight_engine.POLICY_ANNOTATION_ERROR_CODES (UNRECOGNISED_ENFORCEMENT_EFFECT or ENFORCEMENT_EFFECT_NAME_NEAR_MISS), and a .policy_id naming the refused policy. Any other refusal raises a different exception.
try: engine.add_policy(policy_json) except watchlight_engine.PolicyAnnotationError as err: print(err.code, err.policy_id) See the Watchlight documentation for policy and request shapes, and the Developer Edition guide for the full workflow.
The Developer Edition is for building and evaluating locally. The full Watchlight platform adds the governed control plane — centralized policy, tamper-evident lineage and audit, runtime enforcement across your fleet, drift and anomaly detection, secrets brokering, and the operator dashboard. See watchlight.ai to learn more.
The Developer Edition license lets you install and use watchlight-engine free of charge, including in production and commercially. A commercial license is required only to provide the engine itself to third parties as a hosted, managed, or embedded authorization service — contact legal@watchlight.ai. Redistribution, reverse-engineering, and sublicensing are not permitted. See the bundled LICENSE for the full terms.
All 5 files in this release have provenance metadata.
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.
All 5 files in this release have been uploaded with provenance metadata.
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.
Nov 23, 2026 5 release files Full provenance
Oct 25, 2026 5 release files Full provenance
Oct 17, 2026 5 release files Full provenance
Oct 10, 2026 5 release files Full provenance
Sep 12, 2026 5 release files Full provenance
Sep 4, 2026 5 release files Full provenance
Aug 28, 2026 5 release files Full provenance
Aug 18, 2026 5 release files Full provenance




