aeonic-agentguard-sdk-python 0.1.1__tar.gz → 0.1.4__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 (29) hide show
  1. {aeonic_agentguard_sdk_python-0.1.1 → aeonic_agentguard_sdk_python-0.1.4}/PKG-INFO +1 -3
  2. {aeonic_agentguard_sdk_python-0.1.1 → aeonic_agentguard_sdk_python-0.1.4}/aeonic/__init__.py +1 -1
  3. {aeonic_agentguard_sdk_python-0.1.1 → aeonic_agentguard_sdk_python-0.1.4}/aeonic/adapters/django.py +10 -6
  4. {aeonic_agentguard_sdk_python-0.1.1 → aeonic_agentguard_sdk_python-0.1.4}/aeonic/adapters/fastapi.py +12 -6
  5. {aeonic_agentguard_sdk_python-0.1.1 → aeonic_agentguard_sdk_python-0.1.4}/aeonic/core/assessment/executor.py +8 -4
  6. {aeonic_agentguard_sdk_python-0.1.1 → aeonic_agentguard_sdk_python-0.1.4}/aeonic/core/sender.py +23 -13
  7. {aeonic_agentguard_sdk_python-0.1.1 → aeonic_agentguard_sdk_python-0.1.4}/aeonic_agentguard_sdk_python.egg-info/PKG-INFO +1 -3
  8. {aeonic_agentguard_sdk_python-0.1.1 → aeonic_agentguard_sdk_python-0.1.4}/pyproject.toml +1 -5
  9. {aeonic_agentguard_sdk_python-0.1.1 → aeonic_agentguard_sdk_python-0.1.4}/LICENSE +0 -0
  10. {aeonic_agentguard_sdk_python-0.1.1 → aeonic_agentguard_sdk_python-0.1.4}/README.md +0 -0
  11. {aeonic_agentguard_sdk_python-0.1.1 → aeonic_agentguard_sdk_python-0.1.4}/aeonic/adapters/__init__.py +0 -0
  12. {aeonic_agentguard_sdk_python-0.1.1 → aeonic_agentguard_sdk_python-0.1.4}/aeonic/core/__init__.py +0 -0
  13. {aeonic_agentguard_sdk_python-0.1.1 → aeonic_agentguard_sdk_python-0.1.4}/aeonic/core/agent_registry.py +0 -0
  14. {aeonic_agentguard_sdk_python-0.1.1 → aeonic_agentguard_sdk_python-0.1.4}/aeonic/core/agent_status_cache.py +0 -0
  15. {aeonic_agentguard_sdk_python-0.1.1 → aeonic_agentguard_sdk_python-0.1.4}/aeonic/core/agentguard/__init__.py +0 -0
  16. {aeonic_agentguard_sdk_python-0.1.1 → aeonic_agentguard_sdk_python-0.1.4}/aeonic/core/agentguard/registration.py +0 -0
  17. {aeonic_agentguard_sdk_python-0.1.1 → aeonic_agentguard_sdk_python-0.1.4}/aeonic/core/agentguard/sse_client.py +0 -0
  18. {aeonic_agentguard_sdk_python-0.1.1 → aeonic_agentguard_sdk_python-0.1.4}/aeonic/core/assessment/__init__.py +0 -0
  19. {aeonic_agentguard_sdk_python-0.1.1 → aeonic_agentguard_sdk_python-0.1.4}/aeonic/core/buffer.py +0 -0
  20. {aeonic_agentguard_sdk_python-0.1.1 → aeonic_agentguard_sdk_python-0.1.4}/aeonic/core/init.py +0 -0
  21. {aeonic_agentguard_sdk_python-0.1.1 → aeonic_agentguard_sdk_python-0.1.4}/aeonic/core/introspection.py +0 -0
  22. {aeonic_agentguard_sdk_python-0.1.1 → aeonic_agentguard_sdk_python-0.1.4}/aeonic/core/types.py +0 -0
  23. {aeonic_agentguard_sdk_python-0.1.1 → aeonic_agentguard_sdk_python-0.1.4}/aeonic/utils/__init__.py +0 -0
  24. {aeonic_agentguard_sdk_python-0.1.1 → aeonic_agentguard_sdk_python-0.1.4}/aeonic/utils/safe_serialize.py +0 -0
  25. {aeonic_agentguard_sdk_python-0.1.1 → aeonic_agentguard_sdk_python-0.1.4}/aeonic_agentguard_sdk_python.egg-info/SOURCES.txt +0 -0
  26. {aeonic_agentguard_sdk_python-0.1.1 → aeonic_agentguard_sdk_python-0.1.4}/aeonic_agentguard_sdk_python.egg-info/dependency_links.txt +0 -0
  27. {aeonic_agentguard_sdk_python-0.1.1 → aeonic_agentguard_sdk_python-0.1.4}/aeonic_agentguard_sdk_python.egg-info/requires.txt +0 -0
  28. {aeonic_agentguard_sdk_python-0.1.1 → aeonic_agentguard_sdk_python-0.1.4}/aeonic_agentguard_sdk_python.egg-info/top_level.txt +0 -0
  29. {aeonic_agentguard_sdk_python-0.1.1 → aeonic_agentguard_sdk_python-0.1.4}/setup.cfg +0 -0
