microsoft / microsoft/agent-governance-toolkit
mute_agent scrubber: dict keys are never scrubbed (same bug class as #3499's set fix)
- Dominant language
- Python
- Stars
- 6.3k
- Forks
- 1.1k
- Avg merge
- 5d 11h
- Merged PRs (30d)
- 142
Description
Found during review of #3499 (which fixes sets and named tuples in the mute-agent scrubber). Dict keys pass through unscrubbed on both main and the #3499 head — verified: `{"user@example.com": "v"}` leaks the email in the key position, while the same string as a value is redacted.
`agent-governance-python/agent-os/src/agent_os/mute_agent.py` `_scrub` walks dict values only; the fix is the one-liner `{self._scrub(k): self._scrub(v) for k, v in ...}` (dict keys are commonly identifiers, so consider whether key scrubbing should be opt-in if it risks collapsing distinct keys to the same redaction token).
Related nit from the same review: a tuple subclass with a positional `__new__` but no `_fields` still crashes the scrubber (`TypeError`); a try/except falling back to plain `tuple(scrubbed)` would prefer a type change over a crash-as-leak-path.
Contributor guide
Research direction
Start in agent-governance-python/agent-os/src/agent_os/mute_agent.py at _scrub, where dictionary values are currently traversed without scrubbing keys. Verify that sensitive strings are redacted in both key and value positions, then check the tuple-subclass case described in the issue so it no longer crashes; consider the stated risk of key collisions when defining done.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- security
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100