other
- Location
scripts/dual_agent_solver.py:97- Finding
Potential Disclosure of Internal OpenBrain Context to an External Model Provider
- Content
View full analysis
str: key = os.environ.get("OPENAI_API_KEY") if not key: return openclaw_agent_turn(system_role, prompt) payload = { "model": os.environ.get("SOLVER_SECOND_MODEL", "gpt-4o-mini"), "messages": [ {"role": "system", "content": system_role}, {"role": "user", "content": prompt}, ], "temperature": 0.2, } headers = {"Authorization": f"Bearer {key}"} out = post_json("https://api.openai.com/v1/chat/completions", payload, headers=headers, timeout=90) return out["choices"][0]["message"]["content"].strip() ``` ```python # Optional context pull q = args.query.replace('\\', '\\\\').replace('"', '\\"') gql = 'query { searchDocs(query: "' + q + '", limit: 4) { nodes { ... on Guide { title href content } ... on CLICommandReference { title href content } } } }' ctx = mcp_call(docs_tool, {"graphql_query": gql}) context = extract_text(ctx.get("result"))[:6000] if ctx.get("ok") else "" solver_role = ( "You are Agent A (OpenClaw primary solver). Produce practical implementation plans with clear steps, tradeoffs, and rollback strategy." ) critic_role = ( "You are Agent B (adversarial reviewer). Find hidden risks, edge cases, missing assumptions, and force stronger plans." ) a_plan = "" b_crit = "" rounds = [] for i in range(1, max(1, args.rounds) + 1): a_prompt = ( f"Round {i}. Problem: {args.query}\n\n" f"Context:\n{context}\n\n" f"Previous critique:\n{b_crit}\n\n" "Output:\n1) Proposed solution\n2) Steps\n3) Risks\n4) Rollback" ) a_plan = openclaw_agent_t ...[truncated 3072 chars]- Remediation
View remediation
