Thanks to visit codestin.com
Credit goes to github.com

Skip to content

docs: sync audit redaction status and framing with current code#1035

Closed
imran-siddique wants to merge 5 commits into
microsoft:mainfrom
imran-siddique:docs/sync-code-redaction-and-framing
Closed

docs: sync audit redaction status and framing with current code#1035
imran-siddique wants to merge 5 commits into
microsoft:mainfrom
imran-siddique:docs/sync-code-redaction-and-framing

Conversation

@imran-siddique

Copy link
Copy Markdown
Collaborator

Branch: docs/sync-code-redaction-and-framing (5 commits ahead of main)

Commits

d265c83 docs: sync audit redaction status and framing with current code
d198972 Merge branch 'main' of https://github.com/imran-siddique/agent-governance-toolkit
441cd11 feat(go): add MCP security, execution rings, and lifecycle management to Go SDK (#7)
3bcae49 feat(rust): add execution rings and lifecycle management to Rust SDK (#6)
da42383 feat(dotnet): add kill switch and lifecycle management to .NET SDK (#5)

imran-siddique and others added 5 commits April 11, 2026 20:47
- Add KillSwitch with arm/disarm, event history, and subscriber notifications
- Add LifecycleManager with 8-state machine and validated transitions
- Add 26 xUnit tests
- Update README

Co-authored-by: Copilot <[email protected]>
)

* feat(dotnet): add kill switch and lifecycle management to .NET SDK

- Add KillSwitch with arm/disarm, event history, and subscriber notifications
- Add LifecycleManager with 8-state machine and validated transitions
- Add comprehensive xUnit tests for both components (26 tests)
- Update .NET SDK README with usage documentation

Co-authored-by: Copilot <[email protected]>

* feat(rust): add execution rings and lifecycle management to Rust SDK

Add two new modules to the agentmesh Rust crate:

- rings.rs: Four-level execution privilege ring model (Admin/Standard/
  Restricted/Sandboxed) with per-agent assignment and per-ring action
  permissions, ported from the Python hypervisor enforcer.

- lifecycle.rs: Eight-state agent lifecycle manager (Provisioning through
  Decommissioned) with validated state transitions and event history,
  matching the lifecycle model used across other SDK languages.

Both modules include comprehensive unit tests and are re-exported from
the crate root. README updated with API tables and usage examples.

Co-authored-by: Copilot <[email protected]>

---------

Co-authored-by: Copilot <[email protected]>
… to Go SDK (#7)

* feat(openshell): add governance skill package and runnable example (#942)

Co-authored-by: Copilot <[email protected]>

* feat(go): add MCP security, execution rings, and lifecycle management to Go SDK

- mcp.go: MCP security scanner detecting tool poisoning, typosquatting,
  hidden instructions (zero-width chars, homoglyphs), and rug pulls
- rings.go: Execution privilege ring model (Admin/Standard/Restricted/Sandboxed)
  with default-deny access control
- lifecycle.go: Eight-state agent lifecycle manager with validated transitions
- Full test coverage for all three modules
- Updated README with API docs and examples

Co-authored-by: Copilot <[email protected]>

---------

Co-authored-by: Copilot <[email protected]>
- Update SOC2 mapping to reflect CredentialRedactor now redacts
  credential-like secrets before audit persistence (API keys, tokens,
  JWTs, connection strings, etc.). Remaining gap: non-credential PII
  (email, phone, addresses) not yet redacted in audit entries.
- Replace 'kernel-level enforcement' with 'policy-layer enforcement'
  in README, OWASP compliance, and architecture overview to match the
  existing 'application-level governance' framing in README Security
  section and LIMITATIONS.md.
- Qualify 10/10 OWASP coverage claim in COMPARISON.md with footnote
  clarifying this means mitigation components exist per risk category,
  not full elimination.
- Update owasp-llm-top10-mapping.md LLM06 row for credential redaction.

Addresses doc/code inconsistencies identified in external review.

Co-authored-by: Copilot <[email protected]>
@imran-siddique imran-siddique deleted the docs/sync-code-redaction-and-framing branch April 15, 2026 04:46
@github-actions github-actions Bot added documentation Improvements or additions to documentation tests agent-mesh agent-mesh package size/XL Extra large PR (500+ lines) labels Apr 15, 2026
@github-actions

Copy link
Copy Markdown
🤖 AI Agent: breaking-change-detector — Summary

🔍 API Compatibility Report

Summary

The recent changes in the microsoft/agent-governance-toolkit repository primarily involve documentation updates and the addition of new features in the .NET SDK. There are no breaking changes identified that would affect existing users of the API.

Findings

Severity Package Change Impact
🔵 agent-governance-dotnet New KillSwitch class added Provides new functionality for terminating rogue agents
🔵 agent-governance-dotnet New LifecycleManager class added Introduces lifecycle management for agents

Migration Guide

Since no breaking changes were found, there are no migration steps required. Users can safely update to the latest version without any concerns about compatibility issues.

@github-actions

Copy link
Copy Markdown
🤖 AI Agent: security-scanner — Security Scan Findings for Pull Request: `docs/sync-code-redaction-and-framing`

Security Scan Findings for Pull Request: docs/sync-code-redaction-and-framing

1. Prompt Injection Defense Bypass

  • Rating: 🔵 LOW
  • Finding: The documentation mentions a "26.67% policy violation rate" for prompt-based safety, indicating that there may be scenarios where crafted inputs could bypass the intended policy checks.
  • Attack Vector: If the policy engine is not robust against indirect prompt injections, attackers could manipulate agent behavior by crafting inputs that exploit these weaknesses.
  • Suggested Fix: Enhance the policy engine to include more rigorous checks against indirect prompt injections and provide clear guidelines in the documentation on how to mitigate these risks.

2. Policy Engine Circumvention

  • Rating: 🟡 MEDIUM
  • Finding: The change from "kernel-level enforcement" to "policy-layer enforcement" may imply a shift in how policies are applied, potentially weakening the enforcement mechanism.
  • Attack Vector: If the policy engine is not as stringent at the application layer compared to kernel-level enforcement, it may allow unauthorized actions to occur.
  • Suggested Fix: Ensure that the application-layer enforcement is as robust as the previous kernel-level enforcement and document the specific mechanisms in place to prevent circumvention.

3. Trust Chain Weaknesses

  • Rating: 🔵 LOW
  • Finding: The documentation does not explicitly mention SPIFFE/SVID validation or certificate pinning, which are critical for establishing trust in distributed systems.
  • Attack Vector: Without proper validation of identities and certificates, there is a risk of man-in-the-middle attacks or impersonation.
  • Suggested Fix: Implement and document SPIFFE/SVID validation and certificate pinning mechanisms to ensure trust in agent communications.

4. Credential Exposure

  • Rating: 🟠 HIGH
  • Finding: While the commit mentions that credential redaction has been implemented, there is still a gap in redacting non-credential PII (e.g., email, phone numbers) in audit logs.
  • Attack Vector: If non-credential PII is logged without redaction, it could lead to data leaks and privacy violations.
  • Suggested Fix: Implement a comprehensive PII redaction mechanism that includes all sensitive data types before logging.

5. Sandbox Escape

  • Rating: 🔵 LOW
  • Finding: The documentation does not provide details on sandboxing or isolation mechanisms for agents.
  • Attack Vector: Without proper isolation, agents could potentially escape their execution environment and access unauthorized resources.
  • Suggested Fix: Clearly document the sandboxing mechanisms in place and ensure that they are robust against escape attempts.

6. Deserialization Attacks

  • Rating: 🔵 LOW
  • Finding: There is no mention of deserialization practices in the changes.
  • Attack Vector: If any deserialization of untrusted data occurs, it could lead to remote code execution or other vulnerabilities.
  • Suggested Fix: Ensure that any deserialization processes are secure and validate input data rigorously.

7. Race Conditions

  • Rating: 🔵 LOW
  • Finding: The documentation does not address potential race conditions in policy checks or agent state transitions.
  • Attack Vector: If multiple agents or processes can modify shared state concurrently, it could lead to inconsistent policy enforcement.
  • Suggested Fix: Implement locking mechanisms or other concurrency controls to prevent race conditions in policy evaluations and state transitions.

8. Supply Chain Vulnerabilities

  • Rating: 🟡 MEDIUM
  • Finding: The documentation does not mention any measures against dependency confusion or typosquatting.
  • Attack Vector: If dependencies are not properly managed, an attacker could introduce malicious packages that could compromise the toolkit.
  • Suggested Fix: Implement a dependency management strategy that includes version pinning, regular audits, and the use of trusted package registries.

Summary

The changes in this pull request introduce some improvements but also highlight several areas of concern, particularly around credential exposure and policy enforcement mechanisms. Addressing these findings is crucial to maintaining the security integrity of the agent governance toolkit.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AI Agent: code-reviewer

Review Summary

This pull request primarily updates documentation to align with recent code changes, particularly around audit log redaction, OWASP compliance, and SOC 2 mappings. It also introduces new features in the .NET SDK, including a KillSwitch mechanism and an LifecycleManager for agents. While the documentation updates are generally accurate and helpful, there are some areas that require attention to ensure correctness, clarity, and alignment with security best practices.


Key Findings

🔴 CRITICAL: Non-Credential PII Redaction in Audit Logs

  • Issue: While credentials (e.g., API keys, tokens) are now redacted in audit logs via CredentialRedactor, non-credential PII (e.g., email addresses, phone numbers, physical addresses) is still stored verbatim in AuditEntry.parameters.
  • Impact: This creates a significant privacy risk, as audit logs could expose sensitive user data, violating confidentiality and privacy requirements (SOC 2 C1, P1–P8, OWASP LLM06).
  • Recommendation: Extend the CredentialRedactor to include non-credential PII patterns or introduce a dedicated PIIRedactor. Add a GovernancePolicy.redact_audit_pii flag to enable/disable this behavior.

🔴 CRITICAL: Lack of At-Rest Encryption for Audit Logs

  • Issue: Audit logs are stored in plaintext without encryption, making them vulnerable to unauthorized access.
  • Impact: This violates SOC 2 C1.1 and creates a significant risk of data breaches.
  • Recommendation: Implement at-rest encryption for all sensitive data, including audit logs and configuration files. Use a strong encryption algorithm such as AES-256.

🔴 CRITICAL: No Key Rotation Mechanism

  • Issue: The system lacks a mechanism for rotating cryptographic keys (e.g., Ed25519 keys, HMAC secrets, SPIFFE certificates).
  • Impact: This increases the risk of key compromise and violates SOC 2 C1.2.
  • Recommendation: Implement key rotation policies and tooling to periodically rotate cryptographic keys.

🔴 CRITICAL: DeltaEngine verify_chain() Stub

  • Issue: The verify_chain() method in DeltaEngine is a stub that always returns True, providing no actual tamper evidence for the hypervisor audit trail.
  • Impact: This undermines the integrity of the audit chain and violates SOC 2 PI1.5.
  • Recommendation: Implement a robust verify_chain() method that validates the integrity of the audit chain using cryptographic techniques (e.g., Merkle trees).

Additional Findings

🟡 WARNING: Potential Breaking Changes in Documentation

  • Issue: The terminology change from "kernel-level enforcement" to "policy-layer enforcement" may confuse existing users who are familiar with the previous terminology.
  • Impact: This could lead to misunderstandings about the system's capabilities.
  • Recommendation: Add a note in the documentation explaining the terminology change and its implications.

🟡 WARNING: KillSwitch and LifecycleManager Thread Safety

  • Issue: The KillSwitch and LifecycleManager classes use locking mechanisms to ensure thread safety. However, the use of lock (_lock) may lead to deadlocks if not carefully managed.
  • Impact: Potential for deadlocks or race conditions in multi-threaded environments.
  • Recommendation: Conduct a thorough review of thread safety in these classes. Consider using ReaderWriterLockSlim for more granular control over read/write access.

💡 SUGGESTION: Expand PII Detection Patterns

  • Issue: The current PII detection only covers SSNs and credit card numbers.
  • Recommendation: Expand the PII detection patterns to include email addresses, phone numbers, IP addresses, physical addresses, and other sensitive data categories recommended by OWASP.

💡 SUGGESTION: Add Privacy Notice Mechanism

  • Issue: The toolkit lacks a mechanism to generate and deliver privacy notices to end users.
  • Recommendation: Implement a feature to generate privacy notices dynamically, ensuring compliance with privacy regulations.

💡 SUGGESTION: Improve Documentation Clarity

  • Issue: Some documentation updates are verbose and could be more concise.
  • Recommendation: Simplify explanations where possible and use consistent terminology across all documentation.

Actionable Items

  1. Address Critical Issues:

    • Implement non-credential PII redaction in audit logs.
    • Add at-rest encryption for sensitive data.
    • Develop a key rotation mechanism for cryptographic keys.
    • Implement a functional verify_chain() method in DeltaEngine.
  2. Mitigate Warnings:

    • Clarify the terminology change in the documentation.
    • Review and improve thread safety in KillSwitch and LifecycleManager.
  3. Enhance Functionality:

    • Expand PII detection patterns.
    • Add a privacy notice mechanism.
    • Improve documentation clarity and consistency.

Conclusion

This pull request makes significant progress in aligning documentation with the current state of the codebase and introduces valuable new features in the .NET SDK. However, the identified critical issues must be addressed to ensure the security and compliance of the toolkit. Additionally, the potential breaking changes in terminology and thread safety concerns in the new .NET features warrant further review and clarification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-mesh agent-mesh package documentation Improvements or additions to documentation size/XL Extra large PR (500+ lines) tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant