atbash-hermes-plugin 0.1.5.dev1__tar.gz → 0.1.7__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: atbash-hermes-plugin
3
- Version: 0.1.5.dev1
3
+ Version: 0.1.7
4
4
  Summary: Atbash safety plugin for Hermes Agent
5
5
  Author: atbash
6
6
  License-Expression: LicenseRef-Atbash-Proprietary
@@ -10,8 +10,9 @@ Keywords: atbash,hermes,hermes-agent,agent-safety,ai-safety,tool-guard,judge,pol
10
10
  Requires-Python: >=3.10
11
11
  Description-Content-Type: text/markdown
12
12
  License-File: LICENSE
13
- Requires-Dist: atbash-sdk==0.1.5.dev0
14
- Requires-Dist: httpx<1,>=0.27
13
+ Requires-Dist: atbash-sdk==0.1.7
14
+ Requires-Dist: opentelemetry-exporter-otlp-proto-http<2,>=1.29
15
+ Requires-Dist: opentelemetry-sdk<2,>=1.29
15
16
  Dynamic: license-file
16
17
 
17
18
  # Atbash Hermes Plugin
@@ -36,13 +37,13 @@ stopped before execution.
36
37
  Install the plugin into the same Python environment that runs Hermes:
37
38
 
38
39
  ```bash
39
- pip install --pre atbash-hermes-plugin==0.1.5.dev1
40
+ pip install atbash-hermes-plugin==0.1.7
40
41
  ```
41
42
 
42
43
  If Hermes is installed in a virtual environment, use that environment's Python:
43
44
 
44
45
  ```bash
45
- /path/to/hermes/venv/bin/python -m pip install --pre atbash-hermes-plugin==0.1.5.dev1
46
+ /path/to/hermes/venv/bin/python -m pip install atbash-hermes-plugin==0.1.7
46
47
  ```
47
48
 
48
49
  ## Configure Atbash
@@ -118,6 +119,19 @@ ATBASH_ORG_NAME=your-org-name
118
119
  ATBASH_TOOL_MAP_PATH=$HOME/.config/atbash/hermes-tool-map.json
119
120
  ```
120
121
 
122
+ ## Telemetry
123
+
124
+ The plugin initializes the Atbash Python SDK OpenTelemetry metrics with
125
+ `source="plugin:hermes"`, matching the pattern used by the OpenClaw plugin.
126
+ Telemetry is best-effort and never blocks guard registration or tool execution.
127
+
128
+ The Python SDK telemetry opt-out is file-based. To disable telemetry, create:
129
+
130
+ ```bash
131
+ mkdir -p ~/.config/atbash
132
+ printf '{"enabled": false}\n' > ~/.config/atbash/telemetry.json
133
+ ```
134
+
121
135
  ## Enable Or Check The Plugin
122
136
 
123
137
  Hermes should discover installed Python packages that expose the
@@ -20,13 +20,13 @@ stopped before execution.
20
20
  Install the plugin into the same Python environment that runs Hermes:
21
21
 
22
22
  ```bash
23
- pip install --pre atbash-hermes-plugin==0.1.5.dev1
23
+ pip install atbash-hermes-plugin==0.1.7
24
24
  ```
25
25
 
26
26
  If Hermes is installed in a virtual environment, use that environment's Python:
27
27
 
28
28
  ```bash
29
- /path/to/hermes/venv/bin/python -m pip install --pre atbash-hermes-plugin==0.1.5.dev1
29
+ /path/to/hermes/venv/bin/python -m pip install atbash-hermes-plugin==0.1.7
30
30
  ```
31
31
 
32
32
  ## Configure Atbash
@@ -102,6 +102,19 @@ ATBASH_ORG_NAME=your-org-name
102
102
  ATBASH_TOOL_MAP_PATH=$HOME/.config/atbash/hermes-tool-map.json
103
103
  ```
104
104
 
105
+ ## Telemetry
106
+
107
+ The plugin initializes the Atbash Python SDK OpenTelemetry metrics with
108
+ `source="plugin:hermes"`, matching the pattern used by the OpenClaw plugin.
109
+ Telemetry is best-effort and never blocks guard registration or tool execution.
110
+
111
+ The Python SDK telemetry opt-out is file-based. To disable telemetry, create:
112
+
113
+ ```bash
114
+ mkdir -p ~/.config/atbash
115
+ printf '{"enabled": false}\n' > ~/.config/atbash/telemetry.json
116
+ ```
117
+
105
118
  ## Enable Or Check The Plugin
106
119
 
107
120
  Hermes should discover installed Python packages that expose the
@@ -1,5 +1,6 @@
1
1
  from __future__ import annotations
2
2
 
3
+ import atexit
3
4
  import json
4
5
  import logging
5
6
  import os
@@ -7,6 +8,7 @@ from pathlib import Path
7
8
  from typing import Any, Dict, Optional
8
9
 
9
10
  logger = logging.getLogger("atbash-hermes-plugin")
11
+ _TELEMETRY_SHUTDOWN_REGISTERED = False
10
12
 
