watchlight-langgraph 0.4.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- watchlight_langgraph-0.4.0/PKG-INFO +97 -0
- watchlight_langgraph-0.4.0/README.md +77 -0
- watchlight_langgraph-0.4.0/pyproject.toml +35 -0
- watchlight_langgraph-0.4.0/setup.cfg +4 -0
- watchlight_langgraph-0.4.0/tests/test_callbacks.py +490 -0
- watchlight_langgraph-0.4.0/tests/test_conformance.py +115 -0
- watchlight_langgraph-0.4.0/tests/test_declare_intent_injection.py +441 -0
- watchlight_langgraph-0.4.0/tests/test_governance_backend_injection.py +19 -0
- watchlight_langgraph-0.4.0/tests/test_integration_real_langgraph.py +208 -0
- watchlight_langgraph-0.4.0/tests/test_intent_extraction.py +288 -0
- watchlight_langgraph-0.4.0/tests/test_lineage_single_root_execution_id.py +273 -0
- watchlight_langgraph-0.4.0/tests/test_no_double_lifecycle.py +254 -0
- watchlight_langgraph-0.4.0/tests/test_observation_source.py +66 -0
- watchlight_langgraph-0.4.0/tests/test_plugin.py +475 -0
- watchlight_langgraph-0.4.0/tests/test_quarantine_kill_signal.py +140 -0
- watchlight_langgraph-0.4.0/tests/test_sidecar_wiring.py +126 -0
- watchlight_langgraph-0.4.0/tests/test_subagent_spawn_propagation.py +259 -0
- watchlight_langgraph-0.4.0/tests/test_traces.py +594 -0
- watchlight_langgraph-0.4.0/watchlight_langgraph/__init__.py +78 -0
- watchlight_langgraph-0.4.0/watchlight_langgraph/apdp_client.py +13 -0
- watchlight_langgraph-0.4.0/watchlight_langgraph/callbacks.py +834 -0
- watchlight_langgraph-0.4.0/watchlight_langgraph/governance.py +216 -0
- watchlight_langgraph-0.4.0/watchlight_langgraph/intent.py +237 -0
- watchlight_langgraph-0.4.0/watchlight_langgraph/plugin.py +1312 -0
- watchlight_langgraph-0.4.0/watchlight_langgraph/state_adapter.py +26 -0
- watchlight_langgraph-0.4.0/watchlight_langgraph/synthetic_tools.py +318 -0
- watchlight_langgraph-0.4.0/watchlight_langgraph/traces.py +715 -0
- watchlight_langgraph-0.4.0/watchlight_langgraph.egg-info/PKG-INFO +97 -0
- watchlight_langgraph-0.4.0/watchlight_langgraph.egg-info/SOURCES.txt +30 -0
- watchlight_langgraph-0.4.0/watchlight_langgraph.egg-info/dependency_links.txt +1 -0
- watchlight_langgraph-0.4.0/watchlight_langgraph.egg-info/requires.txt +7 -0
- watchlight_langgraph-0.4.0/watchlight_langgraph.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: watchlight-langgraph
|
|
3
|
+
Version: 0.4.0
|
|
4
|
+
Summary: Governed LangGraph agents with Watchlight — authorize every agent action, fail-closed, with zero infrastructure.
|
|
5
|
+
Author-email: Watchlight AI <team@watchlight.ai>
|
|
6
|
+
License: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://watchlight.ai
|
|
8
|
+
Project-URL: Documentation, https://docs.watchlight.ai/de
|
|
9
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Requires-Python: >=3.10
|
|
13
|
+
Description-Content-Type: text/markdown
|
|
14
|
+
Requires-Dist: httpx>=0.27
|
|
15
|
+
Requires-Dist: langgraph>=0.2
|
|
16
|
+
Requires-Dist: watchlight-agent-sdk>=0.5.1
|
|
17
|
+
Provides-Extra: dev
|
|
18
|
+
Requires-Dist: pytest>=7; extra == "dev"
|
|
19
|
+
Requires-Dist: pytest-asyncio>=0.21; extra == "dev"
|
|
20
|
+
|
|
21
|
+
# watchlight-langgraph
|
|
22
|
+
|
|
23
|
+
Governed LangGraph agents with Watchlight — authorize every agent action, fail-closed, with zero infrastructure.
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
pip install watchlight-langgraph
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
> **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.
|
|
30
|
+
|
|
31
|
+
## What it does
|
|
32
|
+
|
|
33
|
+
`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.
|
|
34
|
+
|
|
35
|
+
## Quickstart
|
|
36
|
+
|
|
37
|
+
Point the plugin at a backend and wrap your run. Your agent code doesn't change — only the backend does.
|
|
38
|
+
|
|
39
|
+
For local development, the zero-infrastructure **Developer Edition** runs the compiled engine in-process (requires the `watchlight-engine` package):
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
pip install watchlight-langgraph watchlight-engine
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
```python
|
|
46
|
+
from watchlight_langgraph import WatchlightLangGraphPlugin
|
|
47
|
+
from watchlight_core import InProcessClient
|
|
48
|
+
|
|
49
|
+
# A Cedar policy: the research agent may read, nothing else.
|
|
50
|
+
POLICIES = [
|
|
51
|
+
{"name": "reader",
|
|
52
|
+
"code": 'permit(principal == User::"research-agent", action == Action::"read", resource);'},
|
|
53
|
+
]
|
|
54
|
+
|
|
55
|
+
plugin = WatchlightLangGraphPlugin()
|
|
56
|
+
plugin.apdp = InProcessClient(POLICIES) # decisions run in-process, no server, no network
|
|
57
|
+
|
|
58
|
+
async def run_agent(question: str):
|
|
59
|
+
async with await plugin.start_run(agent_slug="research-agent") as handle:
|
|
60
|
+
# Validate a multi-step plan ahead of execution (Allow / Modify / Deny).
|
|
61
|
+
result = await handle.submit_plan(["read dataset", "summarize"])
|
|
62
|
+
if result.is_deny():
|
|
63
|
+
raise PermissionError(f"Plan denied: {result.violations}")
|
|
64
|
+
|
|
65
|
+
# Gate each action authoritatively. Returns True on Allow, False on Deny.
|
|
66
|
+
if not await handle.authorize_action("read", "dataset"):
|
|
67
|
+
raise PermissionError("Denied by policy")
|
|
68
|
+
|
|
69
|
+
# ... your LangGraph agent runs, every action governed ...
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
`authorize_action` fails closed: a denial — or an unreachable backend — returns `False`, so the action never runs.
|
|
73
|
+
|
|
74
|
+
## Two backends, same code
|
|
75
|
+
|
|
76
|
+
| | Backend | Runs |
|
|
77
|
+
|---|---|---|
|
|
78
|
+
| **Developer Edition** | `InProcessClient` | The compiled engine, **in-process** — no server, no network |
|
|
79
|
+
| **Enterprise** | `ApdpClient` | The governed control plane — signed lineage, drift detection, fleet-wide governance |
|
|
80
|
+
|
|
81
|
+
Moving from local to production is a one-line change:
|
|
82
|
+
|
|
83
|
+
```python
|
|
84
|
+
from watchlight_core import ApdpClient
|
|
85
|
+
|
|
86
|
+
plugin = WatchlightLangGraphPlugin()
|
|
87
|
+
plugin.apdp = ApdpClient("https://apdp.your-company.example", api_key="...")
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Links
|
|
91
|
+
|
|
92
|
+
- Documentation: https://docs.watchlight.ai/de
|
|
93
|
+
- Website: https://watchlight.ai
|
|
94
|
+
|
|
95
|
+
## License
|
|
96
|
+
|
|
97
|
+
Apache-2.0
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# watchlight-langgraph
|
|
2
|
+
|
|
3
|
+
Governed LangGraph agents with Watchlight — authorize every agent action, fail-closed, with zero infrastructure.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
pip install watchlight-langgraph
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
> **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.
|
|
10
|
+
|
|
11
|
+
## What it does
|
|
12
|
+
|
|
13
|
+
`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.
|
|
14
|
+
|
|
15
|
+
## Quickstart
|
|
16
|
+
|
|
17
|
+
Point the plugin at a backend and wrap your run. Your agent code doesn't change — only the backend does.
|
|
18
|
+
|
|
19
|
+
For local development, the zero-infrastructure **Developer Edition** runs the compiled engine in-process (requires the `watchlight-engine` package):
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
pip install watchlight-langgraph watchlight-engine
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
```python
|
|
26
|
+
from watchlight_langgraph import WatchlightLangGraphPlugin
|
|
27
|
+
from watchlight_core import InProcessClient
|
|
28
|
+
|
|
29
|
+
# A Cedar policy: the research agent may read, nothing else.
|
|
30
|
+
POLICIES = [
|
|
31
|
+
{"name": "reader",
|
|
32
|
+
"code": 'permit(principal == User::"research-agent", action == Action::"read", resource);'},
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
plugin = WatchlightLangGraphPlugin()
|
|
36
|
+
plugin.apdp = InProcessClient(POLICIES) # decisions run in-process, no server, no network
|
|
37
|
+
|
|
38
|
+
async def run_agent(question: str):
|
|
39
|
+
async with await plugin.start_run(agent_slug="research-agent") as handle:
|
|
40
|
+
# Validate a multi-step plan ahead of execution (Allow / Modify / Deny).
|
|
41
|
+
result = await handle.submit_plan(["read dataset", "summarize"])
|
|
42
|
+
if result.is_deny():
|
|
43
|
+
raise PermissionError(f"Plan denied: {result.violations}")
|
|
44
|
+
|
|
45
|
+
# Gate each action authoritatively. Returns True on Allow, False on Deny.
|
|
46
|
+
if not await handle.authorize_action("read", "dataset"):
|
|
47
|
+
raise PermissionError("Denied by policy")
|
|
48
|
+
|
|
49
|
+
# ... your LangGraph agent runs, every action governed ...
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
`authorize_action` fails closed: a denial — or an unreachable backend — returns `False`, so the action never runs.
|
|
53
|
+
|
|
54
|
+
## Two backends, same code
|
|
55
|
+
|
|
56
|
+
| | Backend | Runs |
|
|
57
|
+
|---|---|---|
|
|
58
|
+
| **Developer Edition** | `InProcessClient` | The compiled engine, **in-process** — no server, no network |
|
|
59
|
+
| **Enterprise** | `ApdpClient` | The governed control plane — signed lineage, drift detection, fleet-wide governance |
|
|
60
|
+
|
|
61
|
+
Moving from local to production is a one-line change:
|
|
62
|
+
|
|
63
|
+
```python
|
|
64
|
+
from watchlight_core import ApdpClient
|
|
65
|
+
|
|
66
|
+
plugin = WatchlightLangGraphPlugin()
|
|
67
|
+
plugin.apdp = ApdpClient("https://apdp.your-company.example", api_key="...")
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Links
|
|
71
|
+
|
|
72
|
+
- Documentation: https://docs.watchlight.ai/de
|
|
73
|
+
- Website: https://watchlight.ai
|
|
74
|
+
|
|
75
|
+
## License
|
|
76
|
+
|
|
77
|
+
Apache-2.0
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68.0", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "watchlight-langgraph"
|
|
7
|
+
version = "0.4.0"
|
|
8
|
+
description = "Governed LangGraph agents with Watchlight — authorize every agent action, fail-closed, with zero infrastructure."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = {text = "Apache-2.0"}
|
|
11
|
+
requires-python = ">=3.10"
|
|
12
|
+
authors = [
|
|
13
|
+
{name = "Watchlight AI", email = "team@watchlight.ai"},
|
|
14
|
+
]
|
|
15
|
+
classifiers = [
|
|
16
|
+
"License :: OSI Approved :: Apache Software License",
|
|
17
|
+
"Intended Audience :: Developers",
|
|
18
|
+
"Programming Language :: Python :: 3",
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
dependencies = [
|
|
22
|
+
"httpx>=0.27",
|
|
23
|
+
"langgraph>=0.2",
|
|
24
|
+
"watchlight-agent-sdk>=0.5.1",
|
|
25
|
+
]
|
|
26
|
+
|
|
27
|
+
[project.optional-dependencies]
|
|
28
|
+
dev = ["pytest>=7", "pytest-asyncio>=0.21"]
|
|
29
|
+
|
|
30
|
+
[project.urls]
|
|
31
|
+
Homepage = "https://watchlight.ai"
|
|
32
|
+
Documentation = "https://docs.watchlight.ai/de"
|
|
33
|
+
|
|
34
|
+
[tool.setuptools.packages.find]
|
|
35
|
+
include = ["watchlight_langgraph*"]
|