You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(agent): read the token through a secret store(#1) - #239
The agent read the token once at startup and kept it in memory, in the client of each thread. It now goes through a SecretStore trait and is read for each request, held in Zeroizing buffers that are wiped once used, and sent in a header marked sensitive.
flowchart LR
R[Request] --> S["SecretStore.get()"] --> C[(config.toml)]
S --> H[Bearer header<br/>wiped after use]
Loading
Proposed changes
Groundwork for keeping the agent token in the OS secret store (#273). This PR only changes how the agent reads the token. The token stays in the config, and the installers don't change.
Before: the token was read once at start-up, copied into each thread, and kept in memory for the whole run.
After: the agent asks a SecretStore for the token before each call and wipes it from memory right after.
ConfigStore (the only store for now) reads the token from the config.
The request header holds the token in a buffer that is wiped after the call, and is marked sensitive (hidden from debug output).
Printing the settings shows <redacted> instead of the token.
New dependencies: bytes, zeroize (already in the dependency tree).
Testing Instructions
Build the branch and install the agent in one mode per OS. On Windows, run the NSIS installer directly, since branch builds aren't release-signed. Then check each row:
Automated: cargo test --locked
Manual (Windows Sandbox, build this branch, then run the NSIS installer directly):
Install the agent (service mode) → it shows online and an inject works.
Search openaev-agent.log for the token → not found.
While the agent runs, set a wrong token in the config → calls fail. Put the right one back → the agent is online again without restart.
Swap the exe of an agent installed from the current release → still online.
I added/update the relevant documentation (either on github or on notion)
Where necessary I refactored code to improve the overall quality
For bug fix -> I implemented a test that covers the bug
Further comments
Impact for users: none. Same files, same installers, same behaviour. A changed token in the config is now used without a restart.
Limit: the HTTP/TLS libraries and the config loader keep their own copies of the token, which the agent can't wipe. The token is still in clear text on disk;
❌ Patch coverage is 60.00000% with 36 lines in your changes missing coverage. Please review.
✅ Project coverage is 38.91%. Comparing base (a03efd7) to head (69723a1).
❌ Your patch check has failed because the patch coverage (60.00%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.
Add isolated file-backed ConfigStore reload and recovery tests
src/secrets/config_store.rs:18
The only ConfigStore test requests refresh_token, returning before this loading path. The rotation and recovery tests use MemoryStore, so they do not verify the production behavior promised by this PR. Please add isolated file-backed tests that read a token, edit it and observe the new value through the same ConfigStore, then verify an unreadable or invalid configuration returns an error and succeeds after repair. Avoid changing shared configuration files or process-wide environment variables in parallel tests.
Guillaume (guillaumejparis)
changed the title
feat(agent): read the token through a secret store (#1)
feat(agent): read the token through a secret store(#1)
Oct 16, 2026
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
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.
The agent read the token once at startup and kept it in memory, in the client of each thread. It now goes through a SecretStore trait and is read for each request, held in Zeroizing buffers that are wiped once used, and sent in a header marked sensitive.
Proposed changes
Groundwork for keeping the agent token in the OS secret store (#273). This PR only changes how the agent reads the token. The token stays in the config, and the installers don't change.
SecretStorefor the token before each call and wipes it from memory right after.ConfigStore(the only store for now) reads the token from the config.<redacted>instead of the token.bytes,zeroize(already in the dependency tree).Testing Instructions
Build the branch and install the agent in one mode per OS. On Windows, run the NSIS installer directly, since branch builds aren't release-signed. Then check each row:
Automated:
cargo test --lockedManual (Windows Sandbox, build this branch, then run the NSIS installer directly):
openaev-agent.logfor the token → not found.Related issues
Checklist
Further comments