atbash-hermes-plugin 0.1.3.dev0__tar.gz → 0.1.3.dev1__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.3.dev0
3
+ Version: 0.1.3.dev1
4
4
  Summary: Atbash safety plugin for Hermes Agent
5
5
  Author: atbash
6
6
  License-Expression: LicenseRef-Atbash-Proprietary
@@ -77,6 +77,7 @@ Add:
77
77
  ATBASH_KEY_PATH=$HOME/.config/atbash/guard-client-key
78
78
  ATBASH_ENFORCE_DECISION=true
79
79
  ATBASH_DEBUG=false
80
+ ATBASH_ORG_NAME=your-org-name
80
81
  ```
81
82
 
82
83
  Restart Hermes after changing `.env`.
@@ -97,12 +98,21 @@ hermes
97
98
  # Override the Atbash API endpoint.
98
99
  ATBASH_ENDPOINT=https://api.atbash.io
99
100
 
101
+ # Set to self-hosted when using your own judge endpoint. Self-hosted judges
102
+ # require ATBASH_JUDGE_VERIFY_PUBKEY so the SDK can verify signed responses.
103
+ ATBASH_JUDGE_ENDPOINT_POLICY=default
104
+ ATBASH_JUDGE_VERIFY_PUBKEY=
105
+
100
106
  # Fail closed when Atbash cannot be reached. Default: true.
101
107
  ATBASH_ENFORCE_DECISION=true
102
108
 
103
109
  # Emit verbose plugin logs. Default: false.
104
110
  ATBASH_DEBUG=false
105
111
 
112
+ # Resolve the Atbash organization subscription/network. This lets the SDK
113
+ # choose the public or private chain for that org.
114
+ ATBASH_ORG_NAME=your-org-name
115
+
106
116
  # Override where learned Hermes tool classifications are saved.
107
117
  ATBASH_TOOL_MAP_PATH=$HOME/.config/atbash/hermes-tool-map.json
108
118
  ```
@@ -166,6 +176,7 @@ Example `~/.hermes/.env` for Docker:
166
176
  ATBASH_KEY_PATH=/opt/data/atbash/guard-client-key
167
177
  ATBASH_ENFORCE_DECISION=true
168
178
  ATBASH_DEBUG=false
179
+ ATBASH_ORG_NAME=your-org-name
169
180
  ```
170
181
 
171
182
  Run Hermes:
@@ -184,6 +195,7 @@ docker run --rm -it \
184
195
  -e ATBASH_KEY_PATH=/opt/data/atbash/guard-client-key \
185
196
  -e ATBASH_ENFORCE_DECISION=true \
186
197
  -e ATBASH_DEBUG=false \
198
+ -e ATBASH_ORG_NAME=your-org-name \
187
199
  nousresearch/hermes-agent
188
200
  ```
189
201
 
@@ -211,6 +223,13 @@ Hermes sessions.
211
223
  - `ATBASH_ENFORCE_DECISION=true`: fail closed and block.
212
224
  - `ATBASH_ENFORCE_DECISION=false`: fail open and allow.
213
225
 
226
+ For `HOLD`, the user-facing block message is:
227
+
228
+ ```text
229
+ Action held for operator review. The agent will not be jailed — please approve or reject this request from the Atbash dashboard, then ask the agent to try again.
230
+ Reason: <original reason from judge>
231
+ ```
232
+
214
233
  ## Troubleshooting
215
234
 
216
235
  If Hermes does not show the plugin:
@@ -62,6 +62,7 @@ Add:
62
62
  ATBASH_KEY_PATH=$HOME/.config/atbash/guard-client-key
63
63
  ATBASH_ENFORCE_DECISION=true
64
64
  ATBASH_DEBUG=false
65
+ ATBASH_ORG_NAME=your-org-name
65
66
  ```
66
67
 
67
68
  Restart Hermes after changing `.env`.
@@ -82,12 +83,21 @@ hermes
82
83
  # Override the Atbash API endpoint.
83
84
  ATBASH_ENDPOINT=https://api.atbash.io
84
85
 
86
+ # Set to self-hosted when using your own judge endpoint. Self-hosted judges
87
+ # require ATBASH_JUDGE_VERIFY_PUBKEY so the SDK can verify signed responses.
88
+ ATBASH_JUDGE_ENDPOINT_POLICY=default
89
+ ATBASH_JUDGE_VERIFY_PUBKEY=
90
+
85
91
  # Fail closed when Atbash cannot be reached. Default: true.
86
92
  ATBASH_ENFORCE_DECISION=true
87
93
 
88
94
  # Emit verbose plugin logs. Default: false.
89
95
  ATBASH_DEBUG=false
90
96
 
97
+ # Resolve the Atbash organization subscription/network. This lets the SDK
98
+ # choose the public or private chain for that org.
99
+ ATBASH_ORG_NAME=your-org-name
100
+
91
101
  # Override where learned Hermes tool classifications are saved.
92
102
  ATBASH_TOOL_MAP_PATH=$HOME/.config/atbash/hermes-tool-map.json
93
103
  ```
