vaultkit 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.
Files changed (35) hide show
  1. vaultkit-0.1.0/PKG-INFO +207 -0
  2. vaultkit-0.1.0/README.md +183 -0
  3. vaultkit-0.1.0/pyproject.toml +46 -0
  4. vaultkit-0.1.0/setup.cfg +4 -0
  5. vaultkit-0.1.0/tests/test_fetch.py +0 -0
  6. vaultkit-0.1.0/tests/test_query.py +0 -0
  7. vaultkit-0.1.0/vaultkit/__init__.py +85 -0
  8. vaultkit-0.1.0/vaultkit/client.py +441 -0
  9. vaultkit-0.1.0/vaultkit/core/__init__.py +1 -0
  10. vaultkit-0.1.0/vaultkit/core/http.py +190 -0
  11. vaultkit-0.1.0/vaultkit/core/polling.py +140 -0
  12. vaultkit-0.1.0/vaultkit/errors/__init__.py +36 -0
  13. vaultkit-0.1.0/vaultkit/errors/base.py +30 -0
  14. vaultkit-0.1.0/vaultkit/errors/exceptions.py +211 -0
  15. vaultkit-0.1.0/vaultkit/models/__init__.py +11 -0
  16. vaultkit-0.1.0/vaultkit/models/dataset_info.py +25 -0
  17. vaultkit-0.1.0/vaultkit/models/dataset_schema.py +75 -0
  18. vaultkit-0.1.0/vaultkit/models/fetch_result.py +53 -0
  19. vaultkit-0.1.0/vaultkit/models/query_result.py +73 -0
  20. vaultkit-0.1.0/vaultkit/tools/__init__.py +5 -0
  21. vaultkit-0.1.0/vaultkit/tools/adapters/__init__.py +12 -0
  22. vaultkit-0.1.0/vaultkit/tools/adapters/anthropic.py +17 -0
  23. vaultkit-0.1.0/vaultkit/tools/adapters/openai.py +23 -0
  24. vaultkit-0.1.0/vaultkit/tools/builder.py +128 -0
  25. vaultkit-0.1.0/vaultkit/tools/definitions.py +177 -0
  26. vaultkit-0.1.0/vaultkit/tools/executor.py +199 -0
  27. vaultkit-0.1.0/vaultkit/tools/schemas.py +39 -0
  28. vaultkit-0.1.0/vaultkit/utils/__init__.py +1 -0
  29. vaultkit-0.1.0/vaultkit/utils/retry.py +81 -0
  30. vaultkit-0.1.0/vaultkit/utils/validation.py +87 -0
  31. vaultkit-0.1.0/vaultkit.egg-info/PKG-INFO +207 -0
  32. vaultkit-0.1.0/vaultkit.egg-info/SOURCES.txt +33 -0
  33. vaultkit-0.1.0/vaultkit.egg-info/dependency_links.txt +1 -0
  34. vaultkit-0.1.0/vaultkit.egg-info/requires.txt +1 -0
  35. vaultkit-0.1.0/vaultkit.egg-info/top_level.txt +1 -0
