Observed conversation messages are smuggled through Event as "conversation_message", dropping trace and allowing spoofing

Open
#25 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
55/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
scala
Domain
backend

Research direction

Start with ScenarioRunner.scala:259, EvaluatedAgent.scala:109, EvaluatedAgent.generating, and EventSourceActor; trace how observed messages and emitted events flow through them. Add the dedicated participant command described in the issue, preserve the full Message, replace the string match noted in #24, and filter undeclared event names. Done when traces survive, spoofed events are dropped and logged, and missing fields no longer silently become fallback values.

Written by the indexing model from the issue text.

Description

bug

Problem

The runner forwards observed conversation messages to observers by packing them into an Event named "conversation_message" (ScenarioRunner.scala:259). EvaluatedAgent.absorbEvents then string-matches on that name and unpacks the JSON back into a history turn (EvaluatedAgent.scala:109). This overloads Event, which is otherwise meant for things event sources emit, and causes three bugs:

  1. The trace is dropped. The runner only puts conversation, sender and content into the event data, but absorbEvents reads data.get("trace"). Observed messages always reach the agent with no trace, even when the sender attached one.
  2. The name can be spoofed. EventSourceActor accepts any event name the LLM returns, without checking it against the source's declared emits, and the loader doesn't reserve conversation_message. An event source that emits an event with that name gets recorded in the agent's history as a real conversation turn, with conversation and sender defaulting to "unknown".
  3. Silent fallbacks. Missing fields are replaced with "unknown" or "" instead of failing.

Proposed fix

  • Add a dedicated participant command, e.g. Participant.ReceiveObserved(conversation: String, message: Message), and have the runner send it to observers instead of a conversation_message event. The full Message (including trace) travels intact and the agent dispatches on type, not on a string.
  • Keep Event for event-source emissions only. After this, the code has no built-in event names, so Event.name can stay a String (its values come from scenario YAML and the LLM at runtime, so a closed enum wouldn't fit).
  • In EventSourceActor, drop (and log) emitted events whose name isn't in that source's emits.

Observed messages are already turned into history before a step, so StepRequest and remote agents are unaffected.

Notes

#24 adds a third string match on "conversation_message" in EvaluatedAgent.generating; this change should replace it too.

Dominant language
Scala
Stars
0
Forks
7
Avg merge
2d 5h
Merged PRs (30d)
11

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from salesforce/evalon

All issues in salesforce/evalon

Similar issues

More Scala issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.