fix: hash as last agent name#82
Merged
Merged
Conversation
Signed-off-by: Gustavo Carvalho <gustavo.carvalho@container-solutions.com>
Signed-off-by: Gustavo Carvalho <gustavo.carvalho@container-solutions.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates how the agent identifies itself in evidence labels by removing the separate _agent_config_hash label and shifting configuration hashing into the _agent label, with accompanying documentation and test updates.
Changes:
- Remove
_agent_config_hashfoundational label usage and associated constant. - Update
_agentlabeling behavior in code and adjust tests to expect the new foundational label set. - Refresh README/configuration docs to describe the new labeling approach.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| README.md | Updates documentation for _agent labeling behavior. |
| docs/configuration.md | Updates configuration docs for evidence label semantics and hashing. |
| cmd/agent.go | Removes _agent_config_hash label and changes _agent identity logic. |
| cmd/agent_test.go | Updates tests to reflect the new foundational labels and _agent hashing behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+66
to
+68
| The agent sets the `_agent` label to a deterministic SHA-256 hash of the runtime plugin and agent evidence configuration | ||
| (using `api.auth.client_id` when available, then `KUBERNETES_POD_NAME` or `KUBERNETES_POD`, and finally the hash). | ||
| This prevents multiple unauthenticated agents from writing to the same evidence seed when their configurations differ. |
Comment on lines
+43
to
+45
| deterministic SHA-256 hash of the runtime plugin and agent evidence configuration (using `api.auth.client_id` when | ||
| available, then `KUBERNETES_POD_NAME` or `KUBERNETES_POD`, and finally the hash). Because evidence UUIDs are seeded from | ||
| labels, changing either the agent identity or runtime configuration changes the evidence stream for plugin evidence. |
Comment on lines
+66
to
+69
| Agent evidence uses these labels: `_agent`, `tool`, and `type`. The `_agent` label contains a SHA-256 hash of plugin | ||
| names, sources, protocol versions, schedules, policies, plugin config, plugin labels, and `agent_evidence` settings | ||
| (using `api.auth.client_id` when available, then `KUBERNETES_POD_NAME` or `KUBERNETES_POD`, and finally the hash). | ||
| The hash does not include API URL, API auth, or verbosity. The `tool` label is `ccf`; the `type` label is `operations`. |
Signed-off-by: Gustavo Carvalho <gustavo.carvalho@container-solutions.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.