[AAASM-3848] 🔒 (client): Redact resolved secrets in DispatchToolResult repr#192
Conversation
DispatchToolResult.resolved_args holds post-substitution resolved credential values. The dataclass-generated __repr__ rendered them verbatim, leaking secrets into logs, tracebacks, and debugger output (CWE-532). Add a redacting __repr__/__str__ that shows only the arg key names and count, mirroring GatewayClient.__repr__ (AAASM-3642). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019mSz31RysZF6DYToUoBWLf
Regression test for CWE-532: constructs a result holding a secret value and asserts neither repr() nor str() leaks it, while still exposing arg key names and count for debuggability. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019mSz31RysZF6DYToUoBWLf
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
🤖 Claude Code — PR ReviewVerdict: ✅ APPROVE Scope (AAASM-3848): Complete. No side-effects: Only the rendering of the object changes; field access is unaffected. Exposing the key names (not values) is intentional and matches the sibling redaction. Tests: CI: Green. |



Description
DispatchToolResult(agent_assembly/client/dispatch.py) is a frozen dataclass whoseresolved_argsfield holds post-substitution resolved credential values. The dataclass-generated__repr__rendered those secrets verbatim, so anyrepr()/print()/logging.*(result)/ traceback / debugger dump leaked them in cleartext (CWE-532).This adds a redacting
__repr__/__str__(via@dataclass(repr=False)+ explicit method) that shows only the argument key names and count, mirroring theGatewayClient.__repr__hardening from AAASM-3642.names_substitutedis names-only by contract and is still rendered verbatim.Type of Change
Breaking Changes
Related Issues
Closes AAASM-3848
Testing
New regression test
test_dispatch_tool_result_repr_does_not_leak_resolved_secret_valuesconstructs a result holding a secret value and asserts neitherrepr()norstr()contains it, while still exposing key names + count. Validation run:.venv/bin/python -m pytest test/unit -q→ 653 passed, 4 skipped (env-only).venv/bin/ruff check .→ clean.venv/bin/mypy agent_assembly→ only pre-existing errors (unbuilt native_coreshim + grpc stubs); none from this changeChecklist
🤖 Generated with Claude Code