Repository navigation
feat: .NET SDK Feature Parity with Python/JS - #3
Merged
Merged
Conversation
Changes: - Add typed exceptions (AuthenticationException, RateLimitException, PolicyDeniedException) - Add new governance APIs: CheckAsync, EnforceAsync, GovernAsync - Add admin APIs: ListAgentsAsync, CreateAgentAsync, UpdateAgentAsync, RevokeAgentAsync - Add admin APIs: ListPoliciesAsync, GetAuditLogAsync - Add proxy request methods (GetAsync, PostAsync, PutAsync, DeleteAsync) - Add IsHealthyAsync health check - Add TraceId support for request correlation - Add PolicyDecision model with full field support - Add full XML documentation comments - Add unit tests (exception, model, client tests) - Implement Semantic Kernel integration (MeshGuardFilter) - Add DI extensions for Semantic Kernel (AddMeshGuardGovernance) - Mark legacy types as [Obsolete] for backward compatibility - Bump version to 0.2.0
- Update MeshGuard.csproj TargetFramework -> TargetFrameworks - Update MeshGuard.Tests.csproj to match - Enables CI matrix builds across all supported .NET versions
dbhurley
force-pushed
the
feature/parity-update
branch
from
February 18, 2026 15:05
0546f35 to
d001465
Compare
- Replace C# 11 raw string literals with verbatim strings in tests - Update CI to conditionally build projects per .NET version - SemanticKernel project only builds on .NET 8.0 (SK requirement)
…upport SK 1.4.0 didn't have the filter interfaces; they were added in SK 1.9.0+
Ensures each job only builds/tests the matching framework
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Brings the .NET SDK to feature parity with the Python and JavaScript SDKs.
Changes
New Typed Exceptions
MeshGuardException- Base exception with TraceId supportAuthenticationException- Raised on 401 errorsPolicyDeniedException- Raised on 403 with full context (action, policy, rule, reason)RateLimitException- Raised on 429 errorsCore Governance APIs
CheckAsync(action, resource)- Returns PolicyDecision (never throws on deny)EnforceAsync(action, resource)- Throws PolicyDeniedException on denyGovernAsync<T>(action, fn)- Execute function only if allowed (lambda pattern)Admin APIs (require admin token)
ListAgentsAsync()- List all agentsCreateAgentAsync(options)- Create new agentUpdateAgentAsync(agentId, updates)- Update existing agentRevokeAgentAsync(agentId)- Delete/revoke agentListPoliciesAsync()- List all policiesGetAuditLogAsync(options)- Query audit log entriesProxy Request Methods
GetAsync(path, action)PostAsync(path, action, content)PostJsonAsync<T>(path, action, body)PutAsync(path, action, content)PutJsonAsync<T>(path, action, body)DeleteAsync(path, action)Health & Info
GetHealthAsync()- Get health statusIsHealthyAsync()- Quick boolean checkSemantic Kernel Integration
MeshGuardFilter- IFunctionInvocationFilter implementationAddMeshGuardGovernance()- DI extension for IKernelBuilderOther Improvements
[Obsolete]attributes on old typesTesting
Unit tests added (requires dotnet to run):
dotnet testBreaking Changes
None - all existing APIs preserved with
[Obsolete]warnings to guide migration.Closes #9