An agent's full message content is logged at DEBUG, against the stated position that logs carry no message bodies
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 85/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- python
- Domain
- observability, security
Research direction
Start at core/switch_core/bridges/agent/api/handlers.py:489 in the message-send handler and check the request model for the correct room field name (req.room_id) alongside req.content. Then read core/switch_core/observability/logs.py to confirm no filter strips record text, since it ships to a collector as well as stderr. Done means the debug line reports agent, room and character count only, with no body, and any log-assertion test near that handler still passes.
Written by the indexing model from the issue text.
Description
What happens
core/switch_core/bridges/agent/api/handlers.py:489, in the agent message-send handler:
logger.debug("Recieved message from agent %s: %s", agent.name, req.content)
req.content is the whole body of the message the agent is sending into a room. At DEBUG, every agent message is written to the log in full, with the agent's name beside it.
Why it matters
Three things make this more than a stray debug line.
-
It contradicts the project's own stated position.
docs/design/data-retention.md:Application logs do not include message bodies by default. Any change that starts logging them should be treated as personal-data processing.
That sentence is relied on when answering customers' data questions. It is true except here.
-
There is no content redaction in the logging pipeline.
core/switch_core/observability/logs.pyhas one filter, and its purpose is to avoid mislabelling ops lines as product events — not to strip personal data. Nothing inspects a record's text before it is emitted. -
The record does not stay on the box. That module ships log records to a collector in addition to stderr: "Shipping log records to the collector, alongside writing them to stderr. stderr is never replaced — this handler is additional." So a deployment running at DEBUG sends room message content to wherever its collector forwards to, which is a different set of processors from the ones the data is meant to touch.
By contrast, the project is careful about this elsewhere: product telemetry explicitly never sends prompts, room names, error messages or log content, and agent hosts redact issued tokens from logs and journals. This line is the exception.
Scope
As far as I can tell it is the only one. Grepping core/switch_core/ for logging calls carrying a message body, content or text field returns this line alone.
Suggested fix
Log the fact and the shape, not the content — the agent, the room, and a length or hash is enough to debug a delivery problem:
logger.debug(
"Received message from agent %s for room %s (%d chars)",
agent.name, req.room_id, len(req.content),
)
(The existing line also misspells "Recieved", if it is being touched anyway.)
If the full body is genuinely wanted for local debugging, it would be better behind an explicit opt-in that a deployment has to turn on knowingly, rather than riding on the log level.
Verified at switch-v0.32.1.
- Dominant language
- Python
- Stars
- 4.5k
- Forks
- 348
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 287
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing 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.
More from sandbox-quantum/switch
-
Console writes URL credentials to the local log, though AGENTS.md says secrets never reach diskOpen
Difficulty 1/5 Under an hour Newbie friendliness 86/100
sandbox-quantum/switch#2163 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
sandbox-quantum/switch#2162 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
sandbox-quantum/switch#2157 ·
Maintainers usually reply within 1 day
-
Get-Switch-Console link points at a path that only resolves via a redirectPossibly taken @Darshan3690 claimed this 3 days ago. Open
Difficulty 1/5 Under an hour Newbie friendliness 85/100
sandbox-quantum/switch#1998 · 2 comments ·
Maintainers usually reply within 1 day
-
A session's age is not surfaced, so you cannot tell how old an agent's context isPossibly taken A pull request linked to this issue is open or already merged. Openenhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
sandbox-quantum/switch#1993 ·
Maintainers usually reply within 1 day
All issues in sandbox-quantum/switch
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
mohanraj00/entelos#200 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
-
sweep
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
bketelsen/truenas-mcp#77 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
openedx/xblock-lti-consumer#765 ·
Maintainers usually reply within 1 day
-
bug pydanty:is-working
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
pydantic/pydantic-ai#13939 ·
Maintainers usually reply within 1 day