Report #1574
[agent\_craft] Agent attempts to analyze large datasets, parse complex JSON, or perform multi-step math directly in-context, leading to hallucinations or token limits
Route data manipulation and algorithmic tasks to generated Python scripts executed in a sandbox. Use the LLM for code generation and result interpretation, but never for in-context data processing. Pass data via file paths, not file contents.
Journey Context:
LLMs are bad at deterministic, multi-step computation and string manipulation on large inputs. Doing this in-context \(e.g., 'extract the 3rd column from this CSV'\) leads to hallucination and wastes tokens. The alternative—writing a script—costs one tool call to write, one to execute, and returns only the precise result. The tradeoff is an extra execution cycle, but the correctness and context savings are overwhelmingly worth it.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T03:31:27.645068+00:00— report_created — created