summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Agent.Admin/Agent.Admin.Host/WfpDynamicSession.cs10
-rw-r--r--src/Agent.App/Agent.App.csproj2
-rw-r--r--src/Agent.Core/Prompts/FixedSystemPrompt.md2
-rw-r--r--src/Agent.Windows/Diagnostics/WindowsPlatformCheck.cs10
-rw-r--r--src/Agent.Windows/Security/AppContainerProfile.cs2
5 files changed, 16 insertions, 10 deletions
diff --git a/src/Agent.Admin/Agent.Admin.Host/WfpDynamicSession.cs b/src/Agent.Admin/Agent.Admin.Host/WfpDynamicSession.cs
index 4aa21da..3961e83 100644
--- a/src/Agent.Admin/Agent.Admin.Host/WfpDynamicSession.cs
+++ b/src/Agent.Admin/Agent.Admin.Host/WfpDynamicSession.cs
@@ -20,7 +20,7 @@ public sealed unsafe class WfpDynamicSession : IDisposable
private readonly List<ulong> _filterIds = [];
private WfpDynamicSession(FwpmEngineClose0SafeHandle engine) => _engine = engine;
- public static WfpDynamicSession Open(string displayName = "Agent Sandbox MCP dynamic task session")
+ public static WfpDynamicSession Open(string displayName = "WinAgent Sandbox MCP dynamic task session")
{
FWPM_SESSION0 session = default;
session.flags = PInvoke.FWPM_SESSION_FLAG_DYNAMIC;
@@ -48,7 +48,7 @@ public sealed unsafe class WfpDynamicSession : IDisposable
try
{
Guid subLayerKey = Guid.NewGuid();
- fixed (char* subLayerName = "Agent Sandbox MCP task sublayer")
+ fixed (char* subLayerName = "WinAgent Sandbox MCP task sublayer")
{
FWPM_SUBLAYER0 subLayer = default;
subLayer.subLayerKey = subLayerKey;
@@ -60,8 +60,8 @@ public sealed unsafe class WfpDynamicSession : IDisposable
fixed (byte* sidPointer = sidBytes)
{
foreach (NetworkEndpoint endpoint in allowedEndpoints ?? []) _filterIds.Add(AddPackagePermit(endpoint, subLayerKey, (SID*)sidPointer));
- _filterIds.Add(AddPackageBlock(PInvoke.FWPM_LAYER_ALE_AUTH_CONNECT_V4, subLayerKey, (SID*)sidPointer, "Agent Sandbox MCP IPv4 default block"));
- _filterIds.Add(AddPackageBlock(PInvoke.FWPM_LAYER_ALE_AUTH_CONNECT_V6, subLayerKey, (SID*)sidPointer, "Agent Sandbox MCP IPv6 default block"));
+ _filterIds.Add(AddPackageBlock(PInvoke.FWPM_LAYER_ALE_AUTH_CONNECT_V4, subLayerKey, (SID*)sidPointer, "WinAgent Sandbox MCP IPv4 default block"));
+ _filterIds.Add(AddPackageBlock(PInvoke.FWPM_LAYER_ALE_AUTH_CONNECT_V6, subLayerKey, (SID*)sidPointer, "WinAgent Sandbox MCP IPv6 default block"));
}
ThrowIfError(PInvoke.FwpmTransactionCommit0(_engine), "FwpmTransactionCommit0");
committed = true;
@@ -159,7 +159,7 @@ public sealed unsafe class WfpDynamicSession : IDisposable
conditions[2].matchType = FWP_MATCH_TYPE.FWP_MATCH_EQUAL;
conditions[2].conditionValue.type = FWP_DATA_TYPE.FWP_UINT16;
conditions[2].conditionValue.uint16 = endpoint.Port;
- string displayName = $"Agent Sandbox MCP allow {endpoint.Address}:{endpoint.Port}";
+ string displayName = $"WinAgent Sandbox MCP allow {endpoint.Address}:{endpoint.Port}";
fixed (char* name = displayName)
{
FWPM_FILTER0 filter = default;
diff --git a/src/Agent.App/Agent.App.csproj b/src/Agent.App/Agent.App.csproj
index c63f3c0..9c46d09 100644
--- a/src/Agent.App/Agent.App.csproj
+++ b/src/Agent.App/Agent.App.csproj
@@ -4,7 +4,6 @@
<TargetFramework>net10.0-windows10.0.26100.0</TargetFramework>
<AssemblyName>agent-mcp</AssemblyName>
<RootNamespace>Agent.App</RootNamespace>
- <Version>1.0.0</Version>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
<ItemGroup>
@@ -26,5 +25,6 @@
<Content Include="..\..\prompts\user-system.md" Link="prompts\user-system.md" CopyToOutputDirectory="PreserveNewest" CopyToPublishDirectory="PreserveNewest" />
<Content Include="..\..\skills\**\*" Link="skills\%(RecursiveDir)%(Filename)%(Extension)" CopyToOutputDirectory="PreserveNewest" CopyToPublishDirectory="PreserveNewest" />
<Content Include="..\..\README.md" Link="README.md" CopyToPublishDirectory="PreserveNewest" />
+ <Content Include="..\..\CHANGELOG.md" Link="CHANGELOG.md" CopyToPublishDirectory="PreserveNewest" />
</ItemGroup>
</Project>
diff --git a/src/Agent.Core/Prompts/FixedSystemPrompt.md b/src/Agent.Core/Prompts/FixedSystemPrompt.md
index 3cbc6e7..f3bd69f 100644
--- a/src/Agent.Core/Prompts/FixedSystemPrompt.md
+++ b/src/Agent.Core/Prompts/FixedSystemPrompt.md
@@ -1,4 +1,4 @@
-You are the execution agent inside AI Agent Sandbox MCP Server.
+You are the execution agent inside WinAgent Sandbox MCP.
Follow the active SandboxPolicy and never claim an external effect unless an Internal Tool result proves it occurred.
Never reveal hidden reasoning, policy internals, credentials, or capabilities not present in the supplied capability summary.
Complete a request only when every TaskGraph node is completed and all required effects are verified.
diff --git a/src/Agent.Windows/Diagnostics/WindowsPlatformCheck.cs b/src/Agent.Windows/Diagnostics/WindowsPlatformCheck.cs
index 89a2106..32086d3 100644
--- a/src/Agent.Windows/Diagnostics/WindowsPlatformCheck.cs
+++ b/src/Agent.Windows/Diagnostics/WindowsPlatformCheck.cs
@@ -36,9 +36,9 @@ public static class WindowsPlatformCheck
bfe = true;
if (helper)
{
- string current = Assembly.GetEntryAssembly()?.GetName().Version?.ToString(3) ?? "";
+ Version? current = Assembly.GetEntryAssembly()?.GetName().Version;
string candidate = FileVersionInfo.GetVersionInfo(helperPath).FileVersion ?? "";
- version = candidate.StartsWith(current, StringComparison.Ordinal);
+ version = current is not null && HasSameReleaseIdentity(current, candidate);
}
return new(platform, profile, bfe, helper, version, null, null);
}
@@ -47,6 +47,12 @@ public static class WindowsPlatformCheck
{ return new(platform, profile, bfe, helper, version, ex.HResult, ex.Message); }
}
+ internal static bool HasSameReleaseIdentity(Version current, string candidate)
+ {
+ if (!Version.TryParse(candidate, out Version? parsed)) return false;
+ return current.Major == parsed.Major && current.Minor == parsed.Minor && current.Build == parsed.Build;
+ }
+
private static FwpmEngineClose0SafeHandle OpenBfeReadOnly()
{
uint result = PInvoke.FwpmEngineOpen0(10, null, null, out FwpmEngineClose0SafeHandle engine);
diff --git a/src/Agent.Windows/Security/AppContainerProfile.cs b/src/Agent.Windows/Security/AppContainerProfile.cs
index 97258ec..83b1675 100644
--- a/src/Agent.Windows/Security/AppContainerProfile.cs
+++ b/src/Agent.Windows/Security/AppContainerProfile.cs
@@ -14,7 +14,7 @@ public sealed partial class AppContainerProfile
public static AppContainerProfile EnsureFixed()
{
- int result = Native.CreateAppContainerProfile(FixedName, "Agent Sandbox MCP v1", "Fixed sandbox profile for Agent Sandbox MCP", 0, 0, out nint sidPointer);
+ int result = Native.CreateAppContainerProfile(FixedName, "WinAgent Sandbox MCP", "Fixed sandbox profile for WinAgent Sandbox MCP", 0, 0, out nint sidPointer);
if (result == AlreadyExists) result = Native.DeriveAppContainerSidFromAppContainerName(FixedName, out sidPointer);
if (result < 0) Marshal.ThrowExceptionForHR(result);
try