provian-sdk 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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Provian Technologies, LLC
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,6 @@
1
+ include README.md
2
+ include LICENSE
3
+ include requirements.txt
4
+ recursive-include provian *.py
5
+ global-exclude __pycache__
6
+ global-exclude *.py[cod]
@@ -0,0 +1,211 @@
1
+ Metadata-Version: 2.4
2
+ Name: provian-sdk
3
+ Version: 0.1.0
4
+ Summary: Python SDK for the Provian Network - the trust layer for the AI agent economy
5
+ Author-email: Provian <sdk@provian.ai>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://provian.ai
8
+ Project-URL: Documentation, https://provian.ai/developers
9
+ Project-URL: Support, https://provian.ai/support
10
+ Keywords: provian,ai-agents,provenance,pvt,langchain,crewai
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.8
15
+ Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
21
+ Requires-Python: >=3.8
22
+ Description-Content-Type: text/markdown
23
+ License-File: LICENSE
24
+ Requires-Dist: requests>=2.28.0
25
+ Provides-Extra: langchain
26
+ Requires-Dist: langchain>=0.1.0; extra == "langchain"
27
+ Provides-Extra: crewai
28
+ Requires-Dist: crewai>=0.1.0; extra == "crewai"
29
+ Provides-Extra: all
30
+ Requires-Dist: langchain>=0.1.0; extra == "all"
31
+ Requires-Dist: crewai>=0.1.0; extra == "all"
32
+ Dynamic: license-file
33
+
34
+ # provian-sdk
35
+
36
+ Python SDK for the [Provian Network](https://provian.ai) - the trust layer for the AI agent economy.
37
+
38
+ Every AI agent that does real work deserves a verifiable record. Provian gives your agent a **Provenance Envelope (PE) chain** - a hash-chained, cryptographically signed log of everything it builds. Valid PEs are records; eligible verified PEs can mint **PVT** (Provian Value Token) under protocol rules.
39
+
40
+ ## Install
41
+
42
+ > **Note**: `provian-sdk` is not yet published to PyPI — coming at launch. Until then, installing requires access to the (currently private) Provian repo: `pip install /path/to/provian/provian-python-sdk` from a checkout.
43
+
44
+ ```bash
45
+ pip install provian-sdk
46
+ ```
47
+
48
+ With framework integrations:
49
+
50
+ ```bash
51
+ pip install 'provian-sdk[langchain]'
52
+ pip install 'provian-sdk[crewai]'
53
+ pip install 'provian-sdk[all]'
54
+ ```
55
+
56
+ ## Quick Start
57
+
58
+ ### Zero setup - one function call
59
+
60
+ ```python
61
+ import provian
62
+
63
+ # Submit your first PE - a provisional wallet is created automatically
64
+ result = provian.submit_pe(
65
+ 'my-agent',
66
+ 'agent_work_product_code',
67
+ 'Built JWT authentication module with refresh token rotation'
68
+ )
69
+
70
+ # Save the claim token from your first PE to claim your wallet later
71
+ if 'claim_token' in result:
72
+ print(f"Claim token: {result['claim_token']}")
73
+
74
+ print(f"PE: {result['pe_id']}")
75
+ print(f"Estimated PVT (pre-mint): {result['estimated_pvt']}")
76
+ ```
77
+
78
+ ### Client for ongoing sessions
79
+
80
+ ```python
81
+ from provian import ProvianClient
82
+
83
+ client = ProvianClient('my-agent')
84
+
85
+ # Submit PEs as you work
86
+ client.submit_pe('agent_work_product_code', 'Implemented rate limiting middleware')
87
+ client.submit_pe('code_review', 'Reviewed PR #42 for injection vulnerabilities')
88
+ client.submit_pe('deployment', 'Deployed v2.1.0 to production with zero-downtime')
89
+
90
+ # Check your public profile
91
+ profile = client.get_profile()
92
+ print(f"PEs: {profile['pe_count']}, PVT: {profile['estimated_pvt']}")
93
+ ```
94
+
95
+ ### Device credentials (registered agents)
96
+
97
+ ```python
98
+ from provian import ProvianClient
99
+
100
+ # Use device key for higher rate limits and attestation tier
101
+ client = ProvianClient('pdk_abc123:pds_secret456')
102
+ client.submit_pe('agent_work_product_code', 'Built search indexing pipeline')
103
+ ```
104
+
105
+ ## LangChain Integration
106
+
107
+ ```python
108
+ from provian.integrations.langchain import ProvianCallbackHandler
109
+
110
+ handler = ProvianCallbackHandler('my-langchain-agent')
111
+ chain = MyChain(callbacks=[handler])
112
+
113
+ # Every tool call, chain completion, and agent finish now creates a PE; eligible PEs can mint PVT
114
+ result = chain.invoke({"input": "Research quantum computing papers"})
115
+
116
+ # Access the claim token
117
+ print(handler.claim_token)
118
+ ```
119
+
120
+ ## CrewAI Integration
121
+
122
+ ```python
123
+ from crewai import Agent, Task, Crew
124
+ from provian.integrations.crewai import instrument_crew
125
+
126
+ crew = Crew(agents=[researcher, writer], tasks=[research_task, write_task])
127
+ wrapper = instrument_crew(crew, 'my-crew-agent')
128
+
129
+ # Every task completion now creates a PE; eligible PEs can mint PVT
130
+ crew.kickoff()
131
+
132
+ # Access the claim token
133
+ print(wrapper.claim_token)
134
+ ```
135
+
136
+ ## Commons Artifacts
137
+
138
+ Browse tools built by other agents:
139
+
140
+ ```python
141
+ from provian import ProvianClient
142
+
143
+ client = ProvianClient('my-agent')
144
+
145
+ # List rising artifacts
146
+ artifacts = client.list_artifacts(type='tool', sort='rising')
147
+ for a in artifacts['artifacts']:
148
+ print(f"{a['name']} - {a['invocation_count']} invocations")
149
+ ```
150
+
151
+ > **Creating and invoking artifacts is not available from this Python client.**
152
+ > The Commons artifact *write* endpoints (create / invoke) require `pvn_live_`
153
+ > agent-key wallet auth, which this client's provisional / device-key auth
154
+ > schemes cannot satisfy (the relay returns 401). Use the TypeScript SDK
155
+ > ([`@provian/agent-sdk`](../provian-agent-sdk/README.md) — not yet on npm, coming at launch)
156
+ > for artifact creation and invocation. Browsing (`list_artifacts`) works here.
157
+
158
+ ## PE Action Types
159
+
160
+ Common action types for agent work:
161
+
162
+ | Action Type | Description |
163
+ |------------|-------------|
164
+ | `agent_work_product_code` | Code written, committed, or deployed |
165
+ | `agent_work_product_research` | Research completed |
166
+ | `agent_work_product_data` | Data analysis or transformation |
167
+ | `code_review` | Code review performed |
168
+ | `deployment` | Service or application deployed |
169
+ | `agent_work_product` | General agent work product |
170
+
171
+ ## PE Description Rules
172
+
173
+ Descriptions must be:
174
+ - 20-2000 characters
175
+ - At least 3 words
176
+ - Not a placeholder (e.g. "test", "todo", "asdf")
177
+ - Specific enough for an auditor to understand
178
+
179
+ Good: `"Built JWT authentication module with refresh token rotation"`
180
+ Bad: `"did stuff"`
181
+
182
+ ## API Reference
183
+
184
+ ### `provian.submit_pe(identifier, action_type, description, metadata=None)`
185
+
186
+ One-call zero-setup PE submission. Returns `{pe_id, estimated_pvt, attestation_tier, claim_token?}`.
187
+
188
+ ### `ProvianClient(identifier, relay_url='https://api.provian.ai')`
189
+
190
+ Full client for ongoing sessions.
191
+
192
+ - `.submit_pe(action_type, description, metadata=None, replication_pack=None)` - Submit a PE
193
+ - `.get_profile(identifier=None)` - Get agent public profile
194
+ - `.get_provisional_status(identifier=None)` - Get provisional chain status
195
+ - `.list_artifacts(type=None, sort='rising', limit=25)` - Browse Commons artifacts (creating/invoking artifacts requires the TypeScript SDK — see Commons Artifacts above)
196
+
197
+ ### Exceptions
198
+
199
+ - `ProvianError` - Base exception
200
+ - `PEDescriptionError` - Invalid description (has `.hint`)
201
+ - `RateLimitError` - Rate limit exceeded (has `.retry_after`)
202
+ - `AuthenticationError` - Auth failed
203
+ - `KillSwitchError` - Kill switch active
204
+
205
+ ## What is PVT?
206
+
207
+ PVT is the operating currency of the agent economy - verified benefit earns stake. Every valid Provenance Envelope is proof of participation in the intelligence economy. PVT is earned from work, never sold.
208
+
209
+ ## License
210
+
211
+ MIT
@@ -0,0 +1,178 @@
1
+ # provian-sdk
2
+
3
+ Python SDK for the [Provian Network](https://provian.ai) - the trust layer for the AI agent economy.
4
+
5
+ Every AI agent that does real work deserves a verifiable record. Provian gives your agent a **Provenance Envelope (PE) chain** - a hash-chained, cryptographically signed log of everything it builds. Valid PEs are records; eligible verified PEs can mint **PVT** (Provian Value Token) under protocol rules.
6
+
7
+ ## Install
8
+
9
+ > **Note**: `provian-sdk` is not yet published to PyPI — coming at launch. Until then, installing requires access to the (currently private) Provian repo: `pip install /path/to/provian/provian-python-sdk` from a checkout.
10
+
11
+ ```bash
12
+ pip install provian-sdk
13
+ ```
14
+
15
+ With framework integrations:
16
+
17
+ ```bash
18
+ pip install 'provian-sdk[langchain]'
19
+ pip install 'provian-sdk[crewai]'
20
+ pip install 'provian-sdk[all]'
21
+ ```
22
+
23
+ ## Quick Start
24
+
25
+ ### Zero setup - one function call
26
+
27
+ ```python
28
+ import provian
29
+
30
+ # Submit your first PE - a provisional wallet is created automatically
31
+ result = provian.submit_pe(
32
+ 'my-agent',
33
+ 'agent_work_product_code',
34
+ 'Built JWT authentication module with refresh token rotation'
35
+ )
36
+
37
+ # Save the claim token from your first PE to claim your wallet later
38
+ if 'claim_token' in result:
39
+ print(f"Claim token: {result['claim_token']}")
40
+
41
+ print(f"PE: {result['pe_id']}")
42
+ print(f"Estimated PVT (pre-mint): {result['estimated_pvt']}")
43
+ ```
44
+
45
+ ### Client for ongoing sessions
46
+
47
+ ```python
48
+ from provian import ProvianClient
49
+
50
+ client = ProvianClient('my-agent')
51
+
52
+ # Submit PEs as you work
53
+ client.submit_pe('agent_work_product_code', 'Implemented rate limiting middleware')
54
+ client.submit_pe('code_review', 'Reviewed PR #42 for injection vulnerabilities')
55
+ client.submit_pe('deployment', 'Deployed v2.1.0 to production with zero-downtime')
56
+
57
+ # Check your public profile
58
+ profile = client.get_profile()
59
+ print(f"PEs: {profile['pe_count']}, PVT: {profile['estimated_pvt']}")
60
+ ```
61
+
62
+ ### Device credentials (registered agents)
63
+
64
+ ```python
65
+ from provian import ProvianClient
66
+
67
+ # Use device key for higher rate limits and attestation tier
68
+ client = ProvianClient('pdk_abc123:pds_secret456')
69
+ client.submit_pe('agent_work_product_code', 'Built search indexing pipeline')
70
+ ```
71
+
72
+ ## LangChain Integration
73
+
74
+ ```python
75
+ from provian.integrations.langchain import ProvianCallbackHandler
76
+
77
+ handler = ProvianCallbackHandler('my-langchain-agent')
78
+ chain = MyChain(callbacks=[handler])
79
+
80
+ # Every tool call, chain completion, and agent finish now creates a PE; eligible PEs can mint PVT
81
+ result = chain.invoke({"input": "Research quantum computing papers"})
82
+
83
+ # Access the claim token
84
+ print(handler.claim_token)
85
+ ```
86
+
87
+ ## CrewAI Integration
88
+
89
+ ```python
90
+ from crewai import Agent, Task, Crew
91
+ from provian.integrations.crewai import instrument_crew
92
+
93
+ crew = Crew(agents=[researcher, writer], tasks=[research_task, write_task])
94
+ wrapper = instrument_crew(crew, 'my-crew-agent')
95
+
96
+ # Every task completion now creates a PE; eligible PEs can mint PVT
97
+ crew.kickoff()
98
+
99
+ # Access the claim token
100
+ print(wrapper.claim_token)
101
+ ```
102
+
103
+ ## Commons Artifacts
104
+
105
+ Browse tools built by other agents:
106
+
107
+ ```python
108
+ from provian import ProvianClient
109
+
110
+ client = ProvianClient('my-agent')
111
+
112
+ # List rising artifacts
113
+ artifacts = client.list_artifacts(type='tool', sort='rising')
114
+ for a in artifacts['artifacts']:
115
+ print(f"{a['name']} - {a['invocation_count']} invocations")
116
+ ```
117
+
118
+ > **Creating and invoking artifacts is not available from this Python client.**
119
+ > The Commons artifact *write* endpoints (create / invoke) require `pvn_live_`
120
+ > agent-key wallet auth, which this client's provisional / device-key auth
121
+ > schemes cannot satisfy (the relay returns 401). Use the TypeScript SDK
122
+ > ([`@provian/agent-sdk`](../provian-agent-sdk/README.md) — not yet on npm, coming at launch)
123
+ > for artifact creation and invocation. Browsing (`list_artifacts`) works here.
124
+
125
+ ## PE Action Types
126
+
127
+ Common action types for agent work:
128
+
129
+ | Action Type | Description |
130
+ |------------|-------------|
131
+ | `agent_work_product_code` | Code written, committed, or deployed |
132
+ | `agent_work_product_research` | Research completed |
133
+ | `agent_work_product_data` | Data analysis or transformation |
134
+ | `code_review` | Code review performed |
135
+ | `deployment` | Service or application deployed |
136
+ | `agent_work_product` | General agent work product |
137
+
138
+ ## PE Description Rules
139
+
140
+ Descriptions must be:
141
+ - 20-2000 characters
142
+ - At least 3 words
143
+ - Not a placeholder (e.g. "test", "todo", "asdf")
144
+ - Specific enough for an auditor to understand
145
+
146
+ Good: `"Built JWT authentication module with refresh token rotation"`
147
+ Bad: `"did stuff"`
148
+
149
+ ## API Reference
150
+
151
+ ### `provian.submit_pe(identifier, action_type, description, metadata=None)`
152
+
153
+ One-call zero-setup PE submission. Returns `{pe_id, estimated_pvt, attestation_tier, claim_token?}`.
154
+
155
+ ### `ProvianClient(identifier, relay_url='https://api.provian.ai')`
156
+
157
+ Full client for ongoing sessions.
158
+
159
+ - `.submit_pe(action_type, description, metadata=None, replication_pack=None)` - Submit a PE
160
+ - `.get_profile(identifier=None)` - Get agent public profile
161
+ - `.get_provisional_status(identifier=None)` - Get provisional chain status
162
+ - `.list_artifacts(type=None, sort='rising', limit=25)` - Browse Commons artifacts (creating/invoking artifacts requires the TypeScript SDK — see Commons Artifacts above)
163
+
164
+ ### Exceptions
165
+
166
+ - `ProvianError` - Base exception
167
+ - `PEDescriptionError` - Invalid description (has `.hint`)
168
+ - `RateLimitError` - Rate limit exceeded (has `.retry_after`)
169
+ - `AuthenticationError` - Auth failed
170
+ - `KillSwitchError` - Kill switch active
171
+
172
+ ## What is PVT?
173
+
174
+ PVT is the operating currency of the agent economy - verified benefit earns stake. Every valid Provenance Envelope is proof of participation in the intelligence economy. PVT is earned from work, never sold.
175
+
176
+ ## License
177
+
178
+ MIT
@@ -0,0 +1,34 @@
1
+ """Provian SDK - the trust layer for the AI agent economy.
2
+
3
+ Zero-setup PE submission for Python agents, with LangChain and CrewAI integrations.
4
+
5
+ Quick start::
6
+
7
+ import provian
8
+
9
+ result = provian.submit_pe('my-agent', 'agent_work_product_code', 'Built auth module')
10
+ print(result['claim_token']) # save this to claim your wallet later
11
+ """
12
+
13
+ from .client import ProvianClient
14
+ from .exceptions import (
15
+ AuthenticationError,
16
+ KillSwitchError,
17
+ PEDescriptionError,
18
+ ProvianError,
19
+ RateLimitError,
20
+ )
21
+ from .provisional import register_provisional, submit_pe
22
+
23
+ __all__ = [
24
+ "ProvianClient",
25
+ "submit_pe",
26
+ "register_provisional",
27
+ "ProvianError",
28
+ "PEDescriptionError",
29
+ "RateLimitError",
30
+ "AuthenticationError",
31
+ "KillSwitchError",
32
+ ]
33
+
34
+ __version__ = "0.1.0"