vouch-langgraph 0.1.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.
- vouch_langgraph-0.1.0/PKG-INFO +69 -0
- vouch_langgraph-0.1.0/README.md +53 -0
- vouch_langgraph-0.1.0/pyproject.toml +24 -0
- vouch_langgraph-0.1.0/setup.cfg +4 -0
- vouch_langgraph-0.1.0/src/vouch_langgraph/__init__.py +11 -0
- vouch_langgraph-0.1.0/src/vouch_langgraph.egg-info/PKG-INFO +69 -0
- vouch_langgraph-0.1.0/src/vouch_langgraph.egg-info/SOURCES.txt +9 -0
- vouch_langgraph-0.1.0/src/vouch_langgraph.egg-info/dependency_links.txt +1 -0
- vouch_langgraph-0.1.0/src/vouch_langgraph.egg-info/requires.txt +5 -0
- vouch_langgraph-0.1.0/src/vouch_langgraph.egg-info/top_level.txt +1 -0
- vouch_langgraph-0.1.0/tests/test_smoke.py +61 -0
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: vouch-langgraph
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Sign LangGraph tool calls and graph nodes with Vouch Credentials.
|
|
5
|
+
Author: Ramprasad Gaddam
|
|
6
|
+
License: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://vouch-protocol.com
|
|
8
|
+
Project-URL: Source, https://github.com/vouch-protocol/vouch
|
|
9
|
+
Keywords: langgraph,langchain,vouch,ai-agents,verifiable-credentials,identity
|
|
10
|
+
Requires-Python: >=3.9
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
Requires-Dist: vouch-protocol>=1.6.0
|
|
13
|
+
Requires-Dist: langgraph>=0.1.0
|
|
14
|
+
Provides-Extra: dev
|
|
15
|
+
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
16
|
+
|
|
17
|
+
# vouch-langgraph
|
|
18
|
+
|
|
19
|
+
Sign every LangGraph tool call and graph node with a Vouch Credential, so an
|
|
20
|
+
agent's actions carry a verifiable record of who ran them and on whose authority.
|
|
21
|
+
|
|
22
|
+
LangGraph tools are LangChain tools, so tool-level signing is shared with the
|
|
23
|
+
LangChain integration. On top of that, `sign_node` signs each node step, giving
|
|
24
|
+
a signed trail across the whole graph.
|
|
25
|
+
|
|
26
|
+
## Install
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
pip install vouch-langgraph
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Sign the tools
|
|
33
|
+
|
|
34
|
+
```python
|
|
35
|
+
from langgraph.prebuilt import create_react_agent
|
|
36
|
+
from vouch.integrations.langgraph import protect
|
|
37
|
+
|
|
38
|
+
agent = create_react_agent(llm, tools=protect([search, send_email]))
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Every tool call is now signed in Python before it runs.
|
|
42
|
+
|
|
43
|
+
## Sign each node
|
|
44
|
+
|
|
45
|
+
```python
|
|
46
|
+
from vouch.integrations.langgraph import sign_node
|
|
47
|
+
|
|
48
|
+
@sign_node
|
|
49
|
+
def plan(state):
|
|
50
|
+
...
|
|
51
|
+
|
|
52
|
+
@sign_node(action="charge_card")
|
|
53
|
+
def bill(state):
|
|
54
|
+
...
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Each node step issues its own credential. Verify anywhere with
|
|
58
|
+
`vouch.Verifier.verify_credential`, or read the latest with
|
|
59
|
+
`vouch.autosign.current_credential`.
|
|
60
|
+
|
|
61
|
+
## Identity
|
|
62
|
+
|
|
63
|
+
`protect` and `sign_node` use the ambient Vouch identity, or a `signer=` you
|
|
64
|
+
pass in. Provision one with `vouch init --yes`, or construct a `Signer`
|
|
65
|
+
directly. See the [Vouch Protocol docs](https://vouch-protocol.com).
|
|
66
|
+
|
|
67
|
+
## License
|
|
68
|
+
|
|
69
|
+
Apache-2.0. Part of the [Vouch Protocol](https://github.com/vouch-protocol/vouch).
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# vouch-langgraph
|
|
2
|
+
|
|
3
|
+
Sign every LangGraph tool call and graph node with a Vouch Credential, so an
|
|
4
|
+
agent's actions carry a verifiable record of who ran them and on whose authority.
|
|
5
|
+
|
|
6
|
+
LangGraph tools are LangChain tools, so tool-level signing is shared with the
|
|
7
|
+
LangChain integration. On top of that, `sign_node` signs each node step, giving
|
|
8
|
+
a signed trail across the whole graph.
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
pip install vouch-langgraph
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Sign the tools
|
|
17
|
+
|
|
18
|
+
```python
|
|
19
|
+
from langgraph.prebuilt import create_react_agent
|
|
20
|
+
from vouch.integrations.langgraph import protect
|
|
21
|
+
|
|
22
|
+
agent = create_react_agent(llm, tools=protect([search, send_email]))
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Every tool call is now signed in Python before it runs.
|
|
26
|
+
|
|
27
|
+
## Sign each node
|
|
28
|
+
|
|
29
|
+
```python
|
|
30
|
+
from vouch.integrations.langgraph import sign_node
|
|
31
|
+
|
|
32
|
+
@sign_node
|
|
33
|
+
def plan(state):
|
|
34
|
+
...
|
|
35
|
+
|
|
36
|
+
@sign_node(action="charge_card")
|
|
37
|
+
def bill(state):
|
|
38
|
+
...
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Each node step issues its own credential. Verify anywhere with
|
|
42
|
+
`vouch.Verifier.verify_credential`, or read the latest with
|
|
43
|
+
`vouch.autosign.current_credential`.
|
|
44
|
+
|
|
45
|
+
## Identity
|
|
46
|
+
|
|
47
|
+
`protect` and `sign_node` use the ambient Vouch identity, or a `signer=` you
|
|
48
|
+
pass in. Provision one with `vouch init --yes`, or construct a `Signer`
|
|
49
|
+
directly. See the [Vouch Protocol docs](https://vouch-protocol.com).
|
|
50
|
+
|
|
51
|
+
## License
|
|
52
|
+
|
|
53
|
+
Apache-2.0. Part of the [Vouch Protocol](https://github.com/vouch-protocol/vouch).
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "vouch-langgraph"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Sign LangGraph tool calls and graph nodes with Vouch Credentials."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.9"
|
|
11
|
+
license = { text = "Apache-2.0" }
|
|
12
|
+
authors = [{ name = "Ramprasad Gaddam" }]
|
|
13
|
+
keywords = ["langgraph", "langchain", "vouch", "ai-agents", "verifiable-credentials", "identity"]
|
|
14
|
+
dependencies = ["vouch-protocol>=1.6.0", "langgraph>=0.1.0"]
|
|
15
|
+
|
|
16
|
+
[project.optional-dependencies]
|
|
17
|
+
dev = ["pytest>=7.0"]
|
|
18
|
+
|
|
19
|
+
[project.urls]
|
|
20
|
+
Homepage = "https://vouch-protocol.com"
|
|
21
|
+
Source = "https://github.com/vouch-protocol/vouch"
|
|
22
|
+
|
|
23
|
+
[tool.setuptools.packages.find]
|
|
24
|
+
where = ["src"]
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"""vouch-langgraph: sign LangGraph tool calls and graph nodes with Vouch.
|
|
2
|
+
|
|
3
|
+
Thin distribution wrapping ``vouch.integrations.langgraph``. It exists so the
|
|
4
|
+
integration can be installed and listed on its own while the implementation
|
|
5
|
+
stays single-sourced in the vouch-protocol package.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from vouch.integrations.langgraph import protect, sign_node
|
|
9
|
+
|
|
10
|
+
__all__ = ["protect", "sign_node"]
|
|
11
|
+
__version__ = "0.1.0"
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: vouch-langgraph
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Sign LangGraph tool calls and graph nodes with Vouch Credentials.
|
|
5
|
+
Author: Ramprasad Gaddam
|
|
6
|
+
License: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://vouch-protocol.com
|
|
8
|
+
Project-URL: Source, https://github.com/vouch-protocol/vouch
|
|
9
|
+
Keywords: langgraph,langchain,vouch,ai-agents,verifiable-credentials,identity
|
|
10
|
+
Requires-Python: >=3.9
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
Requires-Dist: vouch-protocol>=1.6.0
|
|
13
|
+
Requires-Dist: langgraph>=0.1.0
|
|
14
|
+
Provides-Extra: dev
|
|
15
|
+
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
16
|
+
|
|
17
|
+
# vouch-langgraph
|
|
18
|
+
|
|
19
|
+
Sign every LangGraph tool call and graph node with a Vouch Credential, so an
|
|
20
|
+
agent's actions carry a verifiable record of who ran them and on whose authority.
|
|
21
|
+
|
|
22
|
+
LangGraph tools are LangChain tools, so tool-level signing is shared with the
|
|
23
|
+
LangChain integration. On top of that, `sign_node` signs each node step, giving
|
|
24
|
+
a signed trail across the whole graph.
|
|
25
|
+
|
|
26
|
+
## Install
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
pip install vouch-langgraph
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Sign the tools
|
|
33
|
+
|
|
34
|
+
```python
|
|
35
|
+
from langgraph.prebuilt import create_react_agent
|
|
36
|
+
from vouch.integrations.langgraph import protect
|
|
37
|
+
|
|
38
|
+
agent = create_react_agent(llm, tools=protect([search, send_email]))
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Every tool call is now signed in Python before it runs.
|
|
42
|
+
|
|
43
|
+
## Sign each node
|
|
44
|
+
|
|
45
|
+
```python
|
|
46
|
+
from vouch.integrations.langgraph import sign_node
|
|
47
|
+
|
|
48
|
+
@sign_node
|
|
49
|
+
def plan(state):
|
|
50
|
+
...
|
|
51
|
+
|
|
52
|
+
@sign_node(action="charge_card")
|
|
53
|
+
def bill(state):
|
|
54
|
+
...
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Each node step issues its own credential. Verify anywhere with
|
|
58
|
+
`vouch.Verifier.verify_credential`, or read the latest with
|
|
59
|
+
`vouch.autosign.current_credential`.
|
|
60
|
+
|
|
61
|
+
## Identity
|
|
62
|
+
|
|
63
|
+
`protect` and `sign_node` use the ambient Vouch identity, or a `signer=` you
|
|
64
|
+
pass in. Provision one with `vouch init --yes`, or construct a `Signer`
|
|
65
|
+
directly. See the [Vouch Protocol docs](https://vouch-protocol.com).
|
|
66
|
+
|
|
67
|
+
## License
|
|
68
|
+
|
|
69
|
+
Apache-2.0. Part of the [Vouch Protocol](https://github.com/vouch-protocol/vouch).
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
README.md
|
|
2
|
+
pyproject.toml
|
|
3
|
+
src/vouch_langgraph/__init__.py
|
|
4
|
+
src/vouch_langgraph.egg-info/PKG-INFO
|
|
5
|
+
src/vouch_langgraph.egg-info/SOURCES.txt
|
|
6
|
+
src/vouch_langgraph.egg-info/dependency_links.txt
|
|
7
|
+
src/vouch_langgraph.egg-info/requires.txt
|
|
8
|
+
src/vouch_langgraph.egg-info/top_level.txt
|
|
9
|
+
tests/test_smoke.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
vouch_langgraph
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"""Smoke tests for the vouch-langgraph package."""
|
|
2
|
+
|
|
3
|
+
from vouch import Signer, generate_identity
|
|
4
|
+
from vouch.autosign import current_credential
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def _signer():
|
|
8
|
+
kp = generate_identity()
|
|
9
|
+
return Signer(private_key=kp.private_key_jwk, did="did:web:agent.example")
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def test_package_exports():
|
|
13
|
+
import vouch_langgraph
|
|
14
|
+
|
|
15
|
+
assert vouch_langgraph.protect is not None
|
|
16
|
+
assert vouch_langgraph.sign_node is not None
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def test_protect_signs_plain_callable():
|
|
20
|
+
from vouch_langgraph import protect
|
|
21
|
+
|
|
22
|
+
signer = _signer()
|
|
23
|
+
|
|
24
|
+
def search(q: str) -> str:
|
|
25
|
+
return f"results for {q}"
|
|
26
|
+
|
|
27
|
+
wrapped = protect([search], signer=signer)[0]
|
|
28
|
+
out = wrapped("hello")
|
|
29
|
+
|
|
30
|
+
assert out == "results for hello"
|
|
31
|
+
cred = current_credential()
|
|
32
|
+
assert cred is not None
|
|
33
|
+
assert cred["proof"]["cryptosuite"] == "eddsa-jcs-2022"
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def test_sign_node_signs_each_step():
|
|
37
|
+
from vouch_langgraph import sign_node
|
|
38
|
+
|
|
39
|
+
signer = _signer()
|
|
40
|
+
|
|
41
|
+
@sign_node(action="plan", signer=signer)
|
|
42
|
+
def plan(state: dict) -> dict:
|
|
43
|
+
return {**state, "planned": True}
|
|
44
|
+
|
|
45
|
+
result = plan({"x": 1})
|
|
46
|
+
|
|
47
|
+
assert result["planned"] is True
|
|
48
|
+
cred = current_credential()
|
|
49
|
+
assert cred is not None
|
|
50
|
+
assert cred["proof"]["cryptosuite"] == "eddsa-jcs-2022"
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def test_sign_node_bare_decorator_runs():
|
|
54
|
+
from vouch_langgraph import sign_node
|
|
55
|
+
|
|
56
|
+
@sign_node
|
|
57
|
+
def step(state: dict) -> dict:
|
|
58
|
+
return {**state, "seen": True}
|
|
59
|
+
|
|
60
|
+
# No signer resolved here, so the step runs unsigned but still returns.
|
|
61
|
+
assert step({"x": 1})["seen"] is True
|