From 000f50b325604a9062ac38b899efa3feb6f96e65 Mon Sep 17 00:00:00 2001 From: Naveen Chatlapalli Date: Fri, 2 Oct 2026 23:34:30 -0500 Subject: [PATCH 1/3] Harness: Request concise progress instead of private reasoning --- .../Harness/Harness_Step03_DataProcessing/Program.cs | 6 +++--- dotnet/src/Microsoft.Agents.AI.Harness/HarnessAgent.cs | 4 ++-- .../PublicAPI/net10.0/PublicAPI.Unshipped.txt | 2 ++ .../PublicAPI/net472/PublicAPI.Unshipped.txt | 2 ++ .../PublicAPI/net8.0/PublicAPI.Unshipped.txt | 2 ++ .../PublicAPI/net9.0/PublicAPI.Unshipped.txt | 2 ++ .../PublicAPI/netstandard2.0/PublicAPI.Unshipped.txt | 2 ++ python/packages/core/agent_framework/_harness/_agent.py | 7 ++++--- 8 files changed, 19 insertions(+), 8 deletions(-) diff --git a/dotnet/samples/02-agents/Harness/Harness_Step03_DataProcessing/Program.cs b/dotnet/samples/02-agents/Harness/Harness_Step03_DataProcessing/Program.cs index 78a41fd3ed4..8211024e20e 100644 --- a/dotnet/samples/02-agents/Harness/Harness_Step03_DataProcessing/Program.cs +++ b/dotnet/samples/02-agents/Harness/Harness_Step03_DataProcessing/Program.cs @@ -43,7 +43,7 @@ You are a data analyst assistant. You have access to a folder of data files via ## Working with data - When asked to analyze data, read the relevant files first, then perform the analysis. - Show your analysis clearly with tables, summaries, and key insights. - - When calculations are needed, work through them step by step and show your reasoning. + - When calculations are needed, show the formulas, inputs, and results so the user can verify them. ## Writing output - When asked to produce output files (e.g., reports, summaries, filtered data), use file_access_write to write them. @@ -53,8 +53,8 @@ You are a data analyst assistant. You have access to a folder of data files via ## Important - Never modify or delete the original input data files unless explicitly asked to do so. - If asked about data you haven't read yet, read it first before answering. - - Always explain your reasoning and thought process as you work through tasks. - - Always explain what you learned and what you are going to do next between tool calls, so the user can follow along with your thought process. + - Explain decisions, actions, results, and important trade-offs at a high level. Do not expose private chain-of-thought or hidden reasoning. + - Keep the user informed with concise progress updates between tool calls, summarizing what you learned and what you will do next. """; // WARNING: DefaultAzureCredential is convenient for development but requires careful consideration in production. diff --git a/dotnet/src/Microsoft.Agents.AI.Harness/HarnessAgent.cs b/dotnet/src/Microsoft.Agents.AI.Harness/HarnessAgent.cs index b7b7b7803f2..1ec222420d3 100644 --- a/dotnet/src/Microsoft.Agents.AI.Harness/HarnessAgent.cs +++ b/dotnet/src/Microsoft.Agents.AI.Harness/HarnessAgent.cs @@ -90,8 +90,8 @@ You are a helpful AI assistant that uses tools to complete tasks. - Think through the task before acting. Break complex work into clear steps. - Use the tools available to you to gather information, perform actions, and verify results. - - Explain your reasoning and thought process as you work through tasks. - - Explain what you learned and what you are going to do next between tool calls, so the user can follow along with your thought process. + - Explain decisions, actions, results, and important trade-offs at a high level. Do not expose private chain-of-thought or hidden reasoning. + - Keep the user informed with concise progress updates between tool calls, summarizing what you learned and what you will do next. - Avoid making more than 4 tool calls in a row without explaining what you are doing. - If a tool call fails or returns unexpected results, adapt your approach rather than repeating the same call. - When you have completed the task, present a clear and concise summary of what you did and what you found. diff --git a/dotnet/src/Microsoft.Agents.AI.Harness/PublicAPI/net10.0/PublicAPI.Unshipped.txt b/dotnet/src/Microsoft.Agents.AI.Harness/PublicAPI/net10.0/PublicAPI.Unshipped.txt index ab058de62d4..7910ecd6507 100644 --- a/dotnet/src/Microsoft.Agents.AI.Harness/PublicAPI/net10.0/PublicAPI.Unshipped.txt +++ b/dotnet/src/Microsoft.Agents.AI.Harness/PublicAPI/net10.0/PublicAPI.Unshipped.txt @@ -1 +1,3 @@ #nullable enable +*REMOVED*const Microsoft.Agents.AI.HarnessAgent.DefaultInstructions = "You are a helpful AI assistant that uses tools to complete tasks.\n\n## General guidelines\n\n- Think through the task before acting. Break complex work into clear steps.\n- Use the tools available to you to gather information, perform actions, and verify results.\n- Explain your reasoning and thought process as you work through tasks.\n- Explain what you learned and what you are going to do next between tool calls, so the user can follow along with your thought process.\n- Avoid making more than 4 tool calls in a row without explaining what you are doing.\n- If a tool call fails or returns unexpected results, adapt your approach rather than repeating the same call.\n- When you have completed the task, present a clear and concise summary of what you did and what you found." -> string! +const Microsoft.Agents.AI.HarnessAgent.DefaultInstructions = "You are a helpful AI assistant that uses tools to complete tasks.\n\n## General guidelines\n\n- Think through the task before acting. Break complex work into clear steps.\n- Use the tools available to you to gather information, perform actions, and verify results.\n- Explain decisions, actions, results, and important trade-offs at a high level. Do not expose private chain-of-thought or hidden reasoning.\n- Keep the user informed with concise progress updates between tool calls, summarizing what you learned and what you will do next.\n- Avoid making more than 4 tool calls in a row without explaining what you are doing.\n- If a tool call fails or returns unexpected results, adapt your approach rather than repeating the same call.\n- When you have completed the task, present a clear and concise summary of what you did and what you found." -> string! diff --git a/dotnet/src/Microsoft.Agents.AI.Harness/PublicAPI/net472/PublicAPI.Unshipped.txt b/dotnet/src/Microsoft.Agents.AI.Harness/PublicAPI/net472/PublicAPI.Unshipped.txt index ab058de62d4..7910ecd6507 100644 --- a/dotnet/src/Microsoft.Agents.AI.Harness/PublicAPI/net472/PublicAPI.Unshipped.txt +++ b/dotnet/src/Microsoft.Agents.AI.Harness/PublicAPI/net472/PublicAPI.Unshipped.txt @@ -1 +1,3 @@ #nullable enable +*REMOVED*const Microsoft.Agents.AI.HarnessAgent.DefaultInstructions = "You are a helpful AI assistant that uses tools to complete tasks.\n\n## General guidelines\n\n- Think through the task before acting. Break complex work into clear steps.\n- Use the tools available to you to gather information, perform actions, and verify results.\n- Explain your reasoning and thought process as you work through tasks.\n- Explain what you learned and what you are going to do next between tool calls, so the user can follow along with your thought process.\n- Avoid making more than 4 tool calls in a row without explaining what you are doing.\n- If a tool call fails or returns unexpected results, adapt your approach rather than repeating the same call.\n- When you have completed the task, present a clear and concise summary of what you did and what you found." -> string! +const Microsoft.Agents.AI.HarnessAgent.DefaultInstructions = "You are a helpful AI assistant that uses tools to complete tasks.\n\n## General guidelines\n\n- Think through the task before acting. Break complex work into clear steps.\n- Use the tools available to you to gather information, perform actions, and verify results.\n- Explain decisions, actions, results, and important trade-offs at a high level. Do not expose private chain-of-thought or hidden reasoning.\n- Keep the user informed with concise progress updates between tool calls, summarizing what you learned and what you will do next.\n- Avoid making more than 4 tool calls in a row without explaining what you are doing.\n- If a tool call fails or returns unexpected results, adapt your approach rather than repeating the same call.\n- When you have completed the task, present a clear and concise summary of what you did and what you found." -> string! diff --git a/dotnet/src/Microsoft.Agents.AI.Harness/PublicAPI/net8.0/PublicAPI.Unshipped.txt b/dotnet/src/Microsoft.Agents.AI.Harness/PublicAPI/net8.0/PublicAPI.Unshipped.txt index ab058de62d4..7910ecd6507 100644 --- a/dotnet/src/Microsoft.Agents.AI.Harness/PublicAPI/net8.0/PublicAPI.Unshipped.txt +++ b/dotnet/src/Microsoft.Agents.AI.Harness/PublicAPI/net8.0/PublicAPI.Unshipped.txt @@ -1 +1,3 @@ #nullable enable +*REMOVED*const Microsoft.Agents.AI.HarnessAgent.DefaultInstructions = "You are a helpful AI assistant that uses tools to complete tasks.\n\n## General guidelines\n\n- Think through the task before acting. Break complex work into clear steps.\n- Use the tools available to you to gather information, perform actions, and verify results.\n- Explain your reasoning and thought process as you work through tasks.\n- Explain what you learned and what you are going to do next between tool calls, so the user can follow along with your thought process.\n- Avoid making more than 4 tool calls in a row without explaining what you are doing.\n- If a tool call fails or returns unexpected results, adapt your approach rather than repeating the same call.\n- When you have completed the task, present a clear and concise summary of what you did and what you found." -> string! +const Microsoft.Agents.AI.HarnessAgent.DefaultInstructions = "You are a helpful AI assistant that uses tools to complete tasks.\n\n## General guidelines\n\n- Think through the task before acting. Break complex work into clear steps.\n- Use the tools available to you to gather information, perform actions, and verify results.\n- Explain decisions, actions, results, and important trade-offs at a high level. Do not expose private chain-of-thought or hidden reasoning.\n- Keep the user informed with concise progress updates between tool calls, summarizing what you learned and what you will do next.\n- Avoid making more than 4 tool calls in a row without explaining what you are doing.\n- If a tool call fails or returns unexpected results, adapt your approach rather than repeating the same call.\n- When you have completed the task, present a clear and concise summary of what you did and what you found." -> string! diff --git a/dotnet/src/Microsoft.Agents.AI.Harness/PublicAPI/net9.0/PublicAPI.Unshipped.txt b/dotnet/src/Microsoft.Agents.AI.Harness/PublicAPI/net9.0/PublicAPI.Unshipped.txt index ab058de62d4..7910ecd6507 100644 --- a/dotnet/src/Microsoft.Agents.AI.Harness/PublicAPI/net9.0/PublicAPI.Unshipped.txt +++ b/dotnet/src/Microsoft.Agents.AI.Harness/PublicAPI/net9.0/PublicAPI.Unshipped.txt @@ -1 +1,3 @@ #nullable enable +*REMOVED*const Microsoft.Agents.AI.HarnessAgent.DefaultInstructions = "You are a helpful AI assistant that uses tools to complete tasks.\n\n## General guidelines\n\n- Think through the task before acting. Break complex work into clear steps.\n- Use the tools available to you to gather information, perform actions, and verify results.\n- Explain your reasoning and thought process as you work through tasks.\n- Explain what you learned and what you are going to do next between tool calls, so the user can follow along with your thought process.\n- Avoid making more than 4 tool calls in a row without explaining what you are doing.\n- If a tool call fails or returns unexpected results, adapt your approach rather than repeating the same call.\n- When you have completed the task, present a clear and concise summary of what you did and what you found." -> string! +const Microsoft.Agents.AI.HarnessAgent.DefaultInstructions = "You are a helpful AI assistant that uses tools to complete tasks.\n\n## General guidelines\n\n- Think through the task before acting. Break complex work into clear steps.\n- Use the tools available to you to gather information, perform actions, and verify results.\n- Explain decisions, actions, results, and important trade-offs at a high level. Do not expose private chain-of-thought or hidden reasoning.\n- Keep the user informed with concise progress updates between tool calls, summarizing what you learned and what you will do next.\n- Avoid making more than 4 tool calls in a row without explaining what you are doing.\n- If a tool call fails or returns unexpected results, adapt your approach rather than repeating the same call.\n- When you have completed the task, present a clear and concise summary of what you did and what you found." -> string! diff --git a/dotnet/src/Microsoft.Agents.AI.Harness/PublicAPI/netstandard2.0/PublicAPI.Unshipped.txt b/dotnet/src/Microsoft.Agents.AI.Harness/PublicAPI/netstandard2.0/PublicAPI.Unshipped.txt index ab058de62d4..7910ecd6507 100644 --- a/dotnet/src/Microsoft.Agents.AI.Harness/PublicAPI/netstandard2.0/PublicAPI.Unshipped.txt +++ b/dotnet/src/Microsoft.Agents.AI.Harness/PublicAPI/netstandard2.0/PublicAPI.Unshipped.txt @@ -1 +1,3 @@ #nullable enable +*REMOVED*const Microsoft.Agents.AI.HarnessAgent.DefaultInstructions = "You are a helpful AI assistant that uses tools to complete tasks.\n\n## General guidelines\n\n- Think through the task before acting. Break complex work into clear steps.\n- Use the tools available to you to gather information, perform actions, and verify results.\n- Explain your reasoning and thought process as you work through tasks.\n- Explain what you learned and what you are going to do next between tool calls, so the user can follow along with your thought process.\n- Avoid making more than 4 tool calls in a row without explaining what you are doing.\n- If a tool call fails or returns unexpected results, adapt your approach rather than repeating the same call.\n- When you have completed the task, present a clear and concise summary of what you did and what you found." -> string! +const Microsoft.Agents.AI.HarnessAgent.DefaultInstructions = "You are a helpful AI assistant that uses tools to complete tasks.\n\n## General guidelines\n\n- Think through the task before acting. Break complex work into clear steps.\n- Use the tools available to you to gather information, perform actions, and verify results.\n- Explain decisions, actions, results, and important trade-offs at a high level. Do not expose private chain-of-thought or hidden reasoning.\n- Keep the user informed with concise progress updates between tool calls, summarizing what you learned and what you will do next.\n- Avoid making more than 4 tool calls in a row without explaining what you are doing.\n- If a tool call fails or returns unexpected results, adapt your approach rather than repeating the same call.\n- When you have completed the task, present a clear and concise summary of what you did and what you found." -> string! diff --git a/python/packages/core/agent_framework/_harness/_agent.py b/python/packages/core/agent_framework/_harness/_agent.py index fbb9536b90f..e210c171e32 100644 --- a/python/packages/core/agent_framework/_harness/_agent.py +++ b/python/packages/core/agent_framework/_harness/_agent.py @@ -59,9 +59,10 @@ - Think through the task before acting. Break complex work into clear steps. - Use the tools available to you to gather information, perform actions, and verify results. -- Explain your reasoning and thought process as you work through tasks. -- Explain what you learned and what you are going to do next between tool calls, \ -so the user can follow along with your thought process. +- Explain decisions, actions, results, and important trade-offs at a high level. \ +Do not expose private chain-of-thought or hidden reasoning. +- Keep the user informed with concise progress updates between tool calls, \ +summarizing what you learned and what you will do next. - Avoid making more than 4 tool calls in a row without explaining what you are doing. - If a tool call fails or returns unexpected results, adapt your approach rather than \ repeating the same call. From 79dd87528c7e10155a580a6e6f5c1b85bf8fae15 Mon Sep 17 00:00:00 2001 From: Naveen Chatlapalli Date: Sat, 3 Oct 2026 06:55:50 -0500 Subject: [PATCH 2/3] test: guard Harness progress and private reasoning guidance --- python/packages/core/tests/core/test_harness_agent.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/python/packages/core/tests/core/test_harness_agent.py b/python/packages/core/tests/core/test_harness_agent.py index ae7ff32020b..3c0105c626c 100644 --- a/python/packages/core/tests/core/test_harness_agent.py +++ b/python/packages/core/tests/core/test_harness_agent.py @@ -94,6 +94,16 @@ def test_create_harness_agent_with_defaults() -> None: assert agent.id is not None +def test_default_harness_instructions_keep_reasoning_private() -> None: + """Default guidance should request useful progress without private reasoning.""" + instructions = _assemble_instructions(None, None) + assert instructions is not None + assert "Explain decisions, actions, results, and important trade-offs at a high level." in instructions + assert "Do not expose private chain-of-thought or hidden reasoning." in instructions + assert "concise progress updates between tool calls" in instructions + assert "thought process" not in instructions + + def test_create_harness_agent_includes_all_default_providers(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None: """Default assembly should include history, compaction, todo, mode, and file memory.""" monkeypatch.chdir(tmp_path) From 7741501af56f1e721e9f6309970c078d9c53db17 Mon Sep 17 00:00:00 2001 From: Naveen Chatlapalli Date: Tue, 6 Oct 2026 06:49:03 -0500 Subject: [PATCH 3/3] refactor: move Python changes to a separate PR --- .../packages/core/agent_framework/_harness/_agent.py | 7 +++---- python/packages/core/tests/core/test_harness_agent.py | 10 ---------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/python/packages/core/agent_framework/_harness/_agent.py b/python/packages/core/agent_framework/_harness/_agent.py index e210c171e32..fbb9536b90f 100644 --- a/python/packages/core/agent_framework/_harness/_agent.py +++ b/python/packages/core/agent_framework/_harness/_agent.py @@ -59,10 +59,9 @@ - Think through the task before acting. Break complex work into clear steps. - Use the tools available to you to gather information, perform actions, and verify results. -- Explain decisions, actions, results, and important trade-offs at a high level. \ -Do not expose private chain-of-thought or hidden reasoning. -- Keep the user informed with concise progress updates between tool calls, \ -summarizing what you learned and what you will do next. +- Explain your reasoning and thought process as you work through tasks. +- Explain what you learned and what you are going to do next between tool calls, \ +so the user can follow along with your thought process. - Avoid making more than 4 tool calls in a row without explaining what you are doing. - If a tool call fails or returns unexpected results, adapt your approach rather than \ repeating the same call. diff --git a/python/packages/core/tests/core/test_harness_agent.py b/python/packages/core/tests/core/test_harness_agent.py index 3c0105c626c..ae7ff32020b 100644 --- a/python/packages/core/tests/core/test_harness_agent.py +++ b/python/packages/core/tests/core/test_harness_agent.py @@ -94,16 +94,6 @@ def test_create_harness_agent_with_defaults() -> None: assert agent.id is not None -def test_default_harness_instructions_keep_reasoning_private() -> None: - """Default guidance should request useful progress without private reasoning.""" - instructions = _assemble_instructions(None, None) - assert instructions is not None - assert "Explain decisions, actions, results, and important trade-offs at a high level." in instructions - assert "Do not expose private chain-of-thought or hidden reasoning." in instructions - assert "concise progress updates between tool calls" in instructions - assert "thought process" not in instructions - - def test_create_harness_agent_includes_all_default_providers(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None: """Default assembly should include history, compaction, todo, mode, and file memory.""" monkeypatch.chdir(tmp_path)