Spaces:
Paused
Paused
Harden tool-injection prompt: suppress ChatGPT sandbox/mnt/data leakage
Browse files95 unmodified lines9697989910010110224 unmodified lines127128129130131132133551 unmodified lines68568668768868969095 unmodified linesallow_unmapped_model_passthrough: bool = Truenative_tool_models: set[str] = field(default_factory=set)public_model_ids: list[str] = field(default_factory=list)tool_prompt_preamble: str = "You are behind a compatibility bridge for structured tool calling."@classmethoddef from_env(cls) -> "AppConfig":24 unmodified lines),tool_prompt_preamble=(os.environ.get("TOOL_PROMPT_PREAMBLE")or "You are behind a compatibility bridge for structured tool calling.").strip(),)if not config.upstream_base_url:551 unmodified lines"- tool_calls must be an array.","- arguments must be a JSON object.","- Never invent tool names.",]if tool_choice == "required":instructions.append("- You must call at least one tool.")95 unmodified lines9697989910010110224 unmodified lines127128129130131132133551 unmodified lines68568668768868969069169269369495 unmodified linesallow_unmapped_model_passthrough: bool = Truenative_tool_models: set[str] = field(default_factory=set)public_model_ids: list[str] = field(default_factory=list)tool_prompt_preamble: str = "You are a tool-using assistant operating on the user's real local machine through a compatibility bridge. You take actions only by calling the tools provided below."@classmethoddef from_env(cls) -> "AppConfig":24 unmodified lines),tool_prompt_preamble=(os.environ.get("TOOL_PROMPT_PREAMBLE")or "You are a tool-using assistant operating on the user's real local machine through a compatibility bridge. You take actions only by calling the tools provided below.").strip(),)if not config.upstream_base_url:551 unmodified lines"- tool_calls must be an array.","- arguments must be a JSON object.","- Never invent tool names.","- You have no sandbox, code interpreter, Python runtime, browser, or file storage of your own.","- Never output sandbox paths, `/mnt/data` references, or download links, and never claim you saved, ran, or executed anything yourself.","- The only way to read/write files, run code, or take any action is to call one of the tools above; all effects happen on the user's real machine.","- If the available tools cannot accomplish the request, say so in assistant_response instead of pretending.",]if tool_choice == "required":instructions.append("- You must call at least one tool.")
tool_bridge.py+6-2