@@ -0,0 +1,207 @@
1
+ Metadata-Version: 2.4
2
+ Name: vaultkit
3
+ Version: 0.1.0
4
+ Summary: VaultKit Python SDK for policy-driven, runtime governed data access
5
+ Author-email: VaultKit <founders@vaultkit.io>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/vaultkit-inc/vaultkit-sdk-python
8
+ Project-URL: Documentation, https://docs.vaultkit.io
9
+ Project-URL: Source, https://github.com/vaultkit-inc/vaultkit-sdk-python
10
+ Project-URL: Issues, https://github.com/vaultkit-inc/vaultkit-sdk-python/issues
11
+ Keywords: ai,data,sdk,governance,security,agents,runtime
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.8
17
+ Classifier: Programming Language :: Python :: 3.9
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Topic :: Software Development :: Libraries
21
+ Requires-Python: >=3.8
22
+ Description-Content-Type: text/markdown
23
+ Requires-Dist: httpx>=0.24.0
24
+
25
+ # VaultKit Python SDK
26
+
27
+ > Secure, policy-driven data access for AI agents and applications.
28
+
29
+ VaultKit is a control plane for governed data access. This SDK allows Python applications and AI agents to safely query data with built-in policy enforcement, approval workflows, and auditability.
30
+
31
+ ---
32
+
33
+ ## Features
34
+
35
+ - Policy-enforced data access (masking, approval, deny)
36
+ - First-class support for AI agents (OpenAI, Anthropic)
37
+ - Built-in approval workflows
38
+ - Automatic polling and retries
39
+ - Schema-aware dataset discovery
40
+ - Simple, high-level API via `execute()`
41
+
42
+ ---
43
+
44
+ ## Installation
45
+
46
+ ```bash
47
+ pip install vaultkit
48
+ ```
49
+
50
+ ---
51
+
52
+ ## Quick Start
53
+
54
+ ```python
55
+ from vaultkit import VaultKitClient
56
+
57
+ client = VaultKitClient(
58
+ base_url="http://localhost:3000",
59
+ token="YOUR_TOKEN",
60
+ org="YOUR_ORG",
61
+ )
62
+
63
+ result = client.execute(
64
+ dataset="users",
65
+ fields=["id", "email"],
66
+ limit=10,
67
+ purpose="Analyze user activity",
68
+ )
69
+
70
+ print(result.rows)
71
+ ```
72
+
73
+ ---
74
+
75
+ ## AI Agent Usage
76
+
77
+ VaultKit provides built-in tools for LLM agents.
78
+
79
+ ```python
80
+ from vaultkit.tools import ToolBuilder, ToolExecutor, ToolProvider
81
+
82
+ builder = ToolBuilder(client)
83
+
84
+ tools = builder.build(
85
+ provider=ToolProvider.OPENAI,
86
+ include_check_approval=True,
87
+ )
88
+
89
+ executor = ToolExecutor(client)
90
+
91
+ result = executor.execute(
92
+ "vaultkit_query",
93
+ {
94
+ "dataset": "users",
95
+ "limit": 5,
96
+ "purpose": "Analyze user trends",
97
+ },
98
+ )
99
+ ```
100
+
101
+ See full example: [`examples/agent_openai_demo.py`](examples/agent_openai_demo.py)
102
+
103
+ ---
104
+
105
+ ## Approval Flow
106
+
107
+ Some queries require human approval before data is returned.
108
+
109
+ ```python
110
+ from vaultkit.errors.exceptions import ApprovalRequiredError
111
+
112
+ try:
113
+ client.execute(dataset="sensitive_data", purpose="Analysis")
114
+ except ApprovalRequiredError as e:
115
+ print(f"Approval required. Request ID: {e.request_id}")
116
+ ```
117
+
118
+ Once approved, resume with:
119
+
120
+ ```python
121
+ result = client.poll_request(request_id="req_123")
122
+ ```
123
+
124
+ ---
125
+
126
+ ## API Overview
127
+
128
+ ### High-Level
129
+
130
+ | Method | Description |
131
+ |---|---|
132
+ | `client.execute(...)` | Full lifecycle: query → poll → fetch. Recommended for most use cases. |
133
+
134
+ ### Low-Level
135
+
136
+ | Method | Description |
137
+ |---|---|
138
+ | `client.query(...)` | Submit an intent request, get a `QueryResult` |
139
+ | `client.poll(result)` | Block until a queued result reaches a terminal state |
140
+ | `client.fetch(grant_ref=...)` | Redeem a grant for data |
141
+ | `client.poll_request(request_id=...)` | Poll by request ID (used in approval flows) |
142
+
143
+ ### Discovery
144
+
145
+ | Method | Description |
146
+ |---|---|
147
+ | `client.datasets()` | List authorized datasets from the registry |
148
+ | `client.schema("users")` | Get field-level schema for a dataset |
149
+
150
+ ---
151
+
152
+ ## How It Works
153
+
154
+ ```
155
+ Client → VaultKit → Policy Engine → Data Source
156
+
157
+ Enforced Policies
158
+ ```
159
+
160
+ 1. Queries are evaluated against policy bundles at runtime
161
+ 2. Sensitive fields may be masked based on requester context
162
+ 3. Some datasets require human approval before access is granted
163
+ 4. All access is logged and auditable
164
+
165
+ ---
166
+
167
+ ## Why VaultKit?
168
+
169
+ Traditional access control is static — permissions are set upfront and rarely change. VaultKit enables:
170
+
171
+ - **Runtime, policy-driven access** — decisions made at query time based on context
172
+ - **AI-safe data access** — purpose and clearance are first-class query parameters
173
+ - **Auditability and compliance** — every request is tracked with correlation IDs
174
+
175
+ ---
176
+
177
+ ## Environment Variables
178
+
179
+ ```bash
180
+ export VAULTKIT_URL=http://localhost:3000
181
+ export VAULTKIT_TOKEN=your_token
182
+ export VAULTKIT_ORG=your_org
183
+ ```
184
+
185
+ Or use a `.env` file (see [`.env.example`](.env.example)).
186
+
187
+ ---
188
+
189
+ ## Local Development
190
+
191
+ Start VaultKit locally with Docker:
192
+
193
+ ```bash
194
+ docker compose up
195
+ ```
196
+
197
+ Run the test suite:
198
+
199
+ ```bash
200
+ pytest
201
+ ```
202
+
203
+ ---
204
+
205
+ ## License
206
+
207
+ MIT
@@ -0,0 +1,183 @@
1
+ # VaultKit Python SDK
2
+
3
+ > Secure, policy-driven data access for AI agents and applications.
4
+
5
+ VaultKit is a control plane for governed data access. This SDK allows Python applications and AI agents to safely query data with built-in policy enforcement, approval workflows, and auditability.
6
+
7
+ ---
8
+
9
+ ## Features
10
+
11
+ - Policy-enforced data access (masking, approval, deny)
12
+ - First-class support for AI agents (OpenAI, Anthropic)
13
+ - Built-in approval workflows
14
+ - Automatic polling and retries
15
+ - Schema-aware dataset discovery
16
+ - Simple, high-level API via `execute()`
17
+
18
+ ---
19
+
20
+ ## Installation
21
+
22
+ ```bash
23
+ pip install vaultkit
24
+ ```
25
+
26
+ ---
27
+
28
+ ## Quick Start
29
+
30
+ ```python
31
+ from vaultkit import VaultKitClient
32
+
33
+ client = VaultKitClient(
34
+ base_url="http://localhost:3000",
35
+ token="YOUR_TOKEN",
36
+ org="YOUR_ORG",
37
+ )
38
+
39
+ result = client.execute(
40
+ dataset="users",
41
+ fields=["id", "email"],
42
+ limit=10,
43
+ purpose="Analyze user activity",
44
+ )
45
+
46
+ print(result.rows)
47
+ ```
48
+
49
+ ---
50
+
51
+ ## AI Agent Usage
52
+
53
+ VaultKit provides built-in tools for LLM agents.
54
+
55
+ ```python
56
+ from vaultkit.tools import ToolBuilder, ToolExecutor, ToolProvider
57
+
58
+ builder = ToolBuilder(client)
59
+
60
+ tools = builder.build(
61
+ provider=ToolProvider.OPENAI,
62
+ include_check_approval=True,
63
+ )
64
+
65
+ executor = ToolExecutor(client)
66
+
67
+ result = executor.execute(
68
+ "vaultkit_query",
69
+ {
70
+ "dataset": "users",
71
+ "limit": 5,
72
+ "purpose": "Analyze user trends",
73
+ },
74
+ )
75
+ ```
76
+
77
+ See full example: [`examples/agent_openai_demo.py`](examples/agent_openai_demo.py)
78
+
79
+ ---
80
+
81
+ ## Approval Flow
82
+
83
+ Some queries require human approval before data is returned.
84
+
85
+ ```python
86
+ from vaultkit.errors.exceptions import ApprovalRequiredError
87
+
88
+ try:
89
+ client.execute(dataset="sensitive_data", purpose="Analysis")
90
+ except ApprovalRequiredError as e:
91
+ print(f"Approval required. Request ID: {e.request_id}")
92
+ ```
93
+
94
+ Once approved, resume with:
95
+
96
+ ```python
97
+ result = client.poll_request(request_id="req_123")
98
+ ```
99
+
100
+ ---
101
+
102
+ ## API Overview
103
+
104
+ ### High-Level
105
+
106
+ | Method | Description |
107
+ |---|---|
108
+ | `client.execute(...)` | Full lifecycle: query → poll → fetch. Recommended for most use cases. |
109
+
110
+ ### Low-Level
111
+
112
+ | Method | Description |
113
+ |---|---|
114
+ | `client.query(...)` | Submit an intent request, get a `QueryResult` |
115
+ | `client.poll(result)` | Block until a queued result reaches a terminal state |
116
+ | `client.fetch(grant_ref=...)` | Redeem a grant for data |
117
+ | `client.poll_request(request_id=...)` | Poll by request ID (used in approval flows) |
118
+
119
+ ### Discovery
120
+
121
+ | Method | Description |
122
+ |---|---|
123
+ | `client.datasets()` | List authorized datasets from the registry |
124
+ | `client.schema("users")` | Get field-level schema for a dataset |
125
+
126
+ ---
127
+
128
+ ## How It Works
129
+
130
+ ```
131
+ Client → VaultKit → Policy Engine → Data Source
132
+
133
+ Enforced Policies
134
+ ```
135
+
136
+ 1. Queries are evaluated against policy bundles at runtime
137
+ 2. Sensitive fields may be masked based on requester context
138
+ 3. Some datasets require human approval before access is granted
139
+ 4. All access is logged and auditable
140
+
141
+ ---
142
+
143
+ ## Why VaultKit?
144
+
145
+ Traditional access control is static — permissions are set upfront and rarely change. VaultKit enables:
146
+
147
+ - **Runtime, policy-driven access** — decisions made at query time based on context
148
+ - **AI-safe data access** — purpose and clearance are first-class query parameters
149
+ - **Auditability and compliance** — every request is tracked with correlation IDs
150
+
151
+ ---
152
+
153
+ ## Environment Variables
154
+
155
+ ```bash
156
+ export VAULTKIT_URL=http://localhost:3000
157
+ export VAULTKIT_TOKEN=your_token
158
+ export VAULTKIT_ORG=your_org
159
+ ```
160
+
161
+ Or use a `.env` file (see [`.env.example`](.env.example)).
162
+
163
+ ---
164
+
165
+ ## Local Development
166
+
167
+ Start VaultKit locally with Docker:
168
+
169
+ ```bash
170
+ docker compose up
171
+ ```
172
+
173
+ Run the test suite:
174
+
175
+ ```bash
176
+ pytest
177
+ ```
178
+
179
+ ---
180
+
181
+ ## License
182
+
183
+ MIT
@@ -0,0 +1,46 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "vaultkit"
7
+ version = "0.1.0"
8
+ description = "VaultKit Python SDK for policy-driven, runtime governed data access"
9
+ authors = [
10
+ { name = "VaultKit", email = "founders@vaultkit.io" }
11
+ ]
12
+ readme = "README.md"
13
+ requires-python = ">=3.8"
14
+ license = { text = "MIT" }
15
+
16
+ dependencies = [
17
+ "httpx>=0.24.0",
18
+ ]
19
+
20
+ keywords = [
21
+ "ai",
22
+ "data",
23
+ "sdk",
24
+ "governance",
25
+ "security",
26
+ "agents",
27
+ "runtime",
28
+ ]
29
+
30
+ classifiers = [
31
+ "Development Status :: 3 - Alpha",
32
+ "Intended Audience :: Developers",
33
+ "License :: OSI Approved :: MIT License",
34
+ "Programming Language :: Python :: 3",
35
+ "Programming Language :: Python :: 3.8",
36
+ "Programming Language :: Python :: 3.9",
37
+ "Programming Language :: Python :: 3.10",
38
+ "Programming Language :: Python :: 3.11",
39
+ "Topic :: Software Development :: Libraries",
40
+ ]
41
+
42
+ [project.urls]
43
+ Homepage = "https://github.com/vaultkit-inc/vaultkit-sdk-python"
44
+ Documentation = "https://docs.vaultkit.io"
45
+ Source = "https://github.com/vaultkit-inc/vaultkit-sdk-python"
46
+ Issues = "https://github.com/vaultkit-inc/vaultkit-sdk-python/issues"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
File without changes
File without changes
@@ -0,0 +1,85 @@
1
+ """
2
+ VaultKit Python SDK
3
+
4
+ Quick start:
5
+
6
+ from vaultkit import VaultKitClient
7
+
8
+ with VaultKitClient(
9
+ base_url="https://vaultkit.yourorg.com",
10
+ token="your-jwt-token",
11
+ org="your-org-id",
12
+ ) as client:
13
+
14
+ # High-level: full lifecycle, grants invisible
15
+ result = client.execute(
16
+ dataset="customers",
17
+ fields=["id", "email", "revenue"],
18
+ filters=[{"field": "revenue", "operator": "gt", "value": 10000}],
19
+ purpose="Q4 revenue analysis",
20
+ )
21
+
22
+ # For AI agents — scoped tool schemas from the live registry:
23
+ from vaultkit.tools import ToolBuilder, ToolExecutor
24
+
25
+ tools = ToolBuilder(client).build()
26
+ executor = ToolExecutor(client)
27
+ """
28
+
29
+ from .client import ClientConfig, VaultKitClient
30
+
31
+ from .errors import (
32
+ ApprovalRequiredError,
33
+ DeniedError,
34
+ GrantExpiredError,
35
+ GrantRevokedError,
36
+ PolicyBundleRevokedError,
37
+ PollTimeoutError,
38
+ QueuedError,
39
+ ValidationError,
40
+ VaultKitError,
41
+ TransportError,
42
+ ServerError,
43
+ RateLimitError,
44
+ )
45
+
46
+ from .models import (
47
+ DatasetInfo,
48
+ DatasetSchema,
49
+ FetchResult,
50
+ QueryResult,
51
+ )
52
+
53
+ # Optional (nice DX improvement)
54
+ from .tools import ToolBuilder, ToolExecutor
55
+
56
+ __version__ = "0.1.0"
57
+
58
+ __all__ = [
59
+ "VaultKitClient",
60
+ "ClientConfig",
61
+
62
+ # Models
63
+ "QueryResult",
64
+ "FetchResult",
65
+ "DatasetInfo",
66
+ "DatasetSchema",
67
+
68
+ # Errors
69
+ "VaultKitError",
70
+ "DeniedError",
71
+ "ApprovalRequiredError",
72
+ "QueuedError",
73
+ "GrantExpiredError",
74
+ "GrantRevokedError",
75
+ "PolicyBundleRevokedError",
76
+ "ValidationError",
77
+ "PollTimeoutError",
78
+ "TransportError",
79
+ "ServerError",
80
+ "RateLimitError",
81
+
82
+ # Tools
83
+ "ToolBuilder",
84
+ "ToolExecutor",
85
+ ]