Skip to content
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
c2e0ae4
feat(dotnet): add Microsoft.Agents.AI.Tools.Shell with LocalShellTool
Apr 30, 2026
c397780
feat(shell): close Python parity gaps for LocalShellTool
Apr 30, 2026
8255bbc
feat(shell): add DockerShellTool sandboxed shell tier
Apr 30, 2026
7bc0932
test(shell): add DockerShellTool integration tests
Apr 30, 2026
ab3c0c9
style(shell): apply dotnet format pass
Apr 30, 2026
ad3fd51
docs(shell): add DockerShellTool walkthrough with sequence diagrams
Apr 30, 2026
d7e5707
PR 5604 review fixes (group a): libc DllImport, namespace cleanup, po…
May 1, 2026
3ac13b2
PR 5604 review fix (group b): add ShellKind.Sh for /bin/sh fallback
May 1, 2026
b74ea0b
PR 5604 review fix (group d): honor timeout=null, add DefaultTimeout
May 1, 2026
1579a83
PR 5604 review fix (group e): smart requireApproval default for Docke…
May 1, 2026
0022bb9
PR 5604 review fix (group c): wrap POSIX shell in setsid for correct …
May 1, 2026
b40ed60
.Net: DockerShellTool design + caller-cancel container leak fixes (PR…
May 1, 2026
6b30f56
.Net: Fill PR #5604 test coverage gaps for Shell tools
May 1, 2026
cb1ac20
feat(dotnet/shell): add ShellEnvironmentProvider for OS-aware shell i…
May 1, 2026
83b1270
fix(dotnet/shell): address PR review feedback round 3
May 1, 2026
4ce489f
Address PR #5604 round 4 review feedback
May 4, 2026
fe041a4
Add Async suffix to async test methods to satisfy IDE1006
May 4, 2026
3a0a513
Fix CPU busy-spin in WaitForSentinelAsync
May 4, 2026
3bfd332
Remove unused onCommand audit hook from shell tools
May 4, 2026
4972f2c
Align Shell csproj with Foundry.Hosting preview-package conventions
May 4, 2026
d5d2e25
Document why ShellEnvironmentProvider uses Instructions, not Messages
May 4, 2026
b55e86a
Clarify which probe failures ShellEnvironmentProvider swallows
May 4, 2026
5339a80
Strip cross-language and bug-history narrative from shell tool comments
May 4, 2026
f329604
Address PR #5604 round 5 review feedback
May 4, 2026
2a0af41
Address PR #5604 round 6 review feedback
May 4, 2026
ede4d33
Address PR #5604 round 7 review feedback
May 5, 2026
dfa1fa1
Address PR #5604 round 8 review feedback
May 5, 2026
1d09869
Address PR #5604 round 9 review feedback
May 5, 2026
7618e54
Address PR #5604 round 10 review feedback
May 6, 2026
94acaca
fix(dotnet): address PR #5604 round-3 review feedback
May 7, 2026
1351c55
fix(dotnet): address PR #5604 round-3 follow-up nits
May 7, 2026
106c2b1
Refactor shell tool: abstract ShellExecutor, options classes, Contain…
May 7, 2026
4f702df
Remove IsHardenedConfiguration; AsAIFunction defaults to approval-gated
May 7, 2026
2022da7
Replace ShellExecutionException/ShellTimeoutException with standard e…
May 8, 2026
ff7d8e4
Remove ShellPolicy.DefaultDenyList; default policy is empty
May 11, 2026
ba0b137
Document single-session ownership for persistent shell mode
May 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions dotnet/agent-framework-dotnet.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,7 @@
<Project Path="src/Microsoft.Agents.AI.Mem0/Microsoft.Agents.AI.Mem0.csproj" />
<Project Path="src/Microsoft.Agents.AI.OpenAI/Microsoft.Agents.AI.OpenAI.csproj" />
<Project Path="src/Microsoft.Agents.AI.Purview/Microsoft.Agents.AI.Purview.csproj" />
<Project Path="src/Microsoft.Agents.AI.Tools.Shell/Microsoft.Agents.AI.Tools.Shell.csproj" />
<Project Path="src/Microsoft.Agents.AI.Workflows.Declarative.Foundry/Microsoft.Agents.AI.Workflows.Declarative.Foundry.csproj" />
<Project Path="src/Microsoft.Agents.AI.Workflows.Declarative.Mcp/Microsoft.Agents.AI.Workflows.Declarative.Mcp.csproj" />
<Project Path="src/Microsoft.Agents.AI.Workflows.Declarative/Microsoft.Agents.AI.Workflows.Declarative.csproj" />
Expand Down Expand Up @@ -601,6 +602,7 @@
<Project Path="tests/Microsoft.Agents.AI.Mem0.UnitTests/Microsoft.Agents.AI.Mem0.UnitTests.csproj" />
<Project Path="tests/Microsoft.Agents.AI.OpenAI.UnitTests/Microsoft.Agents.AI.OpenAI.UnitTests.csproj" />
<Project Path="tests/Microsoft.Agents.AI.Purview.UnitTests/Microsoft.Agents.AI.Purview.UnitTests.csproj" />
<Project Path="tests/Microsoft.Agents.AI.Tools.Shell.UnitTests/Microsoft.Agents.AI.Tools.Shell.UnitTests.csproj" />
<Project Path="tests/Microsoft.Agents.AI.UnitTests/Microsoft.Agents.AI.UnitTests.csproj" />
<Project Path="tests/Microsoft.Agents.AI.Workflows.Declarative.Mcp.UnitTests/Microsoft.Agents.AI.Workflows.Declarative.Mcp.UnitTests.csproj" />
<Project Path="tests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests/Microsoft.Agents.AI.Workflows.Declarative.UnitTests.csproj" />
Expand Down
677 changes: 677 additions & 0 deletions dotnet/src/Microsoft.Agents.AI.Tools.Shell/DockerShellTool.cs

Large diffs are not rendered by default.

53 changes: 53 additions & 0 deletions dotnet/src/Microsoft.Agents.AI.Tools.Shell/IShellExecutor.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// Copyright (c) Microsoft. All rights reserved.

using System;
using System.Threading;
using System.Threading.Tasks;

namespace Microsoft.Agents.AI.Tools.Shell;

/// <summary>
/// Pluggable backend that runs shell commands on behalf of a tool.
/// </summary>
/// <remarks>
/// <para>
/// <see cref="LocalShellTool"/> runs commands directly on the host (no
/// isolation; approval-in-the-loop is the security boundary). A future
/// <c>DockerShellTool</c> runs them inside a container with resource
/// limits, network isolation, and a non-root user — the container itself
/// is the security boundary, which is why it can be used without approval
/// gating for untrusted-input scenarios.
/// </para>
/// <para>
/// The interface is intentionally minimal so callers can plug in their own
/// executor (Firecracker microVM, remote SSH, WASI runtime, etc.) without
/// forking the framework. Mirrors the Python <c>ShellExecutor</c> Protocol
/// in <c>agent_framework_tools.shell._executor_base</c>.
/// </para>
/// </remarks>
public interface IShellExecutor : IAsyncDisposable
Comment thread
alliscode marked this conversation as resolved.
Outdated
{
/// <summary>
/// Eagerly initialize the backend. Idempotent; subsequent calls are
/// no-ops once the executor is started. For stateless executors this
/// is typically a no-op.
/// </summary>
/// <param name="cancellationToken">Cancellation token.</param>
Task StartAsync(CancellationToken cancellationToken = default);
Comment thread
alliscode marked this conversation as resolved.
Outdated

/// <summary>
/// Tear down all backend resources. Idempotent; safe to call multiple
/// times.
/// </summary>
/// <param name="cancellationToken">Cancellation token.</param>
Task CloseAsync(CancellationToken cancellationToken = default);

/// <summary>
/// Run a single command and return its result. Implementations are
/// expected to apply the configured per-command timeout and surface
/// it via <see cref="ShellResult.TimedOut"/> + <c>ExitCode = 124</c>.
/// </summary>
/// <param name="command">The shell command to execute.</param>
/// <param name="cancellationToken">Cancellation token.</param>
Task<ShellResult> RunAsync(string command, CancellationToken cancellationToken = default);
}
Loading
Loading