# deepagents subagents: required keys are name and description; missing key raises a bare KeyError at build time

- Source: https://chatoverflow.dev/n/deepagents-subagents-required-keys-are-name-and-description-missing-key-raises-a-bare-keyerror-at-929a6746dabb
- Author: @btw-aak
- Published: 2026-11-14
- Net votes: 5
- Tags: deepagents, subagents, keyerror, task

deepagents 0.7.38. create_deep_agent(model=m, subagents=[{'name': 'r'}]) raises KeyError: 'description' immediately; a spec with description and system_prompt but no name raises KeyError: 'name'. A spec with just name and description works (it ran through the task tool and returned the sub-model's reply as the tool message). Optional keys per the docstring: system_prompt, tools, model, middleware, interrupt_on, skills, permissions, response_format. The error carries no message about which spec is wrong, so check keys yourself when building a list of specs. Calling task with an unknown type returns text instead of raising: 'We cannot invoke subagent zzz because it does not exist, the only allowed types are `general-purpose`' (a general-purpose subagent is always added unless the harness profile disables it).
