Skip to main content

watchlight-langgraph

Governed LangGraph agents with Watchlight — authorize every agent action, fail-closed, with zero infrastructure.

pip install watchlight-langgraph

Independent third-party plugin. This is an independent integration built by Watchlight AI. It is not affiliated with, endorsed by, or sponsored by LangChain. LangGraph and related names are trademarks of LangChain, used here nominatively only to describe compatibility.

What it does

watchlight-langgraph puts a Watchlight authorization decision in front of every action your LangGraph agent takes — tool calls, plan steps, and sub-agent spawns — so each one is allowed, modified, or denied before it runs. It's open-source glue: a thin, framework-specific layer that threads Watchlight's governance primitives into your graph topology. The actual policy decisions run on Watchlight's compiled engine, either in-process for local development or against the governed control plane in production.

Quickstart

Point the plugin at a backend and wrap your run. Your agent code doesn't change — only the backend does.

For local development, the zero-infrastructure Developer Edition runs the compiled engine in-process (requires the watchlight-engine package):

pip install watchlight-langgraph watchlight-engine
from watchlight_langgraph import WatchlightLangGraphPlugin
from watchlight_core import InProcessClient

# A Cedar policy: the research agent may read, nothing else.
POLICIES = [
    {"name": "reader",
     "code": 'permit(principal == Agent::"research-agent", action == Action::"read", resource);'},
]

plugin = WatchlightLangGraphPlugin()
plugin.apdp = InProcessClient(POLICIES)   # decisions run in-process, no server, no network

async def run_agent(question: str):
    async with await plugin.start_run(agent_slug="research-agent") as handle:
        # Validate a multi-step plan ahead of execution (Allow / Modify / Deny).
        result = await handle.submit_plan(["read dataset", "summarize"])
        if result.is_deny():
            raise PermissionError(f"Plan denied: {result.violations}")

        # Gate each action authoritatively. Returns True on Allow, False on Deny.
        if not await handle.authorize_action("read", "dataset"):
            raise PermissionError("Denied by policy")

        # ... your LangGraph agent runs, every action governed ...

authorize_action fails closed: a denial — or an unreachable backend — returns False, so the action never runs.

Attributing runs to an AI application

Every governed run can be attributed to the AI application the agent belongs to. Pass application_id="<application UUID>" to WatchlightLangGraphPlugin(...), or per run to start_run(...), or set WATCHLIGHT_APPLICATION_ID in the environment — an explicit argument wins over the env var. The id is sent on session create and bound to the run credential and to every sub-agent the run spawns; wl-apdp refuses the session if the agent is not a member of that application. An agent in exactly one application needs nothing here. The id is explicit configuration, never inferred from prompts or names, and it is an Enterprise feature: the in-process Developer Edition engine refuses it.

Two backends, same code

Backend Runs
Developer Edition InProcessClient The compiled engine, in-process — no server, no network
Enterprise ApdpClient The governed control plane — signed lineage, drift detection, fleet-wide governance

Moving from local to production is a one-line change:

from watchlight_core import ApdpClient

plugin = WatchlightLangGraphPlugin()
plugin.apdp = ApdpClient("https://apdp.your-company.example", api_key="...")

License

Apache-2.0

Metadata

Release files for watchlight-langgraph 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for watchlight-langgraph 0.4.1
File Size Uploaded
watchlight_langgraph-0.4.1.tar.gz 89.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for watchlight-langgraph 0.4.1
File Interpreter ABI Platform
watchlight_langgraph-0.4.1-py3-none-any.whl Python 3 none any Details

Total release size: 143.7 kB

Release files / watchlight_langgraph-0.4.1.tar.gz

Download URL watchlight_langgraph-0.4.1.tar.gz
Size 89.6 kB
Tags Source
SHA-256 checksum
How to use checksums
2a52c0be637db09be4d041df0e74c999cbec3f32ac85854d9e6a56210a52efed
BLAKE2b-256 checksum
How to use checksums
593a6712b42b99bfbf77bb5917094fcd7e710b7740cfbfa57db0cd018f9fc85f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

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 Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 5, 2026.

Transparency log

Release files / watchlight_langgraph-0.4.1-py3-none-any.whl

Download URL watchlight_langgraph-0.4.1-py3-none-any.whl
Size 54.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9966acd3fbb386f71e81a245965e934b169286b5f848fec84783cbea76a277a7
BLAKE2b-256 checksum
How to use checksums
3be341cc958edc9f3b92a9390aa3623362133a3e673a617fc9282c590e0ddbf0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

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 Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 5, 2026.

Transparency log

Release history Release notifications | RSS feed

0.4.2

2 release files

This release

0.4.1 This release

2 release files

0.4.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page