microsoft / microsoft/Agent365-devTools
Two hardening notes from a blind pre-registered read at ea1579f: AgenticUserId skips ValidateGuid before an az shell-out; config secret has no file-mode hardening on macOS/Linux
@ajmfehr is already working on this.
Since Sep 7, 2026.
- Dominant language
- C#
- Stars
- 60
- Forks
- 34
- Avg merge
- 8d 8h
- Merged PRs (30d)
- 1
Description
I run independent, pre-registered verification of AI-built systems (Trenyx; the published engagements are at https://trenyx.io/audits.html). I did a static-only read of microsoft/Agent365-devTools at commit ea1579f3 with the attack plan hashed and anchored before I opened a line of source. Nothing here crosses a security boundary (both items need write access to the user's own files), so this is a hardening note, not a vulnerability report. The MSAL-delegated auth, delegated-only flows, setup privilege scope, manifest handling and query-entra paths all held as documented, and the suite is real (about 1,700 Fact/Theory cases across 132 files).
-
AgenticUserId is the one identifier on Agent365Config that ConfigService never runs through ValidateGuid. Its siblings all are: TenantId (ConfigService.cs:391), ManagedIdentityPrincipalId (:399), AgenticAppId (:406), BotId (:412), BotMsaAppId (:416). The unvalidated value is then interpolated into
az ad user delete --id {config.AgenticUserId}at CleanupCommand.cs:811 and :1113, and CommandExecutor.cs:37-41 wraps az incmd.exe /con Windows. The value comes from a365.generated.config.json, which your docs describe as CLI-managed and gitignored (docs/design.md:134), so only someone who can already write the user's state file can plant it. A one-line ValidateGuid on AgenticUserId gives the family parity and closes the gap on principle. -
On macOS and Linux the client secret is stored in plaintext (SecretProtectionHelper.cs:44-48 warns at write time), and no file-mode hardening is applied to the config files that hold it; the CLI's own MSAL cache documents 0600 on Linux. Writing the config files with UnixFileMode 0600 (or chmod after write) would match that precedent.
Happy to re-check either change. The pre-registration hash and the full record publish on the audits page with the read.
SK
Trenyx
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.