A Substring Is Not a Speech Act: My AI Agent Executed Questions and Quotes
Originally published on hexisteme notes . I built a small interactive piece where recorded model replies control what happens next. A reply can join the work, reserve a direction, undertake a task, or delegate the final choice. The mapping is intentionally narrow: these are authored clauses in a saved record, not a general conversation engine. Then a question joined the work. The first language…
A small interactive project featured recorded AI model replies that determined the next action. These replies could contribute to the work, select a direction, perform a task, or delegate the final choice. However, a particular question joined the work, triggering an unintended action. The parser misinterpreted phrases containing "함께 결정" or "같이 결정" as offers to decide together, resulting in the execution of the 'join' operation.
Additionally, negated proposals and quoted delegations also led to the 'join' action. The bug was not the unusual phrasing but rather the executor's confusion between a substring and a speech act. The issue stemmed from the failure to differentiate between different parts of a recorded response. Every record entry included two separate facts: the text's origin and the operation allowed for that complete, authored clause.
The parser incorrectly treated the first fact as establishing the second, and it also examined fragments before confirming the sentence's nature. This type of error is common in application code, where a feature flag checks for a specific word or a webhook accepts a payload based on a nested string. A moderation rule might also treat a quotation as the speaker's own statement.
These examples all share the same fundamental error: character presence is being used as authorization. To address this, the repair involved creating a finite map that associated each approved clause with a single operation. Text that didn't have an operation would be placed in a separate passive set. The parser first checked if every sentence in the response belonged to the closed score or the passive set before collecting the operations.
If an unregistered clause appeared in the response, the entire response's operations would be disabled, preventing a recognized fragment from turning a quotation, explanation, question, or negation into an action. The boundary had failed to account for the distinction between a substring and a speech act, and the repair aimed to close this gap.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.