Repository navigation
feat(examples): protect-mcp governed example — Cedar policies + signed receipts - #1159
Conversation
|
Welcome to the Agent Governance Toolkit! Thanks for your first pull request. |
There was a problem hiding this comment.
🤖 AI Agent: code-reviewer
Code Review for feat(examples): protect-mcp governed example — Cedar policies + signed receipts
🔴 CRITICAL: Security Issues
-
Inline Fallback Using SHA-256 HMAC for Receipt Signing
- The fallback implementation in the absence of
scopeblind-protect-mcpuses SHA-256 HMAC for signing receipts. While this is acceptable for demonstration purposes, it is not cryptographically equivalent to Ed25519. This fallback could lead to developers mistakenly deploying insecure configurations in production. - Actionable Fix: Add explicit warnings in the code and documentation that the fallback is for demonstration purposes only and should never be used in production. Consider raising a runtime exception if the fallback is used in non-development environments.
if not HAS_SCOPEBLIND: print("⚠ scopeblind-protect-mcp not installed — using inline fallback") if os.getenv("ENV") != "development": raise RuntimeError("Inline fallback is insecure and should not be used in production.")
- The fallback implementation in the absence of
-
Receipt Replay Protection
- The current implementation does not include a mechanism to prevent replay attacks. While receipts are hash-chained, there is no explicit nonce or timestamp validation to ensure that a receipt cannot be reused maliciously.
- Actionable Fix: Introduce a nonce or timestamp validation mechanism to detect and reject replayed receipts. This can be implemented in the
ReceiptVerifierclass or as part of theAuditLogintegrity checks.
-
Receipt Chain Integrity
- The receipt chain integrity check relies on the
parent_receipt_hashfield but does not validate the entire chain against tampering. If an attacker modifies multiple receipts in the chain, the current implementation may fail to detect it. - Actionable Fix: Implement a Merkle tree-based integrity check for the receipt chain to ensure that tampering with any part of the chain is detectable.
- The receipt chain integrity check relies on the
-
Thread Safety in Receipt Chain
- The
receipt_chainis a global list that is not thread-safe. Concurrent access to this list could lead to race conditions, especially in multi-threaded environments. - Actionable Fix: Use a thread-safe data structure like
queue.Queueor protect access toreceipt_chainwith a threading lock.
- The
🟡 WARNING: Potential Breaking Changes
-
Backward Compatibility with Existing Examples
- The new example introduces a dependency on
scopeblind-protect-mcp, which may not be installed in environments where previous examples were used. This could break existing workflows. - Actionable Fix: Clearly document the new dependency and provide installation instructions. Alternatively, provide a flag to disable the new functionality for users who do not wish to install the dependency.
- The new example introduces a dependency on
-
Cedar Policy Compatibility
- The example assumes a specific structure for Cedar policies. If users have existing policies that do not conform to this structure, they may encounter errors.
- Actionable Fix: Provide a migration guide or validation tool to help users adapt their existing policies to the new structure.
💡 Suggestions for Improvement
-
Documentation Enhancements
- The documentation is comprehensive but could benefit from a clear distinction between production-grade features and demonstration-only features. For example, explicitly label the inline fallback as "DEMO ONLY."
- Include a section on best practices for securing the signing key (e.g., using a hardware security module or secure key management service).
-
Error Handling
- The code currently prints warnings when dependencies are missing but does not provide actionable guidance on how to resolve these issues.
- Suggestion: Use
logginginstead ofprintstatements and include detailed error messages with links to installation instructions.
-
Type Annotations
- While the code includes some type annotations, they are not comprehensive. For example, the
scopeblind_contextfunction and theReceiptVerifiermethods lack type hints. - Actionable Fix: Add type annotations to all functions and methods to improve code readability and maintainability.
- While the code includes some type annotations, they are not comprehensive. For example, the
-
Unit Tests
- While the example includes scenarios for testing, these are not integrated into the
pytestframework used in the repository. - Actionable Fix: Convert the scenarios into formal unit tests using
pytest. This will ensure that the examples are automatically tested as part of the CI/CD pipeline.
- While the example includes scenarios for testing, these are not integrated into the
-
Policy Evaluation Logging
- The example does not include logging for policy evaluation results. This could make it difficult to debug issues in production.
- Actionable Fix: Add logging statements to capture the results of policy evaluations, including the policy ID, decision, and any conditions that were evaluated.
-
Offline Verification CLI
- The example mentions the
npx @veritasacta/verifyCLI for offline verification but does not provide a Python-based alternative. - Suggestion: Include a Python script or function for offline verification to avoid requiring Node.js in Python-only environments.
- The example mentions the
Summary of Recommendations
-
Critical Fixes:
- Warn against using the SHA-256 HMAC fallback in production.
- Add replay protection for receipts.
- Enhance receipt chain integrity checks.
- Ensure thread safety for the
receipt_chain.
-
Warnings:
- Document potential breaking changes due to new dependencies and policy structures.
-
Suggestions:
- Improve documentation and error handling.
- Add comprehensive type annotations.
- Convert scenarios into
pytesttests. - Include logging for policy evaluations.
- Provide a Python-based offline verification tool.
By addressing these issues, the example will be more secure, robust, and user-friendly, aligning with the repository's focus on security and governance.
🤖 AI Agent: security-scanner — Security Review of PR: `feat(examples): protect-mcp governed example — Cedar policies + signed receipts`Security Review of PR:
|
| Category | Rating | Recommendation |
|---|---|---|
| Prompt Injection Defense | 🔵 LOW | Validate context.trust_tier and add tests for edge cases. |
| Policy Engine Circumvention | 🟠 HIGH | Remove fallback signing or restrict it to non-production environments. |
| Trust Chain Weaknesses | 🟠 HIGH | Use Merkle trees and SPIFFE/SVID for stronger trust guarantees. |
| Credential Exposure | 🔴 CRITICAL | Replace hardcoded keys with secure key management solutions. |
| Sandbox Escape | 🟠 HIGH | Add explicit sandboxing mechanisms for tool calls. |
| Deserialization Attacks | 🟡 MEDIUM | Use strict JSON schema validation for all inputs and outputs. |
| Race Conditions | 🟡 MEDIUM | Ensure thread safety and test for concurrent access scenarios. |
| Supply Chain | 🔴 CRITICAL | Pin dependency versions and verify their integrity using checksums. |
Actionable Recommendations
- Mandatory Ed25519 Signing: Remove the SHA-256 HMAC fallback or restrict it to non-production environments.
- Secure Key Management: Replace hardcoded keys with a secure key management solution.
- Trust Chain Hardening: Use Merkle trees and SPIFFE/SVID for stronger trust guarantees.
- Dependency Security: Pin dependency versions and verify their integrity using checksums.
- Sandboxing: Ensure all tool calls are executed in isolated environments.
- Thread Safety: Audit governance components for thread safety and add tests for concurrent scenarios.
- JSON Validation: Use strict JSON schema validation for all inputs and outputs.
Final Rating: 🟠 HIGH
While the PR introduces valuable governance features, several critical issues (e.g., credential exposure, supply chain risks) must be addressed to ensure robust security.
There was a problem hiding this comment.
🤖 AI Agent: code-reviewer
Review Summary
This pull request introduces a governed example for the scopeblind-protect-mcp integration, showcasing the use of Cedar policies, Ed25519-signed receipts, and other governance mechanisms. The example is well-structured, with clear documentation, a quickstart script, and a comprehensive set of scenarios that demonstrate the integration's capabilities. However, there are several areas where improvements can be made, particularly in terms of security, type safety, and thread safety.
🔴 CRITICAL: Security Issues
-
Inline Fallback Uses Weak Cryptography
- The fallback implementation of
Receipt.signandReceipt.verifyuses SHA-256 HMAC instead of Ed25519 for signing and verification. While this is acceptable for demonstration purposes, it is critical to ensure that this fallback is not used in production. - Recommendation: Add a clear warning in the documentation and code comments that the fallback implementation is for demonstration purposes only and should not be used in production. Consider adding a runtime check to explicitly prevent the fallback from being used in production environments.
- The fallback implementation of
-
Receipt Chain Integrity Validation
- The receipt chain integrity check in
scenario_5_receipt_chain_integrityonly validates the hash linkage between receipts but does not ensure the chronological order of timestamps. This could allow an attacker to reorder receipts in the chain without detection. - Recommendation: Add a check to ensure that the timestamps of receipts in the chain are strictly increasing.
- The receipt chain integrity check in
-
Replay Protection
- The example does not include a mechanism for detecting replay attacks, where a valid receipt is reused maliciously.
- Recommendation: Implement a nonce or timestamp-based mechanism to detect and reject replayed receipts.
-
Key Management
- The demo signing key (
DEMO_KEY) is hardcoded in the example. While this is acceptable for demonstration purposes, it sets a bad precedent for developers who might copy this code into production. - Recommendation: Add a clear warning in the documentation and code comments that the demo key is for demonstration purposes only. Provide guidance on securely generating and managing keys in production.
- The demo signing key (
🟡 WARNING: Potential Breaking Changes
- Backward Compatibility with Existing Examples
- This PR introduces a new governed example that follows the pattern of existing examples (
openai-agents-governed,crewai-governed, etc.). However, the inline fallback implementation may lead to inconsistencies if developers expect the same behavior across all examples. - Recommendation: Ensure that all governed examples use consistent patterns and implementations. If the inline fallback is unique to this example, document this clearly to avoid confusion.
- This PR introduces a new governed example that follows the pattern of existing examples (
💡 Suggestions for Improvement
-
Type Annotations
- The
Receiptclass and several functions lack complete type annotations, which can lead to runtime errors and make the code harder to understand. - Recommendation: Add type annotations to all functions and class methods. For example:
def make_receipt(tool: str, decision: str, policy: str, tier: str) -> Receipt:
- The
-
Thread Safety
- The
receipt_chainlist is a global variable that is modified by multiple scenarios. This could lead to race conditions in a multithreaded environment. - Recommendation: Use thread-safe data structures (e.g.,
queue.Queue) or synchronization primitives (e.g.,threading.Lock) to ensure thread safety.
- The
-
Error Handling
- The code lacks robust error handling, especially in critical sections like receipt signing and verification.
- Recommendation: Add error handling for scenarios such as invalid input, failed signature verification, and chain integrity failures. For example:
try: receipt.verify(DEMO_KEY) except Exception as e: print(f"Error verifying receipt: {e}")
-
Test Coverage
- While the example includes 8 scenarios, it is unclear if these are integrated into the CI/CD pipeline for automated testing.
- Recommendation: Add automated tests for the example scenarios using
pytestto ensure they work as expected and do not break in future updates.
-
Documentation
- The documentation is comprehensive but could benefit from additional clarity on the following points:
- The distinction between the inline fallback and the production implementation.
- The security implications of using the demo key and fallback implementation.
- How to set up and use the
npx @veritasacta/verifytool for offline verification.
- Recommendation: Add a "Security Considerations" section to the README to address these points.
- The documentation is comprehensive but could benefit from additional clarity on the following points:
-
Code Duplication
- The inline fallback implementation duplicates functionality that is already provided by the
scopeblind-protect-mcpadapter. - Recommendation: Consider refactoring the code to minimize duplication. For example, you could create a common utility module for receipt handling that can be used across different examples.
- The inline fallback implementation duplicates functionality that is already provided by the
Final Assessment
- The PR is well-structured and provides a valuable addition to the repository.
- However, the use of weak cryptography in the fallback implementation and the lack of replay protection are critical security issues that must be addressed before merging.
- Additionally, improvements in type safety, thread safety, and documentation will enhance the overall quality and maintainability of the code.
Let me know if you need further clarification or assistance!
…d receipts Adds a governed example showing MCP tool calls with Cedar policy enforcement and Ed25519 signed receipts. Complements the scopeblind-protect-mcp integration merged in microsoft#667. Contents: - examples/protect-mcp-governed/getting_started.py: 8-scenario showcase (Cedar eval, authoritative deny, tamper detection, spending authority, chain integrity, trust tier mapping, offline verification, full pipeline) - examples/protect-mcp-governed/policies/mcp-tool-access.yaml: AGT policy file - examples/protect-mcp-governed/README.md: architecture diagram, scenario table - examples/quickstart/protect_mcp_governed.py: 30-line quickstart Runs standalone (zero dependencies) with inline signing fallback. Uses full scopeblind-protect-mcp adapter when installed. All scenarios produce signed, hash-chained receipts verifiable with: npx @veritasacta/verify Signed-off-by: Tom Farley <tomjwxf@gmail.com>
d3b0520 to
62579c3
Compare
There was a problem hiding this comment.
🤖 AI Agent: code-reviewer
Review Summary
This pull request introduces a comprehensive governed example for the scopeblind-protect-mcp integration, including 8 scenarios that demonstrate Cedar policy evaluation, signed receipts, and offline verification. The implementation is well-documented, and the examples are thorough and align with the existing patterns in the repository. However, there are a few areas that require attention to ensure security, correctness, and maintainability.
🔴 CRITICAL: Security Issues
-
Fallback to SHA-256 HMAC for Signing in Standalone Mode
- The fallback to SHA-256 HMAC for signing receipts in standalone mode (
Receipt.signmethod) is not cryptographically secure for this use case. HMAC is not suitable for digital signatures because it does not provide non-repudiation. An attacker with access to the signing key could forge receipts. - Actionable Fix:
- Replace the fallback with a more secure signing mechanism, such as Ed25519 or RSA, even in standalone mode. If cryptographic libraries are unavailable, explicitly document the limitations of the fallback mechanism and warn users not to use it in production.
- The fallback to SHA-256 HMAC for signing receipts in standalone mode (
-
Hardcoded Signing Key
- The demo signing key (
DEMO_KEY) is hardcoded as"a" * 64. This is a security risk, as it encourages poor key management practices. - Actionable Fix:
- Use a securely generated key for the demo, and provide instructions for generating a new key. For example, use
os.urandom(32).hex()to generate a random key.
- Use a securely generated key for the demo, and provide instructions for generating a new key. For example, use
- The demo signing key (
-
Receipt Replay Attack Mitigation
- There is no explicit mechanism to prevent receipt replay attacks in the fallback implementation. While the
ReceiptVerifierin the full implementation may address this, the fallback mode is vulnerable. - Actionable Fix:
- Add a nonce or timestamp validation mechanism to detect and reject replayed receipts in the fallback implementation.
- There is no explicit mechanism to prevent receipt replay attacks in the fallback implementation. While the
🟡 WARNING: Potential Breaking Changes
- Backward Compatibility of Policy Evaluation
- The introduction of Cedar policies and the
CedarPolicyBridgemay change the behavior of policy evaluation, especially if Cedar deny decisions override AGT trust scores. - Actionable Fix:
- Clearly document the precedence rules between Cedar policies and AGT trust scores in the public API. Ensure that existing users are aware of these changes and provide a migration guide if necessary.
- The introduction of Cedar policies and the
💡 Suggestions for Improvement
-
Thread Safety
- The
ReceiptVerifierandAuditLogcomponents are described as thread-safe, but this is not explicitly tested in the examples. Concurrent access safety is critical for real-world usage. - Actionable Suggestion:
- Add unit tests or examples that demonstrate and validate thread safety under concurrent access.
- The
-
Type Annotations
- While the code includes some type annotations, they are inconsistent. For example,
Receipt.parent_receipt_hashis annotated asstr | None, which is not compatible with Python 3.9. - Actionable Suggestion:
- Use
Optional[str]instead ofstr | Nonefor compatibility with Python 3.9.
- Use
- While the code includes some type annotations, they are inconsistent. For example,
-
Error Handling
- The fallback implementation lacks robust error handling. For example, if the signing key is invalid or the receipt chain is corrupted, the program may fail silently or with unclear error messages.
- Actionable Suggestion:
- Add explicit error handling and logging for key operations, such as signing, verification, and chain integrity checks.
-
Policy Example Validation
- The provided Cedar policy examples are clear but lack validation against the actual Cedar schema.
- Actionable Suggestion:
- Include a script or test that validates the Cedar policies against the schema to ensure correctness.
-
Documentation
- The documentation is thorough but could benefit from a dedicated section on security best practices, especially for key management and receipt verification.
- Actionable Suggestion:
- Add a "Security Best Practices" section to the README, emphasizing the importance of secure key storage and avoiding the fallback mode in production.
-
Test Coverage
- While the examples are comprehensive, they are not integrated into the automated test suite.
- Actionable Suggestion:
- Convert key scenarios into pytest-based tests to ensure they are automatically executed during CI/CD.
Final Assessment
This pull request is a valuable addition to the repository, providing a well-documented and comprehensive example of governed MCP integration. However, the fallback implementation introduces critical security risks that must be addressed before merging. Additionally, improvements in thread safety validation, type annotations, and error handling will enhance the robustness and maintainability of the code.
- Merge Recommendation: Do not merge until the 🔴 CRITICAL issues are resolved. Address the 🟡 WARNING and 💡 SUGGESTION items to improve the overall quality and reliability of the implementation.
Imran Siddique (imran-siddique)
left a comment
There was a problem hiding this comment.
Nice governed example with Cedar policies.
b66dda5
into
microsoft:main
…eipts Adds a governed example for physical-world sensor events, extending the receipt format from microsoft#667 and microsoft#1159 (software agent tool calls) to hardware attestation from a cold chain sensor device. Developed as part of an active hardware R&D program (Australian ETCF grant application, TRL 4→6) for a dedicated cold chain attestation sensor. The device specification predates this contribution — sharing here because the physical AI governance gap identified in microsoft#787 is exactly the problem we're solving at the hardware level. 8 scenarios: 1. Cold Chain Journey (Barossa Valley → Tokyo, 12 readings) 2. Temperature Excursion Blocks Release (22.4°C → deny) 3. Shock Event Creates Alert (8.7g → alert) 4. Receipt Tamper Detection (field edit → signature invalid) 5. Chain Integrity Verification (hash links intact) 6. Multi-Sensor Correlation (compound temp+shock+lux event) 7. Offline Verification (all receipts verified, no network) 8. Device Identity Attestation (boot receipt with firmware hash) The receipt envelope format is identical to software agent receipts from microsoft#1159. Same verifier (npx @veritasacta/verify), same chain structure, same JCS canonicalization. One proof layer for both software agents and physical devices. Hardware spec: SHT40 + LIS2DH12 + L76K + VEML7700 + ATECC608B. BOM target: $14.50 at volume. Related: microsoft#787 (physical AI OWASP gap), microsoft#667 (protect-mcp integration), Signed-off-by: tommylauren <tfarley@utexas.edu> microsoft#1159 (software governed example).
…eipts (#1168) Adds a governed example for physical-world sensor events, extending the receipt format from #667 and #1159 (software agent tool calls) to hardware attestation from a cold chain sensor device. Developed as part of an active hardware R&D program (Australian ETCF grant application, TRL 4→6) for a dedicated cold chain attestation sensor. The device specification predates this contribution — sharing here because the physical AI governance gap identified in #787 is exactly the problem we're solving at the hardware level. 8 scenarios: 1. Cold Chain Journey (Barossa Valley → Tokyo, 12 readings) 2. Temperature Excursion Blocks Release (22.4°C → deny) 3. Shock Event Creates Alert (8.7g → alert) 4. Receipt Tamper Detection (field edit → signature invalid) 5. Chain Integrity Verification (hash links intact) 6. Multi-Sensor Correlation (compound temp+shock+lux event) 7. Offline Verification (all receipts verified, no network) 8. Device Identity Attestation (boot receipt with firmware hash) The receipt envelope format is identical to software agent receipts from #1159. Same verifier (npx @veritasacta/verify), same chain structure, same JCS canonicalization. One proof layer for both software agents and physical devices. Hardware spec: SHT40 + LIS2DH12 + L76K + VEML7700 + ATECC608B. BOM target: $14.50 at volume. Related: #787 (physical AI OWASP gap), #667 (protect-mcp integration), #1159 (software governed example). Signed-off-by: tommylauren <tfarley@utexas.edu> Co-authored-by: tommylauren <tfarley@utexas.edu>
Teaches the decision-receipt layer that sits between internal audit logs (Tutorial 04) and artifact signing (Tutorial 26): per tool-call Ed25519 signatures over JCS-canonical payloads, hash-chained across the session, verifiable offline by any party with the public key. Mirrors the existing `examples/protect-mcp-governed/` (PR microsoft#1159) and `examples/physical-attestation-governed/` (PR microsoft#1168) reference code, uses their exact APIs, and cross-references Tutorials 01, 04, 07, 08, 12, 26, and 27. Adds two entries to docs/tutorials/README.md: - Supply Chain Security section (alongside 25, 26, 27) - "Enterprise compliance" learning path step 6 Standards covered: RFC 8032 (Ed25519), RFC 8785 (JCS), Cedar (AWS), IETF draft-farley-acta-signed-receipts.
* docs: add Tutorial 33 — Offline-Verifiable Decision Receipts Teaches the decision-receipt layer that sits between internal audit logs (Tutorial 04) and artifact signing (Tutorial 26): per tool-call Ed25519 signatures over JCS-canonical payloads, hash-chained across the session, verifiable offline by any party with the public key. Mirrors the existing `examples/protect-mcp-governed/` (PR #1159) and `examples/physical-attestation-governed/` (PR #1168) reference code, uses their exact APIs, and cross-references Tutorials 01, 04, 07, 08, 12, 26, and 27. Adds two entries to docs/tutorials/README.md: - Supply Chain Security section (alongside 25, 26, 27) - "Enterprise compliance" learning path step 6 Standards covered: RFC 8032 (Ed25519), RFC 8785 (JCS), Cedar (AWS), IETF draft-farley-acta-signed-receipts. * docs: strengthen Tutorial 33 with SLSA integration and anchoring primitives Four additions landing after the initial PR: 1. Receipt Lifecycle ASCII diagram in "The Receipt Format" section. Visualizes mint → JCS canonical → Ed25519 sign → store → verify so readers can see why the determinism invariant holds. 2. A real Cedar policy block in §4 (Composing with Cedar Policies). Previously the section described the CedarDecision API shape without showing what a policy producing one actually looks like. Now shows a 10-line permit/forbid policy and links out to cedar-for-agents for the full schema generator. 3. Neutral anchoring primitives subsection in §6 (Cross-Implementation). Names Sigstore Rekor and in-toto attestations as the cross-org verification fabric beyond the four implementations. References sigstore/rekor#2798 and in-toto/attestation#549. 4. New §7 "Emitting Receipts as SLSA Provenance". When an AI agent is itself the builder, the receipt chain IS the per-step build log. Shows the exact byproducts JSON shape for carrying a receipt chain inside a SLSA provenance v1 attestation, referencing the draft agent-commit build type at refs.arewm.com/agent-commit/v0.1 and the active slsa-framework/slsa#1594 and #1606 discussions. No new dependencies. All APIs still verified against the merged examples/protect-mcp-governed/ and examples/physical-attestation-governed/ reference code. * docs(tutorial-33): add sidebar on operator-signed vs authority-chain modes Per @aeoess review on #1197: the four implementations listed in the cross-implementation section make different identity-binding choices that matter for deployment selection. This sidebar names them explicitly so readers evaluating receipts for their environment can pick the right mode. - Operator-signed mode (protect-mcp, protect-mcp-adk, sb-runtime): sufficient for internal audit, single-regulator evidence, single- tenant compliance. The signer is the operator's supervisor hook. - Authority-chain-referenced mode (asqav / APS governance hook): additionally required for cross-org agent commerce, multi-tenant regulated environments, and use cases where principal authority is itself auditable. Receipts reference a delegation-chain root. Both modes verify against @veritasacta/verify and use the same outer receipt structure; the distinction is the presence of an optional delegation_chain_root field in the payload. Cross-references arewm/refs.arewm.com#1 for the parallel authority- chain attestation proposal as a SLSA byproduct. --------- Co-authored-by: tommylauren <tfarley@utexas.edu>
Adds docs/integrations/sb-runtime.md mirroring the openshell.md structure. Positions sb-runtime as a Veritas Acta-conformant runtime backend that combines Cedar policy evaluation, Landlock + seccomp sandboxing, and Ed25519-signed decision receipts in a single binary. Covers: - When sb-runtime is the right pick (build-vs-buy tradeoffs vs OpenShell, nono) - Architecture with request flow - Both in-process Python shim and standalone binary setup paths - Ring 2 vs Ring 3 semantics against the same binary - Cedar policy example - Policy layering example with allow/deny receipt flow - Field mapping from AGT primitives to sb-runtime equivalents - Veritas Acta receipt format reference (cross-links Tutorial 33) - Monitoring metrics compatible with AGT's OpenTelemetry patterns - FAQ covering OpenShell/nono relationships, multi-OS story, offline verification, open-source status, key rotation - Related links including IETF draft, reference verifier, integration profile repo No code changes, no new API surface; anchors on the already-merged examples/protect-mcp-governed/ (PR microsoft#1159), examples/physical-attestation-governed/ (PR microsoft#1168), and Tutorial 33 (PR microsoft#1197). Part of the three-PR sequence proposed on microsoft#748: 1. This PR: integration doc 2. Provider shim in packages/agent-runtime/ 3. Worked example in examples/sb-runtime-governed/
…lementation) (#1202) * docs: Integration guide for sb-runtime (Ring 2/3 backend) Adds docs/integrations/sb-runtime.md mirroring the openshell.md structure. Positions sb-runtime as a Veritas Acta-conformant runtime backend that combines Cedar policy evaluation, Landlock + seccomp sandboxing, and Ed25519-signed decision receipts in a single binary. Covers: - When sb-runtime is the right pick (build-vs-buy tradeoffs vs OpenShell, nono) - Architecture with request flow - Both in-process Python shim and standalone binary setup paths - Ring 2 vs Ring 3 semantics against the same binary - Cedar policy example - Policy layering example with allow/deny receipt flow - Field mapping from AGT primitives to sb-runtime equivalents - Veritas Acta receipt format reference (cross-links Tutorial 33) - Monitoring metrics compatible with AGT's OpenTelemetry patterns - FAQ covering OpenShell/nono relationships, multi-OS story, offline verification, open-source status, key rotation - Related links including IETF draft, reference verifier, integration profile repo No code changes, no new API surface; anchors on the already-merged examples/protect-mcp-governed/ (PR #1159), examples/physical-attestation-governed/ (PR #1168), and Tutorial 33 (PR #1197). Part of the three-PR sequence proposed on #748: 1. This PR: integration doc 2. Provider shim in packages/agent-runtime/ 3. Worked example in examples/sb-runtime-governed/ * docs: Reframe sb-runtime as a Veritas Acta receipt format implementation Positions the Veritas Acta receipt format as the interoperable artifact and sb-runtime as one of several AGT-compatible signers. Adds explicit guidance for operators who want nono as the Linux sandbox primitive: run sb-runtime in --ring 2 mode inside a nono capability set and let nono own the sandbox layer. Changes: - Title and intro lead with "Veritas Acta receipt format implementation" rather than "Ring 2/3 governance backend". The longer-lived object is the receipt format, not the specific signer. - New section 'sb-runtime's role in the Veritas Acta receipt model' enumerates sb-runtime / nono / OpenShell as peer paths, with routing guidance for each. - New section 'Composing sb-runtime with nono' documents the recommended Linux composition: nono for sandbox, sb-runtime --ring 2 for Cedar + receipts. Includes the architecture diagram and operator steps. - FAQ 'What about nono?' rewritten to position nono as the recommended Linux sandbox primitive for Veritas Acta deployments, not a competitor. - Policy Layering Example updated to name nono explicitly. No changes to the signed receipt format, the receipt store, or the verification path. @veritasacta/verify accepts Ring 2 receipts produced under any sandbox layer; the sandbox choice is not part of the receipt's trust boundary. --------- Co-authored-by: tommylauren <tfarley@utexas.edu>
…d receipts (microsoft#1159) Adds a governed example showing MCP tool calls with Cedar policy enforcement and Ed25519 signed receipts. Complements the scopeblind-protect-mcp integration merged in microsoft#667. Contents: - examples/protect-mcp-governed/getting_started.py: 8-scenario showcase (Cedar eval, authoritative deny, tamper detection, spending authority, chain integrity, trust tier mapping, offline verification, full pipeline) - examples/protect-mcp-governed/policies/mcp-tool-access.yaml: AGT policy file - examples/protect-mcp-governed/README.md: architecture diagram, scenario table - examples/quickstart/protect_mcp_governed.py: 30-line quickstart Runs standalone (zero dependencies) with inline signing fallback. Uses full scopeblind-protect-mcp adapter when installed. All scenarios produce signed, hash-chained receipts verifiable with: npx @veritasacta/verify Signed-off-by: Tom Farley <tomjwxf@gmail.com> Co-authored-by: tommylauren <tfarley@utexas.edu>
…eipts (microsoft#1168) Adds a governed example for physical-world sensor events, extending the receipt format from microsoft#667 and microsoft#1159 (software agent tool calls) to hardware attestation from a cold chain sensor device. Developed as part of an active hardware R&D program (Australian ETCF grant application, TRL 4→6) for a dedicated cold chain attestation sensor. The device specification predates this contribution — sharing here because the physical AI governance gap identified in microsoft#787 is exactly the problem we're solving at the hardware level. 8 scenarios: 1. Cold Chain Journey (Barossa Valley → Tokyo, 12 readings) 2. Temperature Excursion Blocks Release (22.4°C → deny) 3. Shock Event Creates Alert (8.7g → alert) 4. Receipt Tamper Detection (field edit → signature invalid) 5. Chain Integrity Verification (hash links intact) 6. Multi-Sensor Correlation (compound temp+shock+lux event) 7. Offline Verification (all receipts verified, no network) 8. Device Identity Attestation (boot receipt with firmware hash) The receipt envelope format is identical to software agent receipts from microsoft#1159. Same verifier (npx @veritasacta/verify), same chain structure, same JCS canonicalization. One proof layer for both software agents and physical devices. Hardware spec: SHT40 + LIS2DH12 + L76K + VEML7700 + ATECC608B. BOM target: $14.50 at volume. Related: microsoft#787 (physical AI OWASP gap), microsoft#667 (protect-mcp integration), microsoft#1159 (software governed example). Signed-off-by: tommylauren <tfarley@utexas.edu> Co-authored-by: tommylauren <tfarley@utexas.edu>
) * docs: add Tutorial 33 — Offline-Verifiable Decision Receipts Teaches the decision-receipt layer that sits between internal audit logs (Tutorial 04) and artifact signing (Tutorial 26): per tool-call Ed25519 signatures over JCS-canonical payloads, hash-chained across the session, verifiable offline by any party with the public key. Mirrors the existing `examples/protect-mcp-governed/` (PR microsoft#1159) and `examples/physical-attestation-governed/` (PR microsoft#1168) reference code, uses their exact APIs, and cross-references Tutorials 01, 04, 07, 08, 12, 26, and 27. Adds two entries to docs/tutorials/README.md: - Supply Chain Security section (alongside 25, 26, 27) - "Enterprise compliance" learning path step 6 Standards covered: RFC 8032 (Ed25519), RFC 8785 (JCS), Cedar (AWS), IETF draft-farley-acta-signed-receipts. * docs: strengthen Tutorial 33 with SLSA integration and anchoring primitives Four additions landing after the initial PR: 1. Receipt Lifecycle ASCII diagram in "The Receipt Format" section. Visualizes mint → JCS canonical → Ed25519 sign → store → verify so readers can see why the determinism invariant holds. 2. A real Cedar policy block in §4 (Composing with Cedar Policies). Previously the section described the CedarDecision API shape without showing what a policy producing one actually looks like. Now shows a 10-line permit/forbid policy and links out to cedar-for-agents for the full schema generator. 3. Neutral anchoring primitives subsection in §6 (Cross-Implementation). Names Sigstore Rekor and in-toto attestations as the cross-org verification fabric beyond the four implementations. References sigstore/rekor#2798 and in-toto/attestation#549. 4. New §7 "Emitting Receipts as SLSA Provenance". When an AI agent is itself the builder, the receipt chain IS the per-step build log. Shows the exact byproducts JSON shape for carrying a receipt chain inside a SLSA provenance v1 attestation, referencing the draft agent-commit build type at refs.arewm.com/agent-commit/v0.1 and the active slsa-framework/slsa#1594 and microsoft#1606 discussions. No new dependencies. All APIs still verified against the merged examples/protect-mcp-governed/ and examples/physical-attestation-governed/ reference code. * docs(tutorial-33): add sidebar on operator-signed vs authority-chain modes Per @aeoess review on microsoft#1197: the four implementations listed in the cross-implementation section make different identity-binding choices that matter for deployment selection. This sidebar names them explicitly so readers evaluating receipts for their environment can pick the right mode. - Operator-signed mode (protect-mcp, protect-mcp-adk, sb-runtime): sufficient for internal audit, single-regulator evidence, single- tenant compliance. The signer is the operator's supervisor hook. - Authority-chain-referenced mode (asqav / APS governance hook): additionally required for cross-org agent commerce, multi-tenant regulated environments, and use cases where principal authority is itself auditable. Receipts reference a delegation-chain root. Both modes verify against @veritasacta/verify and use the same outer receipt structure; the distinction is the presence of an optional delegation_chain_root field in the payload. Cross-references arewm/refs.arewm.com#1 for the parallel authority- chain attestation proposal as a SLSA byproduct. --------- Co-authored-by: tommylauren <tfarley@utexas.edu>
…lementation) (microsoft#1202) * docs: Integration guide for sb-runtime (Ring 2/3 backend) Adds docs/integrations/sb-runtime.md mirroring the openshell.md structure. Positions sb-runtime as a Veritas Acta-conformant runtime backend that combines Cedar policy evaluation, Landlock + seccomp sandboxing, and Ed25519-signed decision receipts in a single binary. Covers: - When sb-runtime is the right pick (build-vs-buy tradeoffs vs OpenShell, nono) - Architecture with request flow - Both in-process Python shim and standalone binary setup paths - Ring 2 vs Ring 3 semantics against the same binary - Cedar policy example - Policy layering example with allow/deny receipt flow - Field mapping from AGT primitives to sb-runtime equivalents - Veritas Acta receipt format reference (cross-links Tutorial 33) - Monitoring metrics compatible with AGT's OpenTelemetry patterns - FAQ covering OpenShell/nono relationships, multi-OS story, offline verification, open-source status, key rotation - Related links including IETF draft, reference verifier, integration profile repo No code changes, no new API surface; anchors on the already-merged examples/protect-mcp-governed/ (PR microsoft#1159), examples/physical-attestation-governed/ (PR microsoft#1168), and Tutorial 33 (PR microsoft#1197). Part of the three-PR sequence proposed on microsoft#748: 1. This PR: integration doc 2. Provider shim in packages/agent-runtime/ 3. Worked example in examples/sb-runtime-governed/ * docs: Reframe sb-runtime as a Veritas Acta receipt format implementation Positions the Veritas Acta receipt format as the interoperable artifact and sb-runtime as one of several AGT-compatible signers. Adds explicit guidance for operators who want nono as the Linux sandbox primitive: run sb-runtime in --ring 2 mode inside a nono capability set and let nono own the sandbox layer. Changes: - Title and intro lead with "Veritas Acta receipt format implementation" rather than "Ring 2/3 governance backend". The longer-lived object is the receipt format, not the specific signer. - New section 'sb-runtime's role in the Veritas Acta receipt model' enumerates sb-runtime / nono / OpenShell as peer paths, with routing guidance for each. - New section 'Composing sb-runtime with nono' documents the recommended Linux composition: nono for sandbox, sb-runtime --ring 2 for Cedar + receipts. Includes the architecture diagram and operator steps. - FAQ 'What about nono?' rewritten to position nono as the recommended Linux sandbox primitive for Veritas Acta deployments, not a competitor. - Policy Layering Example updated to name nono explicitly. No changes to the signed receipt format, the receipt store, or the verification path. @veritasacta/verify accepts Ring 2 receipts produced under any sandbox layer; the sandbox choice is not part of the receipt's trust boundary. --------- Co-authored-by: tommylauren <tfarley@utexas.edu>
Summary
Adds a governed example for the
scopeblind-protect-mcpintegration merged in #667, following the same pattern asopenai-agents-governed,crewai-governed, andsmolagents-governed.What's included
examples/protect-mcp-governed/— full governed example with 8 scenarios:npx @veritasacta/verifyexamples/quickstart/protect_mcp_governed.py— 30-line quickstart showing sign + verify + tamper detection.Design decisions
agent-governance-toolkitandscopeblind-protect-mcpare not installed. Uses full adapter when available.openai-agents-governed(which has 9 scenarios).Testing
Both scripts exit 0 with correct output.
Relationship to #667
PR #667 added the
scopeblind-protect-mcpintegration package with 5 components and 50+ tests. This PR adds the governed example and quickstart that show developers how to USE it — completing the pattern that every other major integration (OpenAI Agents, CrewAI, smolagents) already has.Closes #1157.