11
13
  HOLD_MESSAGE = (
12
14
  "Action held for operator review. The agent will not be jailed — please approve "
@@ -177,6 +179,24 @@ def _safe_json_value(value: Any) -> Any:
177
179
  return str(value)
178
180
 
179
181
 
182
+ def _setup_telemetry() -> None:
183
+ """Initialize SDK telemetry with a Hermes-specific source label.
184
+
185
+ Telemetry is best-effort: missing optional OpenTelemetry packages or runtime
186
+ exporter issues must never prevent the guard from registering.
187
+ """
188
+ global _TELEMETRY_SHUTDOWN_REGISTERED
189
+ try:
190
+ from atbash.opentel import setup_telemetry, shutdown_telemetry # type: ignore
191
+
192
+ setup_telemetry(enabled=True, source="plugin:hermes")
193
+ if not _TELEMETRY_SHUTDOWN_REGISTERED:
194
+ atexit.register(shutdown_telemetry)
195
+ _TELEMETRY_SHUTDOWN_REGISTERED = True
196
+ except Exception as e:
197
+ logger.debug("Atbash telemetry setup skipped err=%s", e)
198
+
199
+
180
200
  class AtbashHermesGuard:
181
201
  def __init__(self) -> None:
182
202
  self.debug = _as_bool(os.getenv("ATBASH_DEBUG"), False)
@@ -220,7 +240,7 @@ class AtbashHermesGuard:
220
240
  from atbash import Atbash # type: ignore
221
241
  from atbash.types import ToolCallInput # type: ignore
222
242
  except Exception:
223
- raise RuntimeError("atbash-sdk is required. Install with: pip install atbash-sdk==0.1.5.dev0") from e
243
+ raise RuntimeError("atbash-sdk is required. Install with: pip install atbash-sdk==0.1.7") from e
224
244
 
225
245
  self.ToolCallInput = ToolCallInput
226
246
  judge_cfg = self._judge_config()
@@ -391,6 +411,7 @@ class AtbashHermesGuard:
391
411
 
392
412
 
393
413
  def register(ctx):
414
+ _setup_telemetry()
394
415
  guard = AtbashHermesGuard()
395
416
  ctx.register_hook("pre_tool_call", guard.pre_tool_call)
396
417
  logger.info("[atbash-hermes-plugin] registered pre_tool_call hook")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: atbash-hermes-plugin
3
- Version: 0.1.5.dev1
3
+ Version: 0.1.7
4
4
  Summary: Atbash safety plugin for Hermes Agent
5
5
  Author: atbash
6
6
  License-Expression: LicenseRef-Atbash-Proprietary
@@ -10,8 +10,9 @@ Keywords: atbash,hermes,hermes-agent,agent-safety,ai-safety,tool-guard,judge,pol
10
10
  Requires-Python: >=3.10
11
11
  Description-Content-Type: text/markdown
12
12
  License-File: LICENSE
13
- Requires-Dist: atbash-sdk==0.1.5.dev0
14
- Requires-Dist: httpx<1,>=0.27
13
+ Requires-Dist: atbash-sdk==0.1.7
14
+ Requires-Dist: opentelemetry-exporter-otlp-proto-http<2,>=1.29
15
+ Requires-Dist: opentelemetry-sdk<2,>=1.29
15
16
  Dynamic: license-file
16
17
 
17
18
  # Atbash Hermes Plugin
@@ -36,13 +37,13 @@ stopped before execution.
36
37
  Install the plugin into the same Python environment that runs Hermes:
37
38
 
38
39
  ```bash
39
- pip install --pre atbash-hermes-plugin==0.1.5.dev1
40
+ pip install atbash-hermes-plugin==0.1.7
40
41
  ```
41
42
 
42
43
  If Hermes is installed in a virtual environment, use that environment's Python:
43
44
 
44
45
  ```bash
45
- /path/to/hermes/venv/bin/python -m pip install --pre atbash-hermes-plugin==0.1.5.dev1
46
+ /path/to/hermes/venv/bin/python -m pip install atbash-hermes-plugin==0.1.7
46
47
  ```
47
48
 
48
49
  ## Configure Atbash
@@ -118,6 +119,19 @@ ATBASH_ORG_NAME=your-org-name
118
119
  ATBASH_TOOL_MAP_PATH=$HOME/.config/atbash/hermes-tool-map.json
119
120
  ```
120
121
 
122
+ ## Telemetry
123
+
124
+ The plugin initializes the Atbash Python SDK OpenTelemetry metrics with
125
+ `source="plugin:hermes"`, matching the pattern used by the OpenClaw plugin.
126
+ Telemetry is best-effort and never blocks guard registration or tool execution.
127
+
128
+ The Python SDK telemetry opt-out is file-based. To disable telemetry, create:
129
+
130
+ ```bash
131
+ mkdir -p ~/.config/atbash
132
+ printf '{"enabled": false}\n' > ~/.config/atbash/telemetry.json
133
+ ```
134
+
121
135
  ## Enable Or Check The Plugin
122
136
 
123
137
  Hermes should discover installed Python packages that expose the
@@ -0,0 +1,3 @@
1
+ atbash-sdk==0.1.7
2
+ opentelemetry-exporter-otlp-proto-http<2,>=1.29
3
+ opentelemetry-sdk<2,>=1.29
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "atbash-hermes-plugin"
7
- version = "0.1.5.dev1"
7
+ version = "0.1.7"
8
8
  description = "Atbash safety plugin for Hermes Agent"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -24,8 +24,9 @@ keywords = [
24
24
  "policy"
25
25
  ]
26
26
  dependencies = [
27
- "atbash-sdk==0.1.5.dev0",
28
- "httpx>=0.27,<1",
27
+ "atbash-sdk==0.1.7",
28
+ "opentelemetry-exporter-otlp-proto-http>=1.29,<2",
29
+ "opentelemetry-sdk>=1.29,<2",
29
30
  ]
30
31
 
31
32
  [project.urls]
@@ -1,2 +0,0 @@
1
- atbash-sdk==0.1.5.dev0
2
- httpx<1,>=0.27