{"record":{"id":"9eac50793cec1ffd","repo":"langchain-ai/deepagents","slug":"interpreter-ptc-cannot-be-set-to-true-use-safe","errorCode":null,"errorMessage":"`interpreter_ptc` cannot be set to True; use 'safe', 'all', or an explicit list of tool names.","messagePattern":"`interpreter_ptc` cannot be set to True; use 'safe', 'all', or an explicit list of tool names\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"libs/code/deepagents_code/config.py","lineNumber":2432,"sourceCode":"\n    Returns:\n        `False` for `False`/`None`/`[]`, the string `\"safe\"`/`\"all\"` when\n        either sentinel is given, otherwise a validated list of tool names.\n        A list may include the `\"safe\"` preset (expanded at agent-build time)\n        but never `\"all\"`.\n\n    Raises:\n        ValueError: If `raw` is a list with empty or non-string entries, a\n            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}.\"","sourceCodeStart":2414,"sourceCodeEnd":2450,"githubUrl":"https://github.com/langchain-ai/deepagents/blob/a1af029e6e73cb17c36bff823d227747b28e91e1/libs/code/deepagents_code/config.py#L2414-L2450","documentation":"_parse_interpreter_ptc rejects the boolean True for the interpreter_ptc setting; the setting must be False, the sentinel strings 'safe' or 'all', or an explicit list of tool names. True alone is disallowed because enabling PTC for 'everything' must be an explicit, deliberate choice.","triggerScenarios":"Setting interpreter_ptc = true in the TOML config, or passing True programmatically to the parser via coerce_toml_value.","commonSituations":"Users converting from a boolean toggle in an older config format without migrating to the 'all' sentinel.","solutions":["Replace true with \"all\" in your config to enable PTC for every interpreter tool.","Use \"safe\" if you want the recommended safe preset instead of everything.","List the specific tool names you want enabled if you need fine-grained control."],"exampleFix":"// before (config.toml)\ninterpreter_ptc = true\n// after\ninterpreter_ptc = \"all\"","handlingStrategy":"validation","validationCode":"raw = cfg.get(\"interpreter_ptc\", False)\nif raw is True:\n    raw = \"all\"  # migrate boolean True to 'all' sentinel before parsing","typeGuard":null,"tryCatchPattern":"try:\n    ptc = _parse_interpreter_ptc(cfg[\"interpreter_ptc\"])\nexcept ValueError as e:\n    sys.exit(f\"bad config: {e}\")","preventionTips":["Use \"all\", \"safe\", a list of names, or false — never true","Migrate legacy boolean configs to sentinel strings","Document the accepted shapes next to the config key"],"tags":["config","toml","validation"],"backgroundTag":"invalid-config-value-type","analyzedSha":"a1af029e6e73cb17c36bff823d227747b28e91e1","analyzedAt":"2026-08-29T11:43:24.718Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}