@@ -1,13 +1,11 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aeonic-agentguard-sdk-python
3
- Version: 0.1.1
3
+ Version: 0.1.4
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
7
7
  Project-URL: Homepage, http://45.79.111.106:3290/doc/sdk/python
8
8
  Project-URL: Documentation, http://45.79.111.106:3290/doc/sdk/python
9
- Project-URL: Repository, https://github.com/aeonic/aeonic-sdk-python
10
- Project-URL: Issues, https://github.com/aeonic/aeonic-sdk-python/issues
11
9
  Keywords: ai,agent,agentic-ai,sdk,monitoring,governance,llm,fastapi,django,middleware
12
10
  Classifier: Development Status :: 3 - Alpha
13
11
  Classifier: Programming Language :: Python :: 3
@@ -1,4 +1,4 @@
1
- __version__ = "0.1.1"
1
+ __version__ = "0.1.4"
2
2
 
3
3
  from aeonic.core.init import init
4
4
 
@@ -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
- # Log for debugging (optional)
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
- job_id_str = str(job_id) if job_id else ""
50
- print(
51
- f"[Aeonic] Skipping sample collection for assessment"
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
- print(f"[Aeonic] Skipping sample collection for blocked agent: {agent_key}")
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"))
@@ -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
- # Log for debugging (optional)
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
- job_id_str = str(job_id) if job_id else ""
61
- print(
62
- f"[Aeonic] Skipping sample collection for assessment"
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
- print(f"[Aeonic] Skipping sample collection for blocked agent: {agent_key}")
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)
@@ -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
- print("URL=================>", url)
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
- print("PAYLOAD=================>", payload)
178
- print("URL=================>", url)
179
- print("CREDENTIALS=================>", credentials)
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")
@@ -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
- print("[Aeonic] Agent error sample emitted successfully")
97
+ logger.debug("[Aeonic] Agent error sample emitted successfully")
98
98
  else:
99
99
  if os.environ.get("AEONIC_DEBUG"):
100
- print(
101
- f"[Aeonic] Failed to emit agent error sample: {response_data.get('message')}"
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
- print(f"[Aeonic] Failed to emit agent error sample: {err}")
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
- print("[Aeonic] Agent samples emitted successfully")
171
+ if os.environ.get("AEONIC_DEBUG"):
172
+ logger.debug("[Aeonic] Agent samples emitted successfully")
171
173
  else:
172
- print(
173
- f"[Aeonic] Failed to emit agent samples: {response_data.get('message')}"
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
- print(f"[Aeonic] Failed to emit agent samples: {err}")
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
- print(f"[Aeonic] Emitting agent inventory to {url}")
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
- print("[Aeonic] Agent inventory emitted successfully")
227
+ if os.environ.get("AEONIC_DEBUG"):
228
+ logger.debug("[Aeonic] Agent inventory emitted successfully")
223
229
  return True
224
230
  else:
225
- print(f"[Aeonic] Failed to emit agent inventory: {response_data.get('message')}")
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
- print(f"[Aeonic] Failed to emit agent inventory: {err}")
242
+ logger.debug("[Aeonic] Failed to emit agent inventory: %s", err)
233
243
 
234
244
  raise err
@@ -1,13 +1,11 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aeonic-agentguard-sdk-python
3
- Version: 0.1.1
3
+ Version: 0.1.4
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
7
7
  Project-URL: Homepage, http://45.79.111.106:3290/doc/sdk/python
8
8
  Project-URL: Documentation, http://45.79.111.106:3290/doc/sdk/python
9
- Project-URL: Repository, https://github.com/aeonic/aeonic-sdk-python
10
- Project-URL: Issues, https://github.com/aeonic/aeonic-sdk-python/issues
11
9
  Keywords: ai,agent,agentic-ai,sdk,monitoring,governance,llm,fastapi,django,middleware
12
10
  Classifier: Development Status :: 3 - Alpha
13
11
  Classifier: Programming Language :: Python :: 3
@@ -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.1"
8
+ version = "0.1.4"
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" }
@@ -58,10 +58,6 @@ dev = [
58
58
  [project.urls]
59
59
  Homepage = "http://45.79.111.106:3290/doc/sdk/python"
60
60
  Documentation = "http://45.79.111.106:3290/doc/sdk/python"
61
- Repository = "https://github.com/aeonic/aeonic-sdk-python"
62
- Issues = "https://github.com/aeonic/aeonic-sdk-python/issues"
63
-
64
-
65
61
 
66
62
  # =========================
67
63
  # TOOLING (QUALITY CHECKS)