{"record":{"id":"6b328f7a3b43a4bd","repo":"langchain-ai/deepagents","slug":"invalid-interpreter-ptc-string-raw-r-expected","errorCode":null,"errorMessage":"Invalid `interpreter_ptc` string {raw!r}; expected 'safe', 'all', or a list of tool names.","messagePattern":"Invalid `interpreter_ptc` string (.+?); expected 'safe', 'all', or a list of tool names\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"libs/code/deepagents_code/config.py","lineNumber":2441,"sourceCode":"            list containing `\"all\"`, or a string other than `\"safe\"`/`\"all\"`.\n    \"\"\"\n    if raw is None or raw is False:\n        return False\n    if raw is True:\n        msg = (\n            \"`interpreter_ptc` cannot be set to True; use 'safe', 'all', or \"\n            \"an explicit list of tool names.\"\n        )\n        raise ValueError(msg)\n    if isinstance(raw, str):\n        normalized = raw.strip().lower()\n        if normalized in {INTERPRETER_PTC_SAFE_SENTINEL, INTERPRETER_PTC_ALL_SENTINEL}:\n            return normalized\n        msg = (\n            f\"Invalid `interpreter_ptc` string {raw!r}; expected 'safe', 'all', \"\n            \"or a list of tool names.\"\n        )\n        raise ValueError(msg)\n    if isinstance(raw, list):\n        if not raw:\n            return False\n        names: list[str] = []\n        for entry in raw:\n            if not isinstance(entry, str) or not entry.strip():\n                msg = (\n                    \"`interpreter_ptc` list entries must be non-empty strings; \"\n                    f\"got {entry!r}.\"\n                )\n                raise ValueError(msg)\n            cleaned = entry.strip()\n            if cleaned.lower() == INTERPRETER_PTC_ALL_SENTINEL:\n                msg = (\n                    \"`interpreter_ptc` list entries cannot include 'all'; use \"\n                    \"'all' as a standalone value or list explicit tool names \"\n                    \"(optionally with the 'safe' preset).\"\n                )","sourceCodeStart":2423,"sourceCodeEnd":2459,"githubUrl":"https://github.com/langchain-ai/deepagents/blob/a1af029e6e73cb17c36bff823d227747b28e91e1/libs/code/deepagents_code/config.py#L2423-L2459","documentation":"_parse_interpreter_ptc accepts only the sentinel strings 'safe' and 'all' (case-insensitive) as scalar string values; any other string is rejected with this error listing the valid options. Strings are not treated as tool names at the scalar level — tool names must come as a list.","triggerScenarios":"Setting interpreter_ptc = \"true\", \"yes\", \"everything\", or a misspelled sentinel like \"saef\" / \"ALL COMMANDS\" in config or via coerce_toml_value.","commonSituations":"Typo in the sentinel, treating a single tool name as a bare string instead of a one-element list, or copying a boolean-style config from another tool.","solutions":["Use exactly \"safe\" or \"all\" (spelling-insensitive) as the string value.","If you meant one specific tool, write it as a list: interpreter_ptc = [\"tool_name\"].","If you meant to disable it, use interpreter_ptc = false."],"exampleFix":"// before\ninterpreter_ptc = \"everything\"\n// after\ninterpreter_ptc = \"all\"  # or [\"specific_tool\"]","handlingStrategy":"validation","validationCode":"VALID = {\"safe\", \"all\"}\nif isinstance(raw, str) and raw.strip().lower() not in VALID:\n    raise ValueError(f\"interpreter_ptc string must be 'safe' or 'all'; got {raw!r}\")","typeGuard":"def is_ptc_sentinel(v: object) -> bool:\n    return isinstance(v, str) and v.strip().lower() in {\"safe\", \"all\"}","tryCatchPattern":"try:\n    ptc = _parse_interpreter_ptc(raw)\nexcept ValueError as e:\n    sys.exit(f\"invalid interpreter_ptc: {e}\")","preventionTips":["Copy sentinels verbatim ('safe', 'all'); do not paraphrase","A single tool name must be a one-element list, not a bare string","Lint config files against the accepted value grammar"],"tags":["config","toml","validation"],"backgroundTag":"invalid-enum-value","analyzedSha":"a1af029e6e73cb17c36bff823d227747b28e91e1","analyzedAt":"2026-08-29T11:43:24.718Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}