z-grc 0.0.14__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.
- z_grc-0.0.14/LICENSE +21 -0
- z_grc-0.0.14/PKG-INFO +224 -0
- z_grc-0.0.14/README.md +172 -0
- z_grc-0.0.14/pyproject.toml +90 -0
- z_grc-0.0.14/setup.cfg +4 -0
- z_grc-0.0.14/z_grc.egg-info/PKG-INFO +224 -0
- z_grc-0.0.14/z_grc.egg-info/SOURCES.txt +42 -0
- z_grc-0.0.14/z_grc.egg-info/dependency_links.txt +1 -0
- z_grc-0.0.14/z_grc.egg-info/entry_points.txt +2 -0
- z_grc-0.0.14/z_grc.egg-info/requires.txt +11 -0
- z_grc-0.0.14/z_grc.egg-info/top_level.txt +1 -0
- z_grc-0.0.14/zgrc/__init__.py +126 -0
- z_grc-0.0.14/zgrc/auth.py +112 -0
- z_grc-0.0.14/zgrc/client/__init__.py +3 -0
- z_grc-0.0.14/zgrc/client/api_client.py +81 -0
- z_grc-0.0.14/zgrc/context.py +11 -0
- z_grc-0.0.14/zgrc/core/__init__.py +14 -0
- z_grc-0.0.14/zgrc/core/lazy_patcher.py +96 -0
- z_grc-0.0.14/zgrc/core/manager.py +65 -0
- z_grc-0.0.14/zgrc/core/registry.py +46 -0
- z_grc-0.0.14/zgrc/core/scanner.py +29 -0
- z_grc-0.0.14/zgrc/interceptors/__init__.py +5 -0
- z_grc-0.0.14/zgrc/interceptors/base_interceptor.py +49 -0
- z_grc-0.0.14/zgrc/interceptors/base_response_handler.py +23 -0
- z_grc-0.0.14/zgrc/interceptors/bedrock/__init__.py +11 -0
- z_grc-0.0.14/zgrc/interceptors/bedrock/interceptor.py +259 -0
- z_grc-0.0.14/zgrc/interceptors/bedrock/response_handlers.py +323 -0
- z_grc-0.0.14/zgrc/interceptors/models.py +48 -0
- z_grc-0.0.14/zgrc/observability/__init__.py +91 -0
- z_grc-0.0.14/zgrc/observability/auto_instrumentation.py +229 -0
- z_grc-0.0.14/zgrc/observability/base_telemetry.py +37 -0
- z_grc-0.0.14/zgrc/observability/logs.py +98 -0
- z_grc-0.0.14/zgrc/observability/metrics.py +65 -0
- z_grc-0.0.14/zgrc/observability/traces.py +35 -0
- z_grc-0.0.14/zgrc/policy/Quota.py +79 -0
- z_grc-0.0.14/zgrc/policy/__init__.py +9 -0
- z_grc-0.0.14/zgrc/policy/post_checker.py +31 -0
- z_grc-0.0.14/zgrc/policy/pre_checker.py +47 -0
- z_grc-0.0.14/zgrc/providers.py +15 -0
- z_grc-0.0.14/zgrc/proxy/__init__.py +22 -0
- z_grc-0.0.14/zgrc/proxy/handlers.py +164 -0
- z_grc-0.0.14/zgrc/proxy.main.py +86 -0
- z_grc-0.0.14/zgrc/utils/__init__.py +6 -0
- z_grc-0.0.14/zgrc/utils/exceptions.py +70 -0
z_grc-0.0.14/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 zeb labs
|
|
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.
|
z_grc-0.0.14/PKG-INFO
ADDED
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: z-grc
|
|
3
|
+
Version: 0.0.14
|
|
4
|
+
Summary: Governance Engine by zeb labs
|
|
5
|
+
Author-email: Samrat Damodaran <samrat.damodaran@zeb.co>, Shriyokesh Thangavel <shriyokesh.thangavel@zeb.co>, Sid V <sid@zeb.co>, Madhavsrikrishna Sriram <madhavsrikrishna.sriram@zeb.co>, Noor Shekumohamed <noor.shekumohamed@zeb.co>, Arunachalam Gunasekaran <Arun.Gunasekaran@zeb.co>
|
|
6
|
+
Maintainer-email: Samrat Damodaran <samrat.damodaran@zeb.co>, Shriyokesh Thangavel <shriyokesh.thangavel@zeb.co>, Sid V <sid@zeb.co>, Madhavsrikrishna Sriram <madhavsrikrishna.sriram@zeb.co>, Noor Shekumohamed <noor.shekumohamed@zeb.co>, Arunachalam Gunasekaran <Arun.Gunasekaran@zeb.co>
|
|
7
|
+
License: MIT License
|
|
8
|
+
|
|
9
|
+
Copyright (c) 2026 zeb labs
|
|
10
|
+
|
|
11
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
12
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
13
|
+
in the Software without restriction, including without limitation the rights
|
|
14
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
15
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
16
|
+
furnished to do so, subject to the following conditions:
|
|
17
|
+
|
|
18
|
+
The above copyright notice and this permission notice shall be included in all
|
|
19
|
+
copies or substantial portions of the Software.
|
|
20
|
+
|
|
21
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
22
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
23
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
24
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
25
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
26
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
27
|
+
SOFTWARE.
|
|
28
|
+
|
|
29
|
+
Project-URL: Homepage, https://github.com/zeb-ai/z-grc
|
|
30
|
+
Project-URL: Repository, https://github.com/zeb-ai/z-grc
|
|
31
|
+
Keywords: governance,llm,quota,policy,telemetry,observability
|
|
32
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
33
|
+
Classifier: Programming Language :: Python :: 3
|
|
34
|
+
Classifier: Operating System :: OS Independent
|
|
35
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
36
|
+
Classifier: Topic :: System :: Monitoring
|
|
37
|
+
Requires-Python: >=3.13
|
|
38
|
+
Description-Content-Type: text/markdown
|
|
39
|
+
License-File: LICENSE
|
|
40
|
+
Requires-Dist: httpx>=0.28.1
|
|
41
|
+
Requires-Dist: mitmproxy>=12.2.1
|
|
42
|
+
Requires-Dist: opentelemetry-api>=1.39.1
|
|
43
|
+
Requires-Dist: opentelemetry-exporter-otlp-proto-http>=1.39.1
|
|
44
|
+
Requires-Dist: opentelemetry-instrumentation>=0.60b1
|
|
45
|
+
Requires-Dist: opentelemetry-instrumentation-httpx>=0.60b1
|
|
46
|
+
Requires-Dist: opentelemetry-instrumentation-threading>=0.60b1
|
|
47
|
+
Requires-Dist: opentelemetry-sdk>=1.39.1
|
|
48
|
+
Requires-Dist: pydantic>=2.12.5
|
|
49
|
+
Requires-Dist: rich>=14.3.3
|
|
50
|
+
Requires-Dist: tenacity>=9.1.4
|
|
51
|
+
Dynamic: license-file
|
|
52
|
+
|
|
53
|
+
# Z-GRC - Z Governance, Risk, Control Engine
|
|
54
|
+
|
|
55
|
+
[](https://www.python.org/downloads/)
|
|
56
|
+
[](https://github.com/astral-sh/ruff)
|
|
57
|
+
[](https://pypi.org/project/z-grc/)
|
|
58
|
+
[](https://pypi.org/project/z-grc/)
|
|
59
|
+
|
|
60
|
+
[//]: # ([]())
|
|
61
|
+
|
|
62
|
+
Enterprise-grade governance engine for Large Language Model applications. Provides automatic interception, policy enforcement, quota management, and comprehensive observability across multiple LLM providers with zero code changes.
|
|
63
|
+
|
|
64
|
+
## Installation
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
uv add z-grc
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Or with auto-instrumentation:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
uv add z-grc[auto-instrument]
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Quick Start
|
|
77
|
+
|
|
78
|
+
```python
|
|
79
|
+
import zgrc
|
|
80
|
+
import boto3
|
|
81
|
+
import json
|
|
82
|
+
|
|
83
|
+
# Initialize GRC
|
|
84
|
+
zgrc.init(api_key="your-zgrc-api-key")
|
|
85
|
+
|
|
86
|
+
# Use your LLM SDK normally - GRC handles everything
|
|
87
|
+
client = boto3.client("bedrock-runtime", region_name="us-east-1")
|
|
88
|
+
|
|
89
|
+
response = client.invoke_model(
|
|
90
|
+
modelId="us.anthropic.claude-sonnet-4-5-20250929-v1:0",
|
|
91
|
+
body=json.dumps({
|
|
92
|
+
"anthropic_version": "bedrock-2023-05-31",
|
|
93
|
+
"max_tokens": 1024,
|
|
94
|
+
"messages": [{"role": "user", "content": "Hello!"}]
|
|
95
|
+
})
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
# Z-GRC automatically:
|
|
99
|
+
# - Validates quota before requests
|
|
100
|
+
# - Tracks token usage
|
|
101
|
+
# - Enforces policies
|
|
102
|
+
# - Sends telemetry (traces, metrics, logs)
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Features
|
|
106
|
+
|
|
107
|
+
### Zero-Code Integration
|
|
108
|
+
Drop-in solution requiring only `zgrc.init()`. Works with existing code without modifications.
|
|
109
|
+
|
|
110
|
+
### Auto-Discovery
|
|
111
|
+
Automatically detects and intercepts installed LLM SDKs:
|
|
112
|
+
- AWS Bedrock (boto3)
|
|
113
|
+
- Anthropic (coming soon)
|
|
114
|
+
- OpenAI (coming soon)
|
|
115
|
+
- Azure OpenAI (coming soon)
|
|
116
|
+
|
|
117
|
+
### Policy Enforcement
|
|
118
|
+
Real-time quota validation and token limit enforcement. Blocks requests when quota is exceeded.
|
|
119
|
+
|
|
120
|
+
```python
|
|
121
|
+
from zgrc.utils import QuotaExceededException
|
|
122
|
+
|
|
123
|
+
try:
|
|
124
|
+
response = client.invoke_model(...)
|
|
125
|
+
except QuotaExceededException as e:
|
|
126
|
+
print(f"Quota exceeded: {e.used}/{e.limit} tokens")
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Auto-Instrumentation
|
|
130
|
+
Optional automatic instrumentation for HTTP clients, web frameworks, databases, and more:
|
|
131
|
+
|
|
132
|
+
```python
|
|
133
|
+
zgrc.init(
|
|
134
|
+
api_key="your-zgrc-api-key",
|
|
135
|
+
auto_instrument=True,
|
|
136
|
+
app_name="my-app",
|
|
137
|
+
environment="production"
|
|
138
|
+
)
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Framework Agnostic
|
|
142
|
+
Works with vanilla SDKs and popular frameworks:
|
|
143
|
+
|
|
144
|
+
```python
|
|
145
|
+
# PydanticAI
|
|
146
|
+
from pydantic_ai import Agent
|
|
147
|
+
agent = Agent("bedrock")
|
|
148
|
+
result = await agent.run("Your prompt")
|
|
149
|
+
|
|
150
|
+
# LangChain
|
|
151
|
+
from langchain_aws import ChatBedrock
|
|
152
|
+
llm = ChatBedrock(model_id="...")
|
|
153
|
+
response = llm.invoke("Your prompt")
|
|
154
|
+
|
|
155
|
+
# Strands Agents
|
|
156
|
+
from strands_agents import Agent
|
|
157
|
+
agent = Agent(provider="bedrock")
|
|
158
|
+
response = agent.execute("Your prompt")
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### Streaming Support
|
|
162
|
+
Fully supports streaming responses with automatic token tracking:
|
|
163
|
+
|
|
164
|
+
```python
|
|
165
|
+
response = client.converse_stream(
|
|
166
|
+
modelId="...",
|
|
167
|
+
messages=[{"role": "user", "content": [{"text": "Tell me a story"}]}]
|
|
168
|
+
)
|
|
169
|
+
|
|
170
|
+
for event in response["stream"]:
|
|
171
|
+
if "contentBlockDelta" in event:
|
|
172
|
+
print(event["contentBlockDelta"]["delta"]["text"], end="")
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
## Configuration
|
|
176
|
+
|
|
177
|
+
```python
|
|
178
|
+
zgrc.init(
|
|
179
|
+
api_key: str, # Your Z-GRC API key (required)
|
|
180
|
+
auto_instrument: bool = False, # Enable auto-instrumentation
|
|
181
|
+
app_name: str = None, # Application name for telemetry
|
|
182
|
+
environment: str = None, # Environment (dev/staging/prod)
|
|
183
|
+
log_level: int = logging.ERROR # Z-GRC internal log level
|
|
184
|
+
)
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
## Building Executables
|
|
188
|
+
|
|
189
|
+
Build standalone executables with PyInstaller:
|
|
190
|
+
|
|
191
|
+
### macOS/Linux
|
|
192
|
+
```bash
|
|
193
|
+
./build.sh
|
|
194
|
+
```
|
|
195
|
+
Output: `dist/z-grc-proxy-macos-arm64` or `dist/z-grc-proxy-linux-x86_64`
|
|
196
|
+
|
|
197
|
+
### Windows
|
|
198
|
+
```bash
|
|
199
|
+
build.bat
|
|
200
|
+
```
|
|
201
|
+
Output: `dist/z-grc-proxy-windows-x64.exe`
|
|
202
|
+
|
|
203
|
+
### Test Executable
|
|
204
|
+
```bash
|
|
205
|
+
# macOS/Linux
|
|
206
|
+
./dist/z-grc-proxy-macos-arm64 --api-key=zgrc_xxx
|
|
207
|
+
|
|
208
|
+
# Windows
|
|
209
|
+
dist\z-grc-proxy-windows-x64.exe --api-key=zgrc_xxx
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
**Note:** Certificates auto-generate in `~/.mitmproxy/` on first run. Users must set `HTTPS_PROXY` and `NODE_EXTRA_CA_CERTS` environment variables.
|
|
213
|
+
|
|
214
|
+
## Installing Executor
|
|
215
|
+
|
|
216
|
+
### macOS / Linux
|
|
217
|
+
```bash
|
|
218
|
+
curl -fsSL https://raw.githubusercontent.com/zeb-ai/z-grc/main/install.sh | bash
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
### Windows (PowerShell)
|
|
222
|
+
```powershell
|
|
223
|
+
irm https://raw.githubusercontent.com/zeb-ai/z-grc/main/install.ps1 | iex
|
|
224
|
+
```
|
z_grc-0.0.14/README.md
ADDED
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
# Z-GRC - Z Governance, Risk, Control Engine
|
|
2
|
+
|
|
3
|
+
[](https://www.python.org/downloads/)
|
|
4
|
+
[](https://github.com/astral-sh/ruff)
|
|
5
|
+
[](https://pypi.org/project/z-grc/)
|
|
6
|
+
[](https://pypi.org/project/z-grc/)
|
|
7
|
+
|
|
8
|
+
[//]: # ([]())
|
|
9
|
+
|
|
10
|
+
Enterprise-grade governance engine for Large Language Model applications. Provides automatic interception, policy enforcement, quota management, and comprehensive observability across multiple LLM providers with zero code changes.
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
uv add z-grc
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Or with auto-instrumentation:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
uv add z-grc[auto-instrument]
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Quick Start
|
|
25
|
+
|
|
26
|
+
```python
|
|
27
|
+
import zgrc
|
|
28
|
+
import boto3
|
|
29
|
+
import json
|
|
30
|
+
|
|
31
|
+
# Initialize GRC
|
|
32
|
+
zgrc.init(api_key="your-zgrc-api-key")
|
|
33
|
+
|
|
34
|
+
# Use your LLM SDK normally - GRC handles everything
|
|
35
|
+
client = boto3.client("bedrock-runtime", region_name="us-east-1")
|
|
36
|
+
|
|
37
|
+
response = client.invoke_model(
|
|
38
|
+
modelId="us.anthropic.claude-sonnet-4-5-20250929-v1:0",
|
|
39
|
+
body=json.dumps({
|
|
40
|
+
"anthropic_version": "bedrock-2023-05-31",
|
|
41
|
+
"max_tokens": 1024,
|
|
42
|
+
"messages": [{"role": "user", "content": "Hello!"}]
|
|
43
|
+
})
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
# Z-GRC automatically:
|
|
47
|
+
# - Validates quota before requests
|
|
48
|
+
# - Tracks token usage
|
|
49
|
+
# - Enforces policies
|
|
50
|
+
# - Sends telemetry (traces, metrics, logs)
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Features
|
|
54
|
+
|
|
55
|
+
### Zero-Code Integration
|
|
56
|
+
Drop-in solution requiring only `zgrc.init()`. Works with existing code without modifications.
|
|
57
|
+
|
|
58
|
+
### Auto-Discovery
|
|
59
|
+
Automatically detects and intercepts installed LLM SDKs:
|
|
60
|
+
- AWS Bedrock (boto3)
|
|
61
|
+
- Anthropic (coming soon)
|
|
62
|
+
- OpenAI (coming soon)
|
|
63
|
+
- Azure OpenAI (coming soon)
|
|
64
|
+
|
|
65
|
+
### Policy Enforcement
|
|
66
|
+
Real-time quota validation and token limit enforcement. Blocks requests when quota is exceeded.
|
|
67
|
+
|
|
68
|
+
```python
|
|
69
|
+
from zgrc.utils import QuotaExceededException
|
|
70
|
+
|
|
71
|
+
try:
|
|
72
|
+
response = client.invoke_model(...)
|
|
73
|
+
except QuotaExceededException as e:
|
|
74
|
+
print(f"Quota exceeded: {e.used}/{e.limit} tokens")
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Auto-Instrumentation
|
|
78
|
+
Optional automatic instrumentation for HTTP clients, web frameworks, databases, and more:
|
|
79
|
+
|
|
80
|
+
```python
|
|
81
|
+
zgrc.init(
|
|
82
|
+
api_key="your-zgrc-api-key",
|
|
83
|
+
auto_instrument=True,
|
|
84
|
+
app_name="my-app",
|
|
85
|
+
environment="production"
|
|
86
|
+
)
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Framework Agnostic
|
|
90
|
+
Works with vanilla SDKs and popular frameworks:
|
|
91
|
+
|
|
92
|
+
```python
|
|
93
|
+
# PydanticAI
|
|
94
|
+
from pydantic_ai import Agent
|
|
95
|
+
agent = Agent("bedrock")
|
|
96
|
+
result = await agent.run("Your prompt")
|
|
97
|
+
|
|
98
|
+
# LangChain
|
|
99
|
+
from langchain_aws import ChatBedrock
|
|
100
|
+
llm = ChatBedrock(model_id="...")
|
|
101
|
+
response = llm.invoke("Your prompt")
|
|
102
|
+
|
|
103
|
+
# Strands Agents
|
|
104
|
+
from strands_agents import Agent
|
|
105
|
+
agent = Agent(provider="bedrock")
|
|
106
|
+
response = agent.execute("Your prompt")
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Streaming Support
|
|
110
|
+
Fully supports streaming responses with automatic token tracking:
|
|
111
|
+
|
|
112
|
+
```python
|
|
113
|
+
response = client.converse_stream(
|
|
114
|
+
modelId="...",
|
|
115
|
+
messages=[{"role": "user", "content": [{"text": "Tell me a story"}]}]
|
|
116
|
+
)
|
|
117
|
+
|
|
118
|
+
for event in response["stream"]:
|
|
119
|
+
if "contentBlockDelta" in event:
|
|
120
|
+
print(event["contentBlockDelta"]["delta"]["text"], end="")
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## Configuration
|
|
124
|
+
|
|
125
|
+
```python
|
|
126
|
+
zgrc.init(
|
|
127
|
+
api_key: str, # Your Z-GRC API key (required)
|
|
128
|
+
auto_instrument: bool = False, # Enable auto-instrumentation
|
|
129
|
+
app_name: str = None, # Application name for telemetry
|
|
130
|
+
environment: str = None, # Environment (dev/staging/prod)
|
|
131
|
+
log_level: int = logging.ERROR # Z-GRC internal log level
|
|
132
|
+
)
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## Building Executables
|
|
136
|
+
|
|
137
|
+
Build standalone executables with PyInstaller:
|
|
138
|
+
|
|
139
|
+
### macOS/Linux
|
|
140
|
+
```bash
|
|
141
|
+
./build.sh
|
|
142
|
+
```
|
|
143
|
+
Output: `dist/z-grc-proxy-macos-arm64` or `dist/z-grc-proxy-linux-x86_64`
|
|
144
|
+
|
|
145
|
+
### Windows
|
|
146
|
+
```bash
|
|
147
|
+
build.bat
|
|
148
|
+
```
|
|
149
|
+
Output: `dist/z-grc-proxy-windows-x64.exe`
|
|
150
|
+
|
|
151
|
+
### Test Executable
|
|
152
|
+
```bash
|
|
153
|
+
# macOS/Linux
|
|
154
|
+
./dist/z-grc-proxy-macos-arm64 --api-key=zgrc_xxx
|
|
155
|
+
|
|
156
|
+
# Windows
|
|
157
|
+
dist\z-grc-proxy-windows-x64.exe --api-key=zgrc_xxx
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
**Note:** Certificates auto-generate in `~/.mitmproxy/` on first run. Users must set `HTTPS_PROXY` and `NODE_EXTRA_CA_CERTS` environment variables.
|
|
161
|
+
|
|
162
|
+
## Installing Executor
|
|
163
|
+
|
|
164
|
+
### macOS / Linux
|
|
165
|
+
```bash
|
|
166
|
+
curl -fsSL https://raw.githubusercontent.com/zeb-ai/z-grc/main/install.sh | bash
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### Windows (PowerShell)
|
|
170
|
+
```powershell
|
|
171
|
+
irm https://raw.githubusercontent.com/zeb-ai/z-grc/main/install.ps1 | iex
|
|
172
|
+
```
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "z-grc"
|
|
3
|
+
version = "0.0.14"
|
|
4
|
+
description = "Governance Engine by zeb labs"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.13"
|
|
7
|
+
license = { file = "LICENSE" }
|
|
8
|
+
classifiers = [
|
|
9
|
+
"License :: OSI Approved :: MIT License",
|
|
10
|
+
"Programming Language :: Python :: 3",
|
|
11
|
+
"Operating System :: OS Independent",
|
|
12
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
13
|
+
"Topic :: System :: Monitoring",
|
|
14
|
+
]
|
|
15
|
+
authors = [
|
|
16
|
+
{ name = "Samrat Damodaran", email = "samrat.damodaran@zeb.co" },
|
|
17
|
+
{ name = "Shriyokesh Thangavel", email = "shriyokesh.thangavel@zeb.co" },
|
|
18
|
+
{ name = "Sid V", email = "sid@zeb.co" },
|
|
19
|
+
{ name = "Madhavsrikrishna Sriram", email = "madhavsrikrishna.sriram@zeb.co" },
|
|
20
|
+
{ name = "Noor Shekumohamed", email = "noor.shekumohamed@zeb.co" },
|
|
21
|
+
{ name = "Arunachalam Gunasekaran", email = "Arun.Gunasekaran@zeb.co" }
|
|
22
|
+
]
|
|
23
|
+
maintainers = [
|
|
24
|
+
{ name = "Samrat Damodaran", email = "samrat.damodaran@zeb.co" },
|
|
25
|
+
{ name = "Shriyokesh Thangavel", email = "shriyokesh.thangavel@zeb.co" },
|
|
26
|
+
{ name = "Sid V", email = "sid@zeb.co" },
|
|
27
|
+
{ name = "Madhavsrikrishna Sriram", email = "madhavsrikrishna.sriram@zeb.co" },
|
|
28
|
+
{ name = "Noor Shekumohamed", email = "noor.shekumohamed@zeb.co" },
|
|
29
|
+
{ name = "Arunachalam Gunasekaran", email = "Arun.Gunasekaran@zeb.co" },]
|
|
30
|
+
keywords = ["governance", "llm", "quota", "policy", "telemetry", "observability"]
|
|
31
|
+
dependencies = [
|
|
32
|
+
"httpx>=0.28.1",
|
|
33
|
+
"mitmproxy>=12.2.1",
|
|
34
|
+
"opentelemetry-api>=1.39.1",
|
|
35
|
+
"opentelemetry-exporter-otlp-proto-http>=1.39.1",
|
|
36
|
+
"opentelemetry-instrumentation>=0.60b1",
|
|
37
|
+
"opentelemetry-instrumentation-httpx>=0.60b1",
|
|
38
|
+
"opentelemetry-instrumentation-threading>=0.60b1",
|
|
39
|
+
"opentelemetry-sdk>=1.39.1",
|
|
40
|
+
"pydantic>=2.12.5",
|
|
41
|
+
"rich>=14.3.3",
|
|
42
|
+
"tenacity>=9.1.4",
|
|
43
|
+
]
|
|
44
|
+
|
|
45
|
+
[project.urls]
|
|
46
|
+
Homepage = "https://github.com/zeb-ai/z-grc"
|
|
47
|
+
Repository = "https://github.com/zeb-ai/z-grc"
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
# DEV dependency only for running example codes and precommit
|
|
51
|
+
[dependency-groups]
|
|
52
|
+
dev = [
|
|
53
|
+
"ruff>=0.15.6",
|
|
54
|
+
"boto3>=1.42.70",
|
|
55
|
+
"pydantic-ai>=1.70.0",
|
|
56
|
+
"strands-agents>=1.30.0",
|
|
57
|
+
"strands-agents-tools>=0.2.22",
|
|
58
|
+
"pre-commit>=4.5.1",
|
|
59
|
+
"pyinstaller>=6.19.0",
|
|
60
|
+
"build>=1.4.3",
|
|
61
|
+
"twine>=6.2.0",
|
|
62
|
+
]
|
|
63
|
+
|
|
64
|
+
# install when instrumentation needed for whole project/application
|
|
65
|
+
auto-instrument = [
|
|
66
|
+
"opentelemetry-instrumentation-fastapi>=0.49b0,<0.61b0",
|
|
67
|
+
"opentelemetry-instrumentation-flask>=0.49b0,<0.61b0",
|
|
68
|
+
"opentelemetry-instrumentation-starlette>=0.49b0,<0.61b0",
|
|
69
|
+
|
|
70
|
+
"opentelemetry-instrumentation-requests>=0.49b0,<0.61b0",
|
|
71
|
+
"opentelemetry-instrumentation-aiohttp-client>=0.49b0,<0.61b0",
|
|
72
|
+
"opentelemetry-instrumentation-urllib3>=0.49b0,<0.61b0",
|
|
73
|
+
|
|
74
|
+
"opentelemetry-instrumentation-psycopg2>=0.49b0,<0.61b0",
|
|
75
|
+
"opentelemetry-instrumentation-psycopg>=0.49b0,<0.61b0",
|
|
76
|
+
"opentelemetry-instrumentation-sqlalchemy>=0.49b0,<0.61b0",
|
|
77
|
+
"opentelemetry-instrumentation-redis>=0.49b0,<0.61b0",
|
|
78
|
+
"opentelemetry-instrumentation-pymongo>=0.49b0,<0.61b0",
|
|
79
|
+
|
|
80
|
+
"opentelemetry-instrumentation-botocore>=0.49b0,<0.61b0",
|
|
81
|
+
"opentelemetry-instrumentation-boto3sqs>=0.49b0,<0.61b0",
|
|
82
|
+
|
|
83
|
+
"opentelemetry-instrumentation-celery>=0.49b0,<0.61b0",
|
|
84
|
+
|
|
85
|
+
"opentelemetry-instrumentation-logging>=0.49b0,<0.61b0",
|
|
86
|
+
"opentelemetry-instrumentation-system-metrics>=0.49b0,<0.61b0",
|
|
87
|
+
]
|
|
88
|
+
|
|
89
|
+
[project.scripts]
|
|
90
|
+
grc-proxy = "grc.proxy.main:main"
|
z_grc-0.0.14/setup.cfg
ADDED