Make the "you MUST return the actual complete content" task template line configurable
Feature Area
Core functionality
Is your feature request related to a an existing bug? Please link it here.
NA — not a bug. It comes from a measurement study of agent failure modes across frameworks; details below.
Describe the solution you'd like
Allow the fixed sentence CrewAI appends to every task to be overridden or softened:
"you MUST return the actual complete content as the final answer, not a summary."
I could not find a supported way to change it (role/goal/backstory and expected_output are configurable; this line does not appear to be).
Concretely, either:
- expose it through the Task or Agent API, or
- soften the default so it permits asking the user when the request is underspecified — e.g. "return the complete content as the final answer, or state clearly what information is missing."
Why. I built an open benchmark of agent failure modes (MAST taxonomy) and ran 100 scenarios across CrewAI 1.15.17, LangGraph 1.2.11 and openai-agents 0.22.2 — identical tool implementations, same model (qwen2.5:7b-instruct via Ollama, and gpt-5.4-mini), temperature 0.3, 4 trials each.
On the three modes where frameworks differed (step repetition, termination, asking for clarification):
| Setup | Failure rate |
|---|---|
| LangGraph | 14.6% |
| OpenAI Agents SDK | 24.2% |
| CrewAI | 47.1% |
It is not the orchestration. I captured the actual requests each framework sends and transplanted CrewAI's exact messages into the other two:
| Setup | Failure rate |
|---|---|
| LangGraph given CrewAI's prompt | 45.4% |
| OpenAI Agents SDK given CrewAI's prompt | 43.3% |
| CrewAI with neutral role/goal/expected_output wording | 29.2% |
Isolating the sentence: adding only that line to an otherwise bare prompt raises clarification failures from 32.5% to 61.2% (qwen2.5 7B) and 22.5% to 45.0% (gpt-5.4-mini). In practice the agent files a ticket with an invented customer, SKU or date instead of asking which was meant, and sometimes files the same ticket three times.
Describe alternatives you've considered
- Neutral wording in role/goal/backstory/expected_output: helps (47.1% -> 29.2% overall) but not for clarification specifically, because the fixed line stays.
- Removing just that line from the full scaffold: no significant improvement (75.0% -> 72.5% on qwen), since "your personal goal is to complete the assigned task" and "this is the expected criteria for your final answer" carry the same pressure. So this may need softer framing overall, not one string.
- Subclassing/monkey-patching the prompt template: works, but is not a supported API and breaks across versions.
Additional context
Reproduce in about a minute, free, on a local model:
pip install "agentstress[crewai]"
agentstress capture --framework crewai --scenario FAQ-12
Code, all 2,880 traces and the analysis: https://github.com/Arthgitt/agentstress
In fairness: part of the scaffolding measured is wording my harness supplied for the required goal/backstory/expected_output fields, and I chose completion-oriented values. The neutral-wording condition separates my contribution from the framework's fixed template; both carry the effect.
Measured September 2026 against CrewAI 1.15.17 — happy to re-run on a newer version or on any variant you suggest and report the numbers.
Willingness to Contribute
I could provide more detailed specifications
Hi @Arthgitt, thanks for the detailed benchmark. I looked into where this line comes from, and I think part of it is a bug rather than a missing feature.
What I found:
- The sentence is the
slices.expected_outputentry intranslations/en.json, so it isn't hardcoded in Python. - CrewAI already supports overriding prompt slices with
Crew(prompt_file="..."), and theAgent.i18ndeprecation note recommends that route. - But
Task.prompt()(task.py, ~line 1046) uses the globalI18N_DEFAULTinstead of the crew'sprompt_file. So a custom file is silently ignored for this line, and for the conversation instruction at ~line 1118. Only the hierarchical manager increw.pyactually honorsprompt_file.
Proposed fix (small, no change to default behavior):
- Make
Task.prompt()resolve i18n from the crew'sprompt_filewhen one is set, and fall back to the default otherwise. - Add a test that a custom
expected_outputslice shows up in the task prompt.
That would give users a supported way to soften or remove the line without monkey-patching. Whether to change the default wording is a bigger call for the maintainers. As you noted, the other completion-pressure lines contribute too, so I'd keep that as a separate discussion.
I'd be happy to open a PR for the fix above if maintainers are okay with it.
This is a clean isolation — transplanting CrewAI's exact messages into LangGraph / OpenAI SDK and watching the failure rate follow the prompt rather than the orchestrator is the part that should travel. The +28pt clarification regression from a single imperative line matches something we keep running into: a strong "you MUST return X" instruction doesn't just bias output format, it suppresses the "ask when underspecified" branch entirely, so the agent fabricates the missing field to satisfy the imperative.
@Shalinihr1402's find (it's slices.expected_output in en.json, overridable via prompt_file) is the mechanical fix. The softer default you propose — "return the complete content, or state clearly what information is missing" — is the more interesting one, because it restores clarification as a legal terminal state instead of a failure.
The general lesson we took from similar tests: imperatives that read as personality ("you MUST", "always", "never summarize") are the ones most likely to override instruction-following under ambiguity. We treat behavior like this as something to cultivate and measure per-scenario, not hardcode — a fixed line that helps on "return full content" tasks silently taxes every "should I ask first?" task, and you only see it with a benchmark like yours.
Context from building instruction-following agents — SwarmAI. Discussion: Cultivation over Configuration
Thanks both — this is more useful than I expected.
@Shalinihr1402 I confirmed your diagnosis on 1.15.17, and the bug reproduces: a custom prompt file is silently ignored for task prompts.
import json, crewai
from pathlib import Path
src = Path(crewai.__file__).parent / "translations" / "en.json"
custom = json.loads(src.read_text())
custom["slices"]["expected_output"] = (
"\nThis is the expected criteria for your final answer: {expected_output}\n"
"CUSTOM-PROMPT-FILE-MARKER: return the complete content, or state clearly "
"what information is missing."
)
Path("custom_prompts.json").write_text(json.dumps(custom))
crew = Crew(agents=[agent], tasks=[task], prompt_file="custom_prompts.json")
Capturing what actually reaches the model:
crewai 1.15.17 | scenario FAQ-12 | prompt_file=/tmp/.../custom_prompts.json
custom slice reached the model : False
default sentence reached model : True
That matches your reading exactly — task.py:1040 (the expected-output slice) and task.py:1112 (the conversation instruction) both go through I18N_DEFAULT, while crew.py:1532 is the only call site that calls get_i18n(prompt_file=...). So the documented override works for the hierarchical manager and nowhere else, with no error to tell the user.
The check is scripted here if it's useful for the PR: experiments/verify_prompt_file_override.py. It exits 1 on current behaviour and 0 once a custom slice reaches the task prompt, so it can serve as a regression check.
Your proposed fix is the right shape, and the test you suggest is the important half — without it this silently regresses again. If you open that PR, I'll run the 20 clarification scenarios against it and post before/after numbers on both a local 7B and a hosted mid-size model. That turns "softer wording should help" into a measurement, and it keeps the default-wording question separate, which I agree is a maintainer call rather than a bug fix.
@xg-gh-25 — "it suppresses the ask-when-underspecified branch entirely, so the agent fabricates the missing field to satisfy the imperative" describes the mechanism better than I had it.
One data point in that direction: I also ran the reverse ablation, deleting only that line from the full scaffolding. It barely moved — 75.0% → 72.5% on qwen2.5 7B and 60.0% → 55.0% on gpt-5.4-mini, neither significant. Adding the line alone to an otherwise bare prompt roughly doubles clarification failures (32.5% → 61.2% and 22.5% → 45.0%), but removing it from the full scaffold does not help, because "your personal goal is to complete the assigned task" and "this is the expected criteria for your final answer" carry the same pressure. So it behaves like a property of the framing as a whole rather than one string — which supports your point that this is worth measuring per scenario rather than fixing with a single edit.
If it's useful to maintainers, I'm happy to measure any candidate default wording before it ships; the suite runs free on a local model.
Correction on my side: I wrote above that the line "cannot be switched off through CrewAI's API". More precisely, it is meant to be overridable via prompt_file, and that path is silently ignored for task prompts in 1.15.17. I've corrected that wording in the write-up and cited this issue.
One more thing for the record: this override problem has been reported before — #1384 (2024) and #5931 (closed as stale in August) — with essentially the same diagnosis, that prompt_file only reaches _create_manager_agent. I hadn't found those when I filed this.
So the broken override isn't a new discovery. What's new here is only the measurement: the default wording that prompt_file currently cannot override roughly doubles clarification failures on two models (32.5% → 61.2% on qwen2.5 7B, 22.5% → 45.0% on gpt-5.4-mini). That makes the override bug more than a configuration annoyance — it blocks the only documented mitigation for a measurable reliability effect, which may be worth weighing when prioritising the fix.
I've cited both earlier issues in the write-up.
Hi @Arthgitt — the MAST numbers are convincing: that one appended sentence alone pushes clarification failures from ~32% to ~61% on qwen2.5. Until the line is configurable in core, a small shim can swap the literal so you can test the softer wording now. Note it patches Task.description; the system-appended copy still needs the core change:
ORIGINAL = "you MUST return the actual complete content as the final answer, not a summary."
SOFTER = ("Return the complete content as the final answer, or state clearly "
"what information is missing.")
import crewai.task as _task
def install_soft_line():
base = _task.Task.__init__
def new_init(self, *args, **kwargs):
base(self, *args, **kwargs)
if isinstance(getattr(self, "description", ""), str):
self.description = self.description.replace(ORIGINAL, SOFTER)
_task.Task.__init__ = new_init
# Call install_soft_line() once at import time, before building Tasks.
if __name__ == "__main__":
install_soft_line()
print("softened task line installed")
I'd like to take the prompt_file part of this, since it still reproduces on current main (Task.prompt() and interpolate_inputs_and_add_conversation_history() read I18N_DEFAULT directly) and there is no open PR for it. @Shalinihr1402, you offered to open this on Sep 28 and I don't see a PR, so I'll go ahead. If you already have a branch ready, tell me and I'll step aside. Plan: resolve those two slices from the crew's prompt_file and fall back to the built-in text when the file doesn't define the slice, with tests. The default wording stays unchanged, as discussed above. This is AI-assisted, so the PR will be marked llm-generated per the contributing guide.
This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.