@@ -151,6 +161,7 @@ Example `~/.hermes/.env` for Docker:
151
161
  ATBASH_KEY_PATH=/opt/data/atbash/guard-client-key
152
162
  ATBASH_ENFORCE_DECISION=true
153
163
  ATBASH_DEBUG=false
164
+ ATBASH_ORG_NAME=your-org-name
154
165
  ```
155
166
 
156
167
  Run Hermes:
@@ -169,6 +180,7 @@ docker run --rm -it \
169
180
  -e ATBASH_KEY_PATH=/opt/data/atbash/guard-client-key \
170
181
  -e ATBASH_ENFORCE_DECISION=true \
171
182
  -e ATBASH_DEBUG=false \
183
+ -e ATBASH_ORG_NAME=your-org-name \
172
184
  nousresearch/hermes-agent
173
185
  ```
174
186
 
@@ -196,6 +208,13 @@ Hermes sessions.
196
208
  - `ATBASH_ENFORCE_DECISION=true`: fail closed and block.
197
209
  - `ATBASH_ENFORCE_DECISION=false`: fail open and allow.
198
210
 
211
+ For `HOLD`, the user-facing block message is:
212
+
213
+ ```text
214
+ Action held for operator review. The agent will not be jailed — please approve or reject this request from the Atbash dashboard, then ask the agent to try again.
215
+ Reason: <original reason from judge>
216
+ ```
217
+
199
218
  ## Troubleshooting
200
219
 
201
220
  If Hermes does not show the plugin:
@@ -8,6 +8,12 @@ from typing import Any, Dict, Optional
8
8
 
9
9
  logger = logging.getLogger("atbash-hermes-plugin")
10
10
 
11
+ HOLD_MESSAGE = (
12
+ "Action held for operator review. The agent will not be jailed — please approve "
13
+ "or reject this request from the Atbash dashboard, then ask the agent to try "
14
+ "again.\nReason: {reason}"
15
+ )
16
+
11
17
  DEFAULT_TOOL_CLASS_MAP = {
12
18
  "browser_click": "browser_interaction",
13
19
  "browser_navigate": "network",
@@ -155,8 +161,11 @@ class AtbashHermesGuard:
155
161
  self.debug = _as_bool(os.getenv("ATBASH_DEBUG"), False)
156
162
  self.fail_closed = _as_bool(os.getenv("ATBASH_ENFORCE_DECISION"), True)
157
163
  self.endpoint = os.getenv("ATBASH_ENDPOINT")
164
+ self.judge_endpoint_policy = os.getenv("ATBASH_JUDGE_ENDPOINT_POLICY")
165
+ self.judge_verify_pubkey = os.getenv("ATBASH_JUDGE_VERIFY_PUBKEY")
158
166
  self.key_path = os.getenv("ATBASH_KEY_PATH")
159
167
  self.privkey = os.getenv("ATBASH_AGENT_PRIVKEY")
168
+ self.org_name = os.getenv("ATBASH_ORG_NAME")
160
169
  self.provider = os.getenv("HERMES_PROVIDER")
161
170
  self.model = os.getenv("HERMES_MODEL")
162
171
  self.tool_map_path = Path(
@@ -190,25 +199,53 @@ class AtbashHermesGuard:
190
199
  from atbash import Atbash # type: ignore
191
200
  from atbash.types import ToolCallInput # type: ignore
192
201
  except Exception:
193
- raise RuntimeError("atbash-sdk is required. Install with: pip install atbash-sdk==0.1.3") from e
202
+ raise RuntimeError("atbash-sdk is required. Install with: pip install atbash-sdk==0.1.3.dev0") from e
194
203
 
195
204
  self.ToolCallInput = ToolCallInput
196
- judge_cfg = {"endpoint": self.endpoint} if self.endpoint else None
205
+ judge_cfg = self._judge_config()
197
206
 
198
207
  # Prefer explicit key material if provided.
199
208
  if self.privkey:
200
209
  try:
201
- return Atbash(self.privkey, endpoint=self.endpoint or "https://atbash.ai")
210
+ return Atbash.from_config(
211
+ agent_key=self.privkey,
212
+ judge=judge_cfg,
213
+ org_name=self.org_name,
214
+ fail_closed=self.fail_closed,
215
+ )
202
216
  except TypeError:
203
- return Atbash(self.privkey)
217
+ kwargs: Dict[str, Any] = {
218
+ "org_name": self.org_name,
219
+ "fail_closed": self.fail_closed,
220
+ }
221
+ if self.endpoint:
222
+ kwargs["endpoint"] = self.endpoint
223
+ if self.judge_verify_pubkey:
224
+ kwargs["verify_pubkey"] = self.judge_verify_pubkey
225
+ return Atbash(self.privkey, **kwargs)
204
226
 
205
227
  # Use SDK-native config loader for key file/env/config.
206
228
  return Atbash.from_config(
207
229
  key_path=self.key_path,
208
230
  judge=judge_cfg,
231
+ org_name=self.org_name,
209
232
  fail_closed=self.fail_closed,
210
233
  )
211
234
 
235
+ def _judge_config(self) -> Optional[Dict[str, str]]:
236
+ if not self.endpoint:
237
+ return None
238
+ if self.judge_endpoint_policy == "self-hosted":
239
+ return {
240
+ "policy": "self-hosted",
241
+ "endpoint": self.endpoint,
242
+ "verify_pubkey": self.judge_verify_pubkey or "",
243
+ }
244
+ return {
245
+ "policy": "default",
246
+ "endpoint": self.endpoint,
247
+ }
248
+
212
249
  def _judge(
213
250
  self,
214
251
  tool_name: str,
@@ -291,9 +328,10 @@ class AtbashHermesGuard:
291
328
  logger.info("Atbash verdict tool=%s verdict=%s reason=%s", tool_name, verdict, reason)
292
329
 
293
330
  if verdict == "HOLD":
331
+ hold_message = HOLD_MESSAGE.format(reason=reason)
294
332
  return {
295
333
  "action": "block",
296
- "message": f"Held by Atbash for operator review: {reason}",
334
+ "message": hold_message,
297
335
  }
298
336
 
299
337
  if verdict in {"BLOCK", "DENY", "REJECT", "DISALLOW"}:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: atbash-hermes-plugin
3
- Version: 0.1.3.dev0
3
+ Version: 0.1.3.dev1
4
4
  Summary: Atbash safety plugin for Hermes Agent
5
5
  Author: atbash
6
6
  License-Expression: LicenseRef-Atbash-Proprietary
@@ -77,6 +77,7 @@ Add:
77
77
  ATBASH_KEY_PATH=$HOME/.config/atbash/guard-client-key
78
78
  ATBASH_ENFORCE_DECISION=true
79
79
  ATBASH_DEBUG=false
80
+ ATBASH_ORG_NAME=your-org-name
80
81
  ```
81
82
 
82
83
  Restart Hermes after changing `.env`.
@@ -97,12 +98,21 @@ hermes
97
98
  # Override the Atbash API endpoint.
98
99
  ATBASH_ENDPOINT=https://api.atbash.io
99
100
 
101
+ # Set to self-hosted when using your own judge endpoint. Self-hosted judges
102
+ # require ATBASH_JUDGE_VERIFY_PUBKEY so the SDK can verify signed responses.
103
+ ATBASH_JUDGE_ENDPOINT_POLICY=default
104
+ ATBASH_JUDGE_VERIFY_PUBKEY=
105
+
100
106
  # Fail closed when Atbash cannot be reached. Default: true.
101
107
  ATBASH_ENFORCE_DECISION=true
102
108
 
103
109
  # Emit verbose plugin logs. Default: false.
104
110
  ATBASH_DEBUG=false
105
111
 
112
+ # Resolve the Atbash organization subscription/network. This lets the SDK
113
+ # choose the public or private chain for that org.
114
+ ATBASH_ORG_NAME=your-org-name
115
+
106
116
  # Override where learned Hermes tool classifications are saved.
107
117
  ATBASH_TOOL_MAP_PATH=$HOME/.config/atbash/hermes-tool-map.json
108
118
  ```
@@ -166,6 +176,7 @@ Example `~/.hermes/.env` for Docker:
166
176
  ATBASH_KEY_PATH=/opt/data/atbash/guard-client-key
167
177
  ATBASH_ENFORCE_DECISION=true
168
178
  ATBASH_DEBUG=false
179
+ ATBASH_ORG_NAME=your-org-name
169
180
  ```
170
181
 
171
182
  Run Hermes:
@@ -184,6 +195,7 @@ docker run --rm -it \
184
195
  -e ATBASH_KEY_PATH=/opt/data/atbash/guard-client-key \
185
196
  -e ATBASH_ENFORCE_DECISION=true \
186
197
  -e ATBASH_DEBUG=false \
198
+ -e ATBASH_ORG_NAME=your-org-name \
187
199
  nousresearch/hermes-agent
188
200
  ```
189
201
 
@@ -211,6 +223,13 @@ Hermes sessions.
211
223
  - `ATBASH_ENFORCE_DECISION=true`: fail closed and block.
212
224
  - `ATBASH_ENFORCE_DECISION=false`: fail open and allow.
213
225
 
226
+ For `HOLD`, the user-facing block message is:
227
+
228
+ ```text
229
+ Action held for operator review. The agent will not be jailed — please approve or reject this request from the Atbash dashboard, then ask the agent to try again.
230
+ Reason: <original reason from judge>
231
+ ```
232
+
214
233
  ## Troubleshooting
215
234
 
216
235
  If Hermes does not show the plugin:
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "atbash-hermes-plugin"
7
- version = "0.1.3.dev0"
7
+ version = "0.1.3.dev1"
8
8
  description = "Atbash safety plugin for Hermes Agent"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"