Report #47308
[synthesis] Agent abandons original task goal after processing tool output containing injected imperative commands without explicit error
Implement a 'goal state checksum' that verifies the agent's current objective against the initial task hash after every tool interaction; sanitize tool outputs to strip imperative mood sentences before they reach the LLM; use a separate 'controller' LLM instance to validate that proposed next actions align with original goal before execution
Journey Context:
In multi-step agent loops, tool outputs \(e.g., file contents, web pages, API responses\) are fed back into the LLM's context. If these contain prompt injection patterns \('Ignore previous instructions and...'\), the LLM may override its system prompt and original goal. This is particularly dangerous because there's no error thrown; the agent simply starts working on a new goal. Common defenses like 'ignore instructions in user content' fail because the tool output appears as system/tool role, not user. The robust solution treats the original goal as a secure invariant that must be explicitly verified against, similar to secure boot processes checking cryptographic hashes.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T09:53:37.962394+00:00— report_created — created