aeonic-agentguard-sdk-python 0.1.0__tar.gz → 0.1.2__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.
- {aeonic_agentguard_sdk_python-0.1.0 → aeonic_agentguard_sdk_python-0.1.2}/PKG-INFO +7 -7
- {aeonic_agentguard_sdk_python-0.1.0 → aeonic_agentguard_sdk_python-0.1.2}/README.md +6 -6
- {aeonic_agentguard_sdk_python-0.1.0 → aeonic_agentguard_sdk_python-0.1.2}/aeonic/__init__.py +1 -1
- {aeonic_agentguard_sdk_python-0.1.0 → aeonic_agentguard_sdk_python-0.1.2}/aeonic/adapters/django.py +10 -6
- {aeonic_agentguard_sdk_python-0.1.0 → aeonic_agentguard_sdk_python-0.1.2}/aeonic/adapters/fastapi.py +12 -6
- {aeonic_agentguard_sdk_python-0.1.0 → aeonic_agentguard_sdk_python-0.1.2}/aeonic/core/agentguard/registration.py +1 -1
- {aeonic_agentguard_sdk_python-0.1.0 → aeonic_agentguard_sdk_python-0.1.2}/aeonic/core/assessment/executor.py +8 -4
- {aeonic_agentguard_sdk_python-0.1.0 → aeonic_agentguard_sdk_python-0.1.2}/aeonic/core/sender.py +23 -13
- {aeonic_agentguard_sdk_python-0.1.0 → aeonic_agentguard_sdk_python-0.1.2}/aeonic_agentguard_sdk_python.egg-info/PKG-INFO +7 -7
- {aeonic_agentguard_sdk_python-0.1.0 → aeonic_agentguard_sdk_python-0.1.2}/pyproject.toml +1 -1
- {aeonic_agentguard_sdk_python-0.1.0 → aeonic_agentguard_sdk_python-0.1.2}/LICENSE +0 -0
- {aeonic_agentguard_sdk_python-0.1.0 → aeonic_agentguard_sdk_python-0.1.2}/aeonic/adapters/__init__.py +0 -0
- {aeonic_agentguard_sdk_python-0.1.0 → aeonic_agentguard_sdk_python-0.1.2}/aeonic/core/__init__.py +0 -0
- {aeonic_agentguard_sdk_python-0.1.0 → aeonic_agentguard_sdk_python-0.1.2}/aeonic/core/agent_registry.py +0 -0
- {aeonic_agentguard_sdk_python-0.1.0 → aeonic_agentguard_sdk_python-0.1.2}/aeonic/core/agent_status_cache.py +0 -0
- {aeonic_agentguard_sdk_python-0.1.0 → aeonic_agentguard_sdk_python-0.1.2}/aeonic/core/agentguard/__init__.py +0 -0
- {aeonic_agentguard_sdk_python-0.1.0 → aeonic_agentguard_sdk_python-0.1.2}/aeonic/core/agentguard/sse_client.py +0 -0
- {aeonic_agentguard_sdk_python-0.1.0 → aeonic_agentguard_sdk_python-0.1.2}/aeonic/core/assessment/__init__.py +0 -0
- {aeonic_agentguard_sdk_python-0.1.0 → aeonic_agentguard_sdk_python-0.1.2}/aeonic/core/buffer.py +0 -0
- {aeonic_agentguard_sdk_python-0.1.0 → aeonic_agentguard_sdk_python-0.1.2}/aeonic/core/init.py +0 -0
- {aeonic_agentguard_sdk_python-0.1.0 → aeonic_agentguard_sdk_python-0.1.2}/aeonic/core/introspection.py +0 -0
- {aeonic_agentguard_sdk_python-0.1.0 → aeonic_agentguard_sdk_python-0.1.2}/aeonic/core/types.py +0 -0
- {aeonic_agentguard_sdk_python-0.1.0 → aeonic_agentguard_sdk_python-0.1.2}/aeonic/utils/__init__.py +0 -0
- {aeonic_agentguard_sdk_python-0.1.0 → aeonic_agentguard_sdk_python-0.1.2}/aeonic/utils/safe_serialize.py +0 -0
- {aeonic_agentguard_sdk_python-0.1.0 → aeonic_agentguard_sdk_python-0.1.2}/aeonic_agentguard_sdk_python.egg-info/SOURCES.txt +0 -0
- {aeonic_agentguard_sdk_python-0.1.0 → aeonic_agentguard_sdk_python-0.1.2}/aeonic_agentguard_sdk_python.egg-info/dependency_links.txt +0 -0
- {aeonic_agentguard_sdk_python-0.1.0 → aeonic_agentguard_sdk_python-0.1.2}/aeonic_agentguard_sdk_python.egg-info/requires.txt +0 -0
- {aeonic_agentguard_sdk_python-0.1.0 → aeonic_agentguard_sdk_python-0.1.2}/aeonic_agentguard_sdk_python.egg-info/top_level.txt +0 -0
- {aeonic_agentguard_sdk_python-0.1.0 → aeonic_agentguard_sdk_python-0.1.2}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: aeonic-agentguard-sdk-python
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.2
|
|
4
4
|
Summary: Official Python SDK for Aeonic — runtime monitoring and governance for AI agents
|
|
5
5
|
Author-email: Aeonic <support@aeonic.ai>
|
|
6
6
|
License: MIT
|
|
@@ -63,20 +63,20 @@ The SDK is:
|
|
|
63
63
|
Install the base SDK (core only — `requests` is included):
|
|
64
64
|
|
|
65
65
|
```bash
|
|
66
|
-
pip install aeonic-sdk-python
|
|
66
|
+
pip install aeonic-agentguard-sdk-python
|
|
67
67
|
```
|
|
68
68
|
|
|
69
69
|
Install with your framework (recommended):
|
|
70
70
|
|
|
71
71
|
```bash
|
|
72
72
|
# FastAPI
|
|
73
|
-
pip install aeonic-sdk-python[fastapi]
|
|
73
|
+
pip install aeonic-agentguard-sdk-python[fastapi]
|
|
74
74
|
|
|
75
75
|
# Django
|
|
76
|
-
pip install aeonic-sdk-python[django]
|
|
76
|
+
pip install aeonic-agentguard-sdk-python[django]
|
|
77
77
|
```
|
|
78
78
|
|
|
79
|
-
> **Note:** The PyPI package name is `aeonic-sdk-python`, but you import it as `aeonic`.
|
|
79
|
+
> **Note:** The PyPI package name is `aeonic-agentguard-sdk-python`, but you import it as `aeonic`.
|
|
80
80
|
|
|
81
81
|
Check the installed version:
|
|
82
82
|
|
|
@@ -420,9 +420,9 @@ Call `init({...})` once at application startup before any SDK features are used.
|
|
|
420
420
|
Install the matching framework extra:
|
|
421
421
|
|
|
422
422
|
```bash
|
|
423
|
-
pip install aeonic-sdk-python[fastapi]
|
|
423
|
+
pip install aeonic-agentguard-sdk-python[fastapi]
|
|
424
424
|
# or
|
|
425
|
-
pip install aeonic-sdk-python[django]
|
|
425
|
+
pip install aeonic-agentguard-sdk-python[django]
|
|
426
426
|
```
|
|
427
427
|
|
|
428
428
|
### Agent inventory not emitted at startup
|
|
@@ -30,20 +30,20 @@ The SDK is:
|
|
|
30
30
|
Install the base SDK (core only — `requests` is included):
|
|
31
31
|
|
|
32
32
|
```bash
|
|
33
|
-
pip install aeonic-sdk-python
|
|
33
|
+
pip install aeonic-agentguard-sdk-python
|
|
34
34
|
```
|
|
35
35
|
|
|
36
36
|
Install with your framework (recommended):
|
|
37
37
|
|
|
38
38
|
```bash
|
|
39
39
|
# FastAPI
|
|
40
|
-
pip install aeonic-sdk-python[fastapi]
|
|
40
|
+
pip install aeonic-agentguard-sdk-python[fastapi]
|
|
41
41
|
|
|
42
42
|
# Django
|
|
43
|
-
pip install aeonic-sdk-python[django]
|
|
43
|
+
pip install aeonic-agentguard-sdk-python[django]
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
-
> **Note:** The PyPI package name is `aeonic-sdk-python`, but you import it as `aeonic`.
|
|
46
|
+
> **Note:** The PyPI package name is `aeonic-agentguard-sdk-python`, but you import it as `aeonic`.
|
|
47
47
|
|
|
48
48
|
Check the installed version:
|
|
49
49
|
|
|
@@ -387,9 +387,9 @@ Call `init({...})` once at application startup before any SDK features are used.
|
|
|
387
387
|
Install the matching framework extra:
|
|
388
388
|
|
|
389
389
|
```bash
|
|
390
|
-
pip install aeonic-sdk-python[fastapi]
|
|
390
|
+
pip install aeonic-agentguard-sdk-python[fastapi]
|
|
391
391
|
# or
|
|
392
|
-
pip install aeonic-sdk-python[django]
|
|
392
|
+
pip install aeonic-agentguard-sdk-python[django]
|
|
393
393
|
```
|
|
394
394
|
|
|
395
395
|
### Agent inventory not emitted at startup
|
{aeonic_agentguard_sdk_python-0.1.0 → aeonic_agentguard_sdk_python-0.1.2}/aeonic/adapters/django.py
RENAMED
|
@@ -41,15 +41,15 @@ class agent_middleware:
|
|
|
41
41
|
assessment_header = request.META.get("HTTP_X_AEONIC_ASSESSMENT")
|
|
42
42
|
is_assessment = assessment_header is not None and str(assessment_header).lower() == "true"
|
|
43
43
|
if is_assessment:
|
|
44
|
-
#
|
|
44
|
+
# Debug-only log (avoid printing backend URLs or noisy output)
|
|
45
|
+
import logging
|
|
45
46
|
import os
|
|
46
47
|
|
|
47
48
|
if os.environ.get("AEONIC_DEBUG"):
|
|
48
49
|
job_id = request.META.get("HTTP_X_AEONIC_JOB_ID")
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
f"{f' (job: {job_id_str})' if job_id_str else ''}"
|
|
50
|
+
logging.getLogger("aeonic").debug(
|
|
51
|
+
"[Aeonic] Skipping sample collection for assessment (job_id=%s)",
|
|
52
|
+
str(job_id) if job_id else None,
|
|
53
53
|
)
|
|
54
54
|
return response # Skip sample collection
|
|
55
55
|
|
|
@@ -62,10 +62,14 @@ class agent_middleware:
|
|
|
62
62
|
|
|
63
63
|
agent_key: str = agent.get("name") or f"{method}:{path}"
|
|
64
64
|
if not should_collect_samples(agent_key):
|
|
65
|
+
import logging
|
|
65
66
|
import os
|
|
66
67
|
|
|
67
68
|
if os.environ.get("AEONIC_DEBUG"):
|
|
68
|
-
|
|
69
|
+
logging.getLogger("aeonic").debug(
|
|
70
|
+
"[Aeonic] Skipping sample collection for blocked agent (agent_key=%s)",
|
|
71
|
+
agent_key,
|
|
72
|
+
)
|
|
69
73
|
return response
|
|
70
74
|
|
|
71
75
|
req_payload = safe_serialize(aeonic.get("req_payload"))
|
{aeonic_agentguard_sdk_python-0.1.0 → aeonic_agentguard_sdk_python-0.1.2}/aeonic/adapters/fastapi.py
RENAMED
|
@@ -52,15 +52,15 @@ class agent_middleware(BaseHTTPMiddleware):
|
|
|
52
52
|
assessment_header = request.headers.get("x-aeonic-assessment")
|
|
53
53
|
is_assessment = assessment_header is not None and str(assessment_header).lower() == "true"
|
|
54
54
|
if is_assessment:
|
|
55
|
-
#
|
|
55
|
+
# Debug-only log (avoid printing backend URLs or noisy output)
|
|
56
|
+
import logging
|
|
56
57
|
import os
|
|
57
58
|
|
|
58
59
|
if os.environ.get("AEONIC_DEBUG"):
|
|
59
60
|
job_id = request.headers.get("x-aeonic-job-id")
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
f"{f' (job: {job_id_str})' if job_id_str else ''}"
|
|
61
|
+
logging.getLogger("aeonic").debug(
|
|
62
|
+
"[Aeonic] Skipping sample collection for assessment (job_id=%s)",
|
|
63
|
+
str(job_id) if job_id else None,
|
|
64
64
|
)
|
|
65
65
|
return response # Skip sample collection
|
|
66
66
|
|
|
@@ -73,8 +73,14 @@ class agent_middleware(BaseHTTPMiddleware):
|
|
|
73
73
|
|
|
74
74
|
agent_key: str = agent.get("name") or f"{method}:{path}"
|
|
75
75
|
if not should_collect_samples(agent_key):
|
|
76
|
+
import logging
|
|
77
|
+
import os
|
|
78
|
+
|
|
76
79
|
if os.environ.get("AEONIC_DEBUG"):
|
|
77
|
-
|
|
80
|
+
logging.getLogger("aeonic").debug(
|
|
81
|
+
"[Aeonic] Skipping sample collection for blocked agent (agent_key=%s)",
|
|
82
|
+
agent_key,
|
|
83
|
+
)
|
|
78
84
|
return response
|
|
79
85
|
|
|
80
86
|
# Request payload (attempt to get from state first, which is populated by dependency)
|
|
@@ -39,7 +39,7 @@ def register_agent_guard() -> Dict[str, Any]:
|
|
|
39
39
|
|
|
40
40
|
payload = {
|
|
41
41
|
"api_key": config["api_key"],
|
|
42
|
-
"agentguard_version": "0.1.
|
|
42
|
+
"agentguard_version": "0.1.1",
|
|
43
43
|
"capabilities": ["red-team", "leakage", "safety"],
|
|
44
44
|
"service_name": config.get("service_name"),
|
|
45
45
|
}
|
|
@@ -118,7 +118,8 @@ def _call_agent_endpoint(
|
|
|
118
118
|
port = os.environ.get("PORT") or os.environ.get("APP_PORT") or "8000"
|
|
119
119
|
|
|
120
120
|
url = f"http://localhost:{port}{api_url}"
|
|
121
|
-
|
|
121
|
+
if os.environ.get("AEONIC_DEBUG"):
|
|
122
|
+
logger.debug("[Aeonic] Calling local agent endpoint")
|
|
122
123
|
|
|
123
124
|
req = urllib.request.Request(url, data=data, headers=headers, method=method)
|
|
124
125
|
|
|
@@ -174,9 +175,12 @@ def _submit_assessment_results(
|
|
|
174
175
|
},
|
|
175
176
|
}
|
|
176
177
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
178
|
+
if os.environ.get("AEONIC_DEBUG"):
|
|
179
|
+
logger.debug(
|
|
180
|
+
"[Aeonic] Submitting assessment results (job_id=%s, steps=%s)",
|
|
181
|
+
job.get("job_id"),
|
|
182
|
+
len(results),
|
|
183
|
+
)
|
|
180
184
|
|
|
181
185
|
try:
|
|
182
186
|
data = json.dumps(payload).encode("utf-8")
|
{aeonic_agentguard_sdk_python-0.1.0 → aeonic_agentguard_sdk_python-0.1.2}/aeonic/core/sender.py
RENAMED
|
@@ -94,15 +94,16 @@ def emit_error_sample(payload: Dict[str, Any]) -> None:
|
|
|
94
94
|
response_data = json.loads(response.read())
|
|
95
95
|
if response_data.get("success"):
|
|
96
96
|
if os.environ.get("AEONIC_DEBUG"):
|
|
97
|
-
|
|
97
|
+
logger.debug("[Aeonic] Agent error sample emitted successfully")
|
|
98
98
|
else:
|
|
99
99
|
if os.environ.get("AEONIC_DEBUG"):
|
|
100
|
-
|
|
101
|
-
|
|
100
|
+
logger.debug(
|
|
101
|
+
"[Aeonic] Failed to emit agent error sample: %s",
|
|
102
|
+
response_data.get("message"),
|
|
102
103
|
)
|
|
103
104
|
except Exception as err:
|
|
104
105
|
if os.environ.get("AEONIC_DEBUG"):
|
|
105
|
-
|
|
106
|
+
logger.debug("[Aeonic] Failed to emit agent error sample: %s", err)
|
|
106
107
|
|
|
107
108
|
t = threading.Thread(target=_send)
|
|
108
109
|
t.daemon = True
|
|
@@ -167,16 +168,19 @@ def _process_queue_worker() -> None:
|
|
|
167
168
|
with urllib.request.urlopen(req, timeout=100) as response:
|
|
168
169
|
response_data = json.loads(response.read())
|
|
169
170
|
if response_data.get("success"):
|
|
170
|
-
|
|
171
|
+
if os.environ.get("AEONIC_DEBUG"):
|
|
172
|
+
logger.debug("[Aeonic] Agent samples emitted successfully")
|
|
171
173
|
else:
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
174
|
+
if os.environ.get("AEONIC_DEBUG"):
|
|
175
|
+
logger.debug(
|
|
176
|
+
"[Aeonic] Failed to emit agent samples: %s",
|
|
177
|
+
response_data.get("message"),
|
|
178
|
+
)
|
|
175
179
|
|
|
176
180
|
except Exception as err:
|
|
177
181
|
if os.environ.get("AEONIC_DEBUG"):
|
|
178
182
|
# TS: console.error(...)
|
|
179
|
-
|
|
183
|
+
logger.debug("[Aeonic] Failed to emit agent samples: %s", err)
|
|
180
184
|
|
|
181
185
|
# retry later (simple strategy for v1)
|
|
182
186
|
# TS: queue.push(payload!)
|
|
@@ -213,22 +217,28 @@ def emit_agent_inventory(payload: Dict[str, Any]) -> bool:
|
|
|
213
217
|
url = f"{_get_endpoint()}/sdk/agent-inventory"
|
|
214
218
|
data = json.dumps(payload).encode("utf-8")
|
|
215
219
|
|
|
216
|
-
|
|
220
|
+
if os.environ.get("AEONIC_DEBUG"):
|
|
221
|
+
logger.debug("[Aeonic] Emitting agent inventory")
|
|
217
222
|
req = urllib.request.Request(url, data=data, headers=headers, method="POST")
|
|
218
223
|
|
|
219
224
|
with urllib.request.urlopen(req, timeout=100) as response:
|
|
220
225
|
response_data = json.loads(response.read())
|
|
221
226
|
if response_data.get("success"):
|
|
222
|
-
|
|
227
|
+
if os.environ.get("AEONIC_DEBUG"):
|
|
228
|
+
logger.debug("[Aeonic] Agent inventory emitted successfully")
|
|
223
229
|
return True
|
|
224
230
|
else:
|
|
225
|
-
|
|
231
|
+
if os.environ.get("AEONIC_DEBUG"):
|
|
232
|
+
logger.debug(
|
|
233
|
+
"[Aeonic] Failed to emit agent inventory: %s",
|
|
234
|
+
response_data.get("message"),
|
|
235
|
+
)
|
|
226
236
|
return False
|
|
227
237
|
|
|
228
238
|
except Exception as err:
|
|
229
239
|
# Silently fail - do NOT break startup
|
|
230
240
|
# Log for debugging purposes only
|
|
231
241
|
if os.environ.get("AEONIC_DEBUG"):
|
|
232
|
-
|
|
242
|
+
logger.debug("[Aeonic] Failed to emit agent inventory: %s", err)
|
|
233
243
|
|
|
234
244
|
raise err
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: aeonic-agentguard-sdk-python
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.2
|
|
4
4
|
Summary: Official Python SDK for Aeonic — runtime monitoring and governance for AI agents
|
|
5
5
|
Author-email: Aeonic <support@aeonic.ai>
|
|
6
6
|
License: MIT
|
|
@@ -63,20 +63,20 @@ The SDK is:
|
|
|
63
63
|
Install the base SDK (core only — `requests` is included):
|
|
64
64
|
|
|
65
65
|
```bash
|
|
66
|
-
pip install aeonic-sdk-python
|
|
66
|
+
pip install aeonic-agentguard-sdk-python
|
|
67
67
|
```
|
|
68
68
|
|
|
69
69
|
Install with your framework (recommended):
|
|
70
70
|
|
|
71
71
|
```bash
|
|
72
72
|
# FastAPI
|
|
73
|
-
pip install aeonic-sdk-python[fastapi]
|
|
73
|
+
pip install aeonic-agentguard-sdk-python[fastapi]
|
|
74
74
|
|
|
75
75
|
# Django
|
|
76
|
-
pip install aeonic-sdk-python[django]
|
|
76
|
+
pip install aeonic-agentguard-sdk-python[django]
|
|
77
77
|
```
|
|
78
78
|
|
|
79
|
-
> **Note:** The PyPI package name is `aeonic-sdk-python`, but you import it as `aeonic`.
|
|
79
|
+
> **Note:** The PyPI package name is `aeonic-agentguard-sdk-python`, but you import it as `aeonic`.
|
|
80
80
|
|
|
81
81
|
Check the installed version:
|
|
82
82
|
|
|
@@ -420,9 +420,9 @@ Call `init({...})` once at application startup before any SDK features are used.
|
|
|
420
420
|
Install the matching framework extra:
|
|
421
421
|
|
|
422
422
|
```bash
|
|
423
|
-
pip install aeonic-sdk-python[fastapi]
|
|
423
|
+
pip install aeonic-agentguard-sdk-python[fastapi]
|
|
424
424
|
# or
|
|
425
|
-
pip install aeonic-sdk-python[django]
|
|
425
|
+
pip install aeonic-agentguard-sdk-python[django]
|
|
426
426
|
```
|
|
427
427
|
|
|
428
428
|
### Agent inventory not emitted at startup
|
|
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
|
|
|
5
5
|
|
|
6
6
|
[project]
|
|
7
7
|
name = "aeonic-agentguard-sdk-python"
|
|
8
|
-
version = "0.1.
|
|
8
|
+
version = "0.1.2"
|
|
9
9
|
description = "Official Python SDK for Aeonic — runtime monitoring and governance for AI agents"
|
|
10
10
|
readme = "README.md"
|
|
11
11
|
license = { text = "MIT" }
|
|
File without changes
|
|
File without changes
|
{aeonic_agentguard_sdk_python-0.1.0 → aeonic_agentguard_sdk_python-0.1.2}/aeonic/core/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{aeonic_agentguard_sdk_python-0.1.0 → aeonic_agentguard_sdk_python-0.1.2}/aeonic/core/buffer.py
RENAMED
|
File without changes
|
{aeonic_agentguard_sdk_python-0.1.0 → aeonic_agentguard_sdk_python-0.1.2}/aeonic/core/init.py
RENAMED
|
File without changes
|
|
File without changes
|
{aeonic_agentguard_sdk_python-0.1.0 → aeonic_agentguard_sdk_python-0.1.2}/aeonic/core/types.py
RENAMED
|
File without changes
|
{aeonic_agentguard_sdk_python-0.1.0 → aeonic_agentguard_sdk_python-0.1.2}/aeonic/utils/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|