agento11y-hermes 0.19.0__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.
@@ -0,0 +1,4 @@
1
+ /build/
2
+ .coverage
3
+ .coverage.*
4
+ .ruff_cache/
@@ -0,0 +1,74 @@
1
+ # Changelog
2
+
3
+ ## [0.11.0] - 2026-10-03
4
+
5
+ - Rename the distribution to `agento11y-hermes` and the Python module to `agento11y_hermes`. Uninstall `grafana-agento11y-hermes` before installing the renamed package; keep the `agento11y` enabled key in Hermes.
6
+ - Upgrade to Python SDK 0.17.x and default to `metadata_only`. Shared secret redaction sanitizes captured content and tool-execution spans.
7
+ - Make automatic user/repo/branch tags opt-in and remove unconditional `cwd` tagging.
8
+ - Prevent escaped quotes in tool schemas from leaving secret fragments after redaction.
9
+ - Include the full Apache license in wheel and source distributions.
10
+ - Publish from `grafana/agento11y` using `plugins/hermes/v*` release tags.
11
+
12
+ ## [0.10.0] - 2026-08-16
13
+
14
+ - Wrap every hook handler in a fail-open guard (b9ec134)
15
+
16
+ ## [0.9.0] - 2026-08-16
17
+
18
+ - Update the end-to-end tests for the new capture and fix false passes
19
+ - Record max_tokens, temperature, top_p and tool_choice from request body
20
+ - implement system prompt capture mode for hook payloads
21
+ - Tag tool spans and link them to the generation that requested them
22
+ - Document content capture mode
23
+ - Add end-to-end tests and update the hermes notes from them
24
+ - update hermes version compatibility
25
+ - Update Dependabot
26
+ - Update README.md
27
+ - Update README.md
28
+
29
+ ## [0.6.0] - 2026-08-15
30
+
31
+ - Publish releases to PyPI
32
+ - Point setup docs at the Agent Observability setup page
33
+ - Switch to the agento11y SDK and rename to grafana-agento11y-hermes
34
+
35
+ ## [0.5.0] - 2026-08-15
36
+
37
+ - Manage the project with uv and take the version from git tags
38
+
39
+ ## [0.4.0] - 2026-06-07
40
+
41
+ - bump sigil-sdk to 0.8.0
42
+ - Send plugin User-Agent on generation export
43
+ - fix Grafana Cloud path
44
+ - add screenshot
45
+
46
+ ## [0.3.0] - 2026-06-07
47
+
48
+ - Derive OTLP auth headers from Sigil creds when unset
49
+
50
+ ## [0.2.0] - 2026-06-07
51
+
52
+ - Let the SDK derive tool-execution content capture
53
+ - Add SIGIL_HERMES_AGENT_VERSION
54
+ - sigil-sdk 0.5.0
55
+ - Rename project from hermes-plugin-sigil to sigil-hermes
56
+ - llms.txt: point the token step at the in-stack setup URL
57
+ - Make the install verify recipe actually work
58
+ - Change URL pattern for AI Observability
59
+ - Clarify Grafana AI Observability plugin instructions (#2)
60
+ - Update README to correct plugin description
61
+ - Add llms.txt
62
+ - hooks: scope recorder→assistant pairing to this turn
63
+
64
+ ## [0.1.0] - 2026-05-01
65
+
66
+ - otel: drop SIGIL_OTEL_* schema, use standard OTEL_* envs
67
+ - config: adopt canonical SIGIL_* env-var schema
68
+ - hooks: move all tool work to post_tool_call
69
+ - hooks: bound generation span and duration to the LLM call window
70
+ - hooks: drop redundant set_result(input=...) at pre-hook time
71
+ - hooks: catch prep errors when closing pending generation recorders
72
+ - hooks: thread cfg.max_chars into _redact.safe_value
73
+ - redact: cap before materialization in safe_value
74
+ - initial commit
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,154 @@
1
+ Metadata-Version: 2.5
2
+ Name: agento11y-hermes
3
+ Version: 0.19.0
4
+ Summary: Grafana Agent Observability plugin for Hermes Agent. Records LLM calls and tool executions as generations and OTel traces+metrics.
5
+ Project-URL: Homepage, https://github.com/grafana/agento11y/tree/main/plugins/hermes
6
+ Project-URL: Repository, https://github.com/grafana/agento11y
7
+ Author: Alexander Akhmetov
8
+ License: Apache-2.0
9
+ License-File: LICENSE
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: License :: OSI Approved :: Apache Software License
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Programming Language :: Python :: 3.13
17
+ Classifier: Programming Language :: Python :: 3.14
18
+ Classifier: Topic :: Software Development :: Libraries
19
+ Requires-Python: >=3.11
20
+ Requires-Dist: agento11y>=0.17
21
+ Requires-Dist: opentelemetry-exporter-otlp-proto-http>=1.27
22
+ Requires-Dist: opentelemetry-sdk>=1.27
23
+ Description-Content-Type: text/markdown
24
+
25
+ # agento11y-hermes
26
+
27
+ [Grafana Agent Observability](https://grafana.com/docs/grafana-cloud/machine-learning/agent-observability/) plugin for [Hermes Agent](https://github.com/NousResearch/hermes-agent).
28
+
29
+ ## Install
30
+
31
+ The shared launcher does not support Hermes. `agento11y login`, its shared `config.env`, and its local mode do not configure this plugin.
32
+
33
+ Install into the Python environment that runs Hermes, not an unrelated system Python. Python 3.11 or newer is required. Hermes 0.16.0 is the supported floor; the plugin was tested against Hermes 0.19.0.
34
+
35
+ If you have `grafana-agento11y-hermes` or `hermes-plugin-sigil` installed, remove it from Hermes's Python environment first:
36
+
37
+ ```sh
38
+ python -m pip uninstall grafana-agento11y-hermes hermes-plugin-sigil
39
+ ```
40
+
41
+ These distributions register the same plugin or its retired `sigil` key. Do not install them alongside `agento11y-hermes`.
42
+
43
+ With Hermes's Python environment active, install the published package:
44
+
45
+ ```sh
46
+ python -m pip install --upgrade "agento11y-hermes>=0.11.0"
47
+ ```
48
+
49
+ If the first release is not yet published, install from the repository root instead:
50
+
51
+ ```sh
52
+ python -m pip install ./plugins/hermes
53
+ ```
54
+
55
+ The distribution is `agento11y-hermes`; the Python module is `agento11y_hermes`. Its `hermes_agent.plugins` entry point is `agento11y = agento11y_hermes`.
56
+
57
+ The retired `grafana-agento11y-hermes` `0.10.0` defaults to full content without shared secret redaction. Upgrading that distribution alone does not install `agento11y-hermes` or change those defaults.
58
+
59
+ Add `agento11y` to `plugins.enabled` in `~/.hermes/config.yaml`, preserving other entries:
60
+
61
+ ```yaml
62
+ plugins:
63
+ enabled:
64
+ - agento11y
65
+ ```
66
+
67
+ On Hermes 0.19.0, `hermes plugins enable` and `hermes plugins list` do not see pip-installed plugins. Enable through YAML and verify exported telemetry instead.
68
+
69
+ Keep the `agento11y` enabled key when replacing `grafana-agento11y-hermes`. If replacing `hermes-plugin-sigil`, replace the `sigil` key with `agento11y`. Restart Hermes after installation. Retired `SIGIL_*` variables remain compatibility inputs where supported; use `AGENTO11Y_*` for new configuration.
70
+
71
+ For agent-assisted setup, use [llms.txt](llms.txt).
72
+
73
+ ## Configure the two channels
74
+
75
+ Copy endpoints and credentials from your stack's Agent Observability setup page:
76
+
77
+ ```text
78
+ https://<stack>.grafana.net/a/grafana-agento11y-app/setup
79
+ ```
80
+
81
+ Create a token and copy the environment block. Do not guess endpoint regions or authorization headers. Both channels can use the setup token, but each has its own endpoint:
82
+
83
+ | Channel | Configuration | Data |
84
+ | --- | --- | --- |
85
+ | Generations | `AGENTO11Y_ENDPOINT`, `AGENTO11Y_PROTOCOL=http`, `AGENTO11Y_AUTH_MODE=basic`, `AGENTO11Y_AUTH_TENANT_ID`, `AGENTO11Y_AUTH_TOKEN` | One generation per LLM API call, including usage and timing |
86
+ | OpenTelemetry | `OTEL_EXPORTER_OTLP_ENDPOINT`, `OTEL_EXPORTER_OTLP_HEADERS` | Generation and tool-execution spans, plus metrics |
87
+
88
+ Tool executions have no separate generation-ingest record. Their arguments and results can also occur inside generation messages when content capture permits them.
89
+
90
+ The channels are independently optional. Generation export activates with a token or an explicit non-`none` auth mode. An endpoint alone does not activate it. OTel setup requires the base OTLP endpoint or its `AGENTO11Y_OTEL_EXPORTER_OTLP_ENDPOINT` alias. The standard endpoint wins. HTTP exporters append `/v1/traces` and `/v1/metrics`.
91
+
92
+ With neither channel configured, telemetry is disabled. To disable generations, remove generation credentials and set `AGENTO11Y_AUTH_MODE=none`. To disable plugin OTel setup, remove both base endpoint names and set `AGENTO11Y_HERMES_OTEL_AUTO=false`. Host-owned providers remain the host's responsibility.
93
+
94
+ Set variables in the environment that starts Hermes. Hermes loads `~/.hermes/.env` with override enabled, so values there beat shell exports. The plugin does not read the launcher's `~/.config/agento11y/config.env`.
95
+
96
+ ## Privacy
97
+
98
+ The plugin uses Python SDK 0.17.x for content capture and secret redaction.
99
+
100
+ - `metadata_only` is the default. Message structure, tool names, model, usage, timing, IDs, and sampling parameters can leave the machine. Prompt text, responses, system prompts, tool schemas, tool I/O, and detailed error text do not.
101
+ - Set `AGENTO11Y_CONTENT_CAPTURE_MODE=full` only when you want content exported. `no_tool_content` still exports generation content. `full_with_metadata_spans` sends content only through generation ingest.
102
+ - `default`, an empty value, and unknown modes resolve to `metadata_only`; Hermes currently falls back without a warning.
103
+ - Shared secret redaction sanitizes exported content, including tool-execution spans. A tool schema is omitted if it is invalid JSON or triggers secret redaction. This prevents regex replacements from leaving secret fragments in schema JSON. Structural truncation is not secret redaction. Pattern matching is not a guarantee that all secrets or personal data are removed.
104
+ - Prompt redaction defaults to on. `AGENTO11Y_REDACT_INPUT_MESSAGES=false` disables only user-prompt redaction; invalid values keep it on. Assistant text and errors use lightweight patterns. System prompts and tool payloads also use key/value patterns. Email addresses are redacted.
105
+ - No automatic `cwd` tag is emitted. Automatic user, repository, and branch tags are off by default.
106
+
107
+ Opt into automatic client tags with `AGENTO11Y_AUTO_CODING_AGENT_TAGS=true`. Narrow them with `AGENTO11Y_AUTO_CODING_AGENT_TAGS_NAMES=user,repo`; accepted names are `user`, `repo`, `branch`, or `all`. The allowlist alone enables nothing. Explicit `AGENTO11Y_TAGS` values win over automatic values.
108
+
109
+ These tags reach generations, spans, and metric labels. User identities can be personal data, and branch names increase metric cardinality. Hermes caches its client for the process, so automatic values do not follow later directory or branch changes. Capture modes do not remove custom tags or metadata; never put secrets there.
110
+
111
+ See [Content Capture Modes](../../docs/concepts/content-capture-modes.md) and [Tags and Metadata](../../docs/concepts/tags-and-metadata.md).
112
+
113
+ ## Other settings
114
+
115
+ | Variable | Default | Purpose |
116
+ | --- | --- | --- |
117
+ | `AGENTO11Y_AGENT_NAME` | `hermes` | Agent identity |
118
+ | `OTEL_SERVICE_NAME` | `hermes` | OTel service identity |
119
+ | `AGENTO11Y_DEBUG` | `false` | Diagnostic logging |
120
+ | `AGENTO11Y_HERMES_SAMPLE_RATE` | `1.0` | Fraction of calls recorded, from `0.0` to `1.0`; not a privacy control |
121
+ | `AGENTO11Y_HERMES_MAX_CHARS` | `12000` | Per-string bound on tool payloads |
122
+ | `AGENTO11Y_HERMES_OTEL_AUTO` | `true` | Install missing OTel providers; never replace host-owned providers |
123
+ | `AGENTO11Y_HERMES_ERROR_FLUSH_TIMEOUT` | `2.0` | Maximum wait in seconds for the error-path flush |
124
+ | `AGENTO11Y_HEADERS` | unset | Extra generation-export headers |
125
+
126
+ ## Verify and troubleshoot
127
+
128
+ With permission to send telemetry, start interactive Hermes with `AGENTO11Y_DEBUG=true`. Check `~/.hermes/logs/agent.log` for client initialization and installed OTel providers. A host-owned provider does not produce an installation message.
129
+
130
+ Run one turn and check generations in Agent Observability and traces/metrics in their respective data sources. One working channel does not prove the other works. `hermes -z` disables logging, so missing log lines in one-shot mode do not prove failure.
131
+
132
+ Hermes can clip request payloads before hooks run. The plugin reuses cached request facts where possible; `hermes.request_facts_reused` marks that reuse. A tool inventory may be stale after `tool_search`. Sampling parameters are not borrowed from a different model. `HERMES_PLUGIN_PAYLOAD_MAX_CHARS` can reduce envelope truncation, but cannot undo Hermes's per-string clipping.
133
+
134
+ Generations use synchronous mode because released hooks do not provide a reliable first-token signal. No time-to-first-token histogram is promised. Tool spans can end after their already-ended parent generation span.
135
+
136
+ ## Development
137
+
138
+ From the repository root:
139
+
140
+ ```sh
141
+ mise run format:py:plugin-hermes
142
+ mise run lint:py:plugin-hermes
143
+ mise run typecheck:py:plugin-hermes
144
+ mise run test:py:plugin-hermes
145
+ mise run build:py:plugin-hermes
146
+ ```
147
+
148
+ The build task checks the wheel, source distribution, installed entry point, and packaged Apache license. Root `mise run check` includes this artifact check. CI tests Python 3.11, 3.12, 3.13, and 3.14 with branch coverage enabled and a 99% minimum.
149
+
150
+ Real-Hermes end-to-end testing is optional, not part of the normal checks. Read [.agents/skills/e2e-test/SKILL.md](.agents/skills/e2e-test/SKILL.md) for a credential-free loopback recipe. A local telemetry sink alone does not make the model provider local.
151
+
152
+ ## License
153
+
154
+ Copyright 2026 Grafana Labs. [Apache-2.0](LICENSE).
@@ -0,0 +1,130 @@
1
+ # agento11y-hermes
2
+
3
+ [Grafana Agent Observability](https://grafana.com/docs/grafana-cloud/machine-learning/agent-observability/) plugin for [Hermes Agent](https://github.com/NousResearch/hermes-agent).
4
+
5
+ ## Install
6
+
7
+ The shared launcher does not support Hermes. `agento11y login`, its shared `config.env`, and its local mode do not configure this plugin.
8
+
9
+ Install into the Python environment that runs Hermes, not an unrelated system Python. Python 3.11 or newer is required. Hermes 0.16.0 is the supported floor; the plugin was tested against Hermes 0.19.0.
10
+
11
+ If you have `grafana-agento11y-hermes` or `hermes-plugin-sigil` installed, remove it from Hermes's Python environment first:
12
+
13
+ ```sh
14
+ python -m pip uninstall grafana-agento11y-hermes hermes-plugin-sigil
15
+ ```
16
+
17
+ These distributions register the same plugin or its retired `sigil` key. Do not install them alongside `agento11y-hermes`.
18
+
19
+ With Hermes's Python environment active, install the published package:
20
+
21
+ ```sh
22
+ python -m pip install --upgrade "agento11y-hermes>=0.11.0"
23
+ ```
24
+
25
+ If the first release is not yet published, install from the repository root instead:
26
+
27
+ ```sh
28
+ python -m pip install ./plugins/hermes
29
+ ```
30
+
31
+ The distribution is `agento11y-hermes`; the Python module is `agento11y_hermes`. Its `hermes_agent.plugins` entry point is `agento11y = agento11y_hermes`.
32
+
33
+ The retired `grafana-agento11y-hermes` `0.10.0` defaults to full content without shared secret redaction. Upgrading that distribution alone does not install `agento11y-hermes` or change those defaults.
34
+
35
+ Add `agento11y` to `plugins.enabled` in `~/.hermes/config.yaml`, preserving other entries:
36
+
37
+ ```yaml
38
+ plugins:
39
+ enabled:
40
+ - agento11y
41
+ ```
42
+
43
+ On Hermes 0.19.0, `hermes plugins enable` and `hermes plugins list` do not see pip-installed plugins. Enable through YAML and verify exported telemetry instead.
44
+
45
+ Keep the `agento11y` enabled key when replacing `grafana-agento11y-hermes`. If replacing `hermes-plugin-sigil`, replace the `sigil` key with `agento11y`. Restart Hermes after installation. Retired `SIGIL_*` variables remain compatibility inputs where supported; use `AGENTO11Y_*` for new configuration.
46
+
47
+ For agent-assisted setup, use [llms.txt](llms.txt).
48
+
49
+ ## Configure the two channels
50
+
51
+ Copy endpoints and credentials from your stack's Agent Observability setup page:
52
+
53
+ ```text
54
+ https://<stack>.grafana.net/a/grafana-agento11y-app/setup
55
+ ```
56
+
57
+ Create a token and copy the environment block. Do not guess endpoint regions or authorization headers. Both channels can use the setup token, but each has its own endpoint:
58
+
59
+ | Channel | Configuration | Data |
60
+ | --- | --- | --- |
61
+ | Generations | `AGENTO11Y_ENDPOINT`, `AGENTO11Y_PROTOCOL=http`, `AGENTO11Y_AUTH_MODE=basic`, `AGENTO11Y_AUTH_TENANT_ID`, `AGENTO11Y_AUTH_TOKEN` | One generation per LLM API call, including usage and timing |
62
+ | OpenTelemetry | `OTEL_EXPORTER_OTLP_ENDPOINT`, `OTEL_EXPORTER_OTLP_HEADERS` | Generation and tool-execution spans, plus metrics |
63
+
64
+ Tool executions have no separate generation-ingest record. Their arguments and results can also occur inside generation messages when content capture permits them.
65
+
66
+ The channels are independently optional. Generation export activates with a token or an explicit non-`none` auth mode. An endpoint alone does not activate it. OTel setup requires the base OTLP endpoint or its `AGENTO11Y_OTEL_EXPORTER_OTLP_ENDPOINT` alias. The standard endpoint wins. HTTP exporters append `/v1/traces` and `/v1/metrics`.
67
+
68
+ With neither channel configured, telemetry is disabled. To disable generations, remove generation credentials and set `AGENTO11Y_AUTH_MODE=none`. To disable plugin OTel setup, remove both base endpoint names and set `AGENTO11Y_HERMES_OTEL_AUTO=false`. Host-owned providers remain the host's responsibility.
69
+
70
+ Set variables in the environment that starts Hermes. Hermes loads `~/.hermes/.env` with override enabled, so values there beat shell exports. The plugin does not read the launcher's `~/.config/agento11y/config.env`.
71
+
72
+ ## Privacy
73
+
74
+ The plugin uses Python SDK 0.17.x for content capture and secret redaction.
75
+
76
+ - `metadata_only` is the default. Message structure, tool names, model, usage, timing, IDs, and sampling parameters can leave the machine. Prompt text, responses, system prompts, tool schemas, tool I/O, and detailed error text do not.
77
+ - Set `AGENTO11Y_CONTENT_CAPTURE_MODE=full` only when you want content exported. `no_tool_content` still exports generation content. `full_with_metadata_spans` sends content only through generation ingest.
78
+ - `default`, an empty value, and unknown modes resolve to `metadata_only`; Hermes currently falls back without a warning.
79
+ - Shared secret redaction sanitizes exported content, including tool-execution spans. A tool schema is omitted if it is invalid JSON or triggers secret redaction. This prevents regex replacements from leaving secret fragments in schema JSON. Structural truncation is not secret redaction. Pattern matching is not a guarantee that all secrets or personal data are removed.
80
+ - Prompt redaction defaults to on. `AGENTO11Y_REDACT_INPUT_MESSAGES=false` disables only user-prompt redaction; invalid values keep it on. Assistant text and errors use lightweight patterns. System prompts and tool payloads also use key/value patterns. Email addresses are redacted.
81
+ - No automatic `cwd` tag is emitted. Automatic user, repository, and branch tags are off by default.
82
+
83
+ Opt into automatic client tags with `AGENTO11Y_AUTO_CODING_AGENT_TAGS=true`. Narrow them with `AGENTO11Y_AUTO_CODING_AGENT_TAGS_NAMES=user,repo`; accepted names are `user`, `repo`, `branch`, or `all`. The allowlist alone enables nothing. Explicit `AGENTO11Y_TAGS` values win over automatic values.
84
+
85
+ These tags reach generations, spans, and metric labels. User identities can be personal data, and branch names increase metric cardinality. Hermes caches its client for the process, so automatic values do not follow later directory or branch changes. Capture modes do not remove custom tags or metadata; never put secrets there.
86
+
87
+ See [Content Capture Modes](../../docs/concepts/content-capture-modes.md) and [Tags and Metadata](../../docs/concepts/tags-and-metadata.md).
88
+
89
+ ## Other settings
90
+
91
+ | Variable | Default | Purpose |
92
+ | --- | --- | --- |
93
+ | `AGENTO11Y_AGENT_NAME` | `hermes` | Agent identity |
94
+ | `OTEL_SERVICE_NAME` | `hermes` | OTel service identity |
95
+ | `AGENTO11Y_DEBUG` | `false` | Diagnostic logging |
96
+ | `AGENTO11Y_HERMES_SAMPLE_RATE` | `1.0` | Fraction of calls recorded, from `0.0` to `1.0`; not a privacy control |
97
+ | `AGENTO11Y_HERMES_MAX_CHARS` | `12000` | Per-string bound on tool payloads |
98
+ | `AGENTO11Y_HERMES_OTEL_AUTO` | `true` | Install missing OTel providers; never replace host-owned providers |
99
+ | `AGENTO11Y_HERMES_ERROR_FLUSH_TIMEOUT` | `2.0` | Maximum wait in seconds for the error-path flush |
100
+ | `AGENTO11Y_HEADERS` | unset | Extra generation-export headers |
101
+
102
+ ## Verify and troubleshoot
103
+
104
+ With permission to send telemetry, start interactive Hermes with `AGENTO11Y_DEBUG=true`. Check `~/.hermes/logs/agent.log` for client initialization and installed OTel providers. A host-owned provider does not produce an installation message.
105
+
106
+ Run one turn and check generations in Agent Observability and traces/metrics in their respective data sources. One working channel does not prove the other works. `hermes -z` disables logging, so missing log lines in one-shot mode do not prove failure.
107
+
108
+ Hermes can clip request payloads before hooks run. The plugin reuses cached request facts where possible; `hermes.request_facts_reused` marks that reuse. A tool inventory may be stale after `tool_search`. Sampling parameters are not borrowed from a different model. `HERMES_PLUGIN_PAYLOAD_MAX_CHARS` can reduce envelope truncation, but cannot undo Hermes's per-string clipping.
109
+
110
+ Generations use synchronous mode because released hooks do not provide a reliable first-token signal. No time-to-first-token histogram is promised. Tool spans can end after their already-ended parent generation span.
111
+
112
+ ## Development
113
+
114
+ From the repository root:
115
+
116
+ ```sh
117
+ mise run format:py:plugin-hermes
118
+ mise run lint:py:plugin-hermes
119
+ mise run typecheck:py:plugin-hermes
120
+ mise run test:py:plugin-hermes
121
+ mise run build:py:plugin-hermes
122
+ ```
123
+
124
+ The build task checks the wheel, source distribution, installed entry point, and packaged Apache license. Root `mise run check` includes this artifact check. CI tests Python 3.11, 3.12, 3.13, and 3.14 with branch coverage enabled and a 99% minimum.
125
+
126
+ Real-Hermes end-to-end testing is optional, not part of the normal checks. Read [.agents/skills/e2e-test/SKILL.md](.agents/skills/e2e-test/SKILL.md) for a credential-free loopback recipe. A local telemetry sink alone does not make the model provider local.
127
+
128
+ ## License
129
+
130
+ Copyright 2026 Grafana Labs. [Apache-2.0](LICENSE).
@@ -0,0 +1,79 @@
1
+ [build-system]
2
+ requires = ["hatchling>=1.18"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "agento11y-hermes"
7
+ version = "0.19.0"
8
+ description = "Grafana Agent Observability plugin for Hermes Agent. Records LLM calls and tool executions as generations and OTel traces+metrics."
9
+ readme = "README.md"
10
+ license = { text = "Apache-2.0" }
11
+ authors = [{ name = "Alexander Akhmetov" }]
12
+ requires-python = ">=3.11"
13
+ classifiers = [
14
+ "Development Status :: 4 - Beta",
15
+ "Intended Audience :: Developers",
16
+ "License :: OSI Approved :: Apache Software License",
17
+ "Programming Language :: Python :: 3",
18
+ "Programming Language :: Python :: 3.11",
19
+ "Programming Language :: Python :: 3.12",
20
+ "Programming Language :: Python :: 3.13",
21
+ "Programming Language :: Python :: 3.14",
22
+ "Topic :: Software Development :: Libraries",
23
+ ]
24
+ dependencies = [
25
+ "agento11y>=0.17",
26
+ "opentelemetry-sdk>=1.27",
27
+ "opentelemetry-exporter-otlp-proto-http>=1.27",
28
+ ]
29
+
30
+ [dependency-groups]
31
+ dev = [
32
+ "pytest>=8.0",
33
+ "pytest-cov>=6.0",
34
+ "ruff>=0.16.3",
35
+ "ty==0.0.73",
36
+ ]
37
+
38
+ [project.entry-points."hermes_agent.plugins"]
39
+ agento11y = "agento11y_hermes"
40
+
41
+ [project.urls]
42
+ Homepage = "https://github.com/grafana/agento11y/tree/main/plugins/hermes"
43
+ Repository = "https://github.com/grafana/agento11y"
44
+
45
+ [tool.hatch.build.targets.wheel]
46
+ packages = ["src/agento11y_hermes"]
47
+
48
+ [tool.hatch.build.targets.sdist]
49
+ include = [
50
+ "src/agento11y_hermes",
51
+ "README.md",
52
+ "CHANGELOG.md",
53
+ "LICENSE",
54
+ ]
55
+
56
+ [tool.ruff]
57
+ line-length = 120
58
+ target-version = "py311"
59
+
60
+ [tool.ruff.lint]
61
+ select = ["E", "F", "W", "I", "B", "UP"]
62
+ ignore = ["E501"]
63
+
64
+ [tool.ty.environment]
65
+ # The lowest version we support, so ty catches use of a 3.12+ feature.
66
+ python-version = "3.11"
67
+
68
+ [tool.pytest.ini_options]
69
+ testpaths = ["tests"]
70
+ addopts = "-q"
71
+
72
+ [tool.coverage.run]
73
+ source = ["agento11y_hermes"]
74
+ branch = true
75
+
76
+ [tool.coverage.report]
77
+ show_missing = true
78
+ skip_covered = true
79
+ fail_under = 99