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 == User::"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.

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="...")

Links

License

Apache-2.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

watchlight_langgraph-0.4.0.tar.gz (77.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

watchlight_langgraph-0.4.0-py3-none-any.whl (48.3 kB view details)

Uploaded Python 3

File details

Details for the file watchlight_langgraph-0.4.0.tar.gz.

File metadata

  • Download URL: watchlight_langgraph-0.4.0.tar.gz
  • Upload date:
  • Size: 77.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for watchlight_langgraph-0.4.0.tar.gz
Algorithm Hash digest
SHA256 7f7ebe8ea526d528efafb282368296f0716f1392276681466d92b67f73b1bfcd
MD5 be30ed39bade5f471da70f55b24ed057
BLAKE2b-256 eb52a2c5ab024bdaff5ff5b9d192f338e10cf1e91a85acbbd137d30cd7d35c95

See more details on using hashes here.

Provenance

The following attestation bundles were made for watchlight_langgraph-0.4.0.tar.gz:

Publisher: publish-python-sdk-plugins.yml on watchlight-ai-beacon/watchlight-beacon

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file watchlight_langgraph-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for watchlight_langgraph-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1146dab1a9b4c3b165079fbaf3bca690a061944014feb75adb164abc600109b4
MD5 ca74157f11aafb87846480e6e299e3c1
BLAKE2b-256 380ffcc4d6e4c0efe162d8bb848d215e72303ed631476048baa6fc98e8f3d64b

See more details on using hashes here.

Provenance

The following attestation bundles were made for watchlight_langgraph-0.4.0-py3-none-any.whl:

Publisher: publish-python-sdk-plugins.yml on watchlight-ai-beacon/watchlight-beacon

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page