Repository navigation
examples: add signature-vs-execution verification boundary example (#506) - #509
Merged
imran-siddique merged 2 commits intoOct 14, 2026
Conversation
…gentrust-io#506) Signed-off-by: Raghuvar Durga <177662415+drk-ram@users.noreply.github.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…gentrust-io#506) Signed-off-by: Raghuvar Durga <177662415+drk-ram@users.noreply.github.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
imran-siddique
approved these changes
Oct 14, 2026
imran-siddique
left a comment
Member
There was a problem hiding this comment.
Verified locally: the script prints 4 of 4 as documented and the 49 tests pass. The README's pinned commit c08974c3 predates the example; the CHANGELOG follow-up PR repins it to the merge commit.
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.
What this changes
Closes #506.
Adds an executable, synthetic example under
examples/signature-execution-boundary/and automated checks intests/test_signature_execution_boundary.pydemonstrating the boundary between a valid Ed25519 signature and verified execution in TRACE v0.2, building ondocs/quickstart.md,docs/tutorials/verifying-a-trust-record.md, andLIMITATIONS.md.Run
python examples/signature-execution-boundary/signature_execution_boundary.py --out DIRto generate deterministic UTF-8/LF JSON artifacts (baseline-record.trace.json,invented-execution-record.trace.json, andverification-inputs.json) and execute four boundary checks:verify_record()validatesbaseline-record.trace.jsonagainstschema/trace-claim.json, confirmseat_profile, matchescnf.jwkto the caller's configuredtrusted_keythumbprint (8WEkIEIu0xGWVjA1V8weTlFmpl0D7N3EHC0yfRjfnQQ), checks freshness atnow=1791936000, and returnsVerificationResultwithrevocation.outcome == "no_check_performed"andplatform_measurement.outcome == "not_attempted".data_classin the script, and parametrized acrosssubject,iat,data_class,model.model_id,runtime.measurement,policy.bundle_hash,policy.enforcement_mode,build_provenance.digest,appraisal.status,tool_transcript.hash, andtool_transcript.call_countintests/test_signature_execution_boundary.py) still passesvalidate_json()but raisescryptography.exceptions.InvalidSignature.cnf.jwkconfirmation-key binding: Verifying againstwrong_trusted_keyraisesValueError(cnf.jwkthumbprint mismatch); replacingrecord["cnf"]["jwk"]withwrong_trusted_keywithout re-signing passesvalidate_json()and raisesInvalidSignaturebecausecnf.jwkis part of the RFC 8785 preimage; by contrast,allow_embedded_key=Trueemits aUserWarningand proves internal self-consistency only.invented-execution-record.trace.json, signed by the same trusted issuer key at the same(subject, iat)with fabricated claims (policy.enforcement_mode: "enforce",build_provenance.slsa_level: 3,appraisal.status: "affirming", andtool_transcript.call_count: 12), passesvalidate_json()andverify_record()with an identicalVerificationResult. Only independent comparison oftool_transcript.hashagainst the retained external transcript separatesbaseline=matchedfrominvented=mismatchandunretained=unavailable.No specification, schema, or SDK changes.
Cold-reader review (
CONTRIBUTING.md)An independent cold-reader session reviewed the initial diff (
c08974c3c0b33d9bd77bc1778b238a86f770b788..71f02fb) againstCONTRIBUTING.md,docs/quickstart.md,docs/tutorials/verifying-a-trust-record.md,LIMITATIONS.md, andexamples/mcp-retry/:README.mdChecks 2, 3, 4): The initialsignature_execution_boundary.pydid not exerciseallow_embedded_key=True(UserWarning) in Check 3 orNone -> "unavailable"in Check 4 (both were only intests/test_signature_execution_boundary.py), andREADME.mdCheck 2 omittedmodelfrom the list of signed claims. Updatedsignature_execution_boundary.pyto addcommitment_status()and execute both checks directly, and clarified theREADME.mdtable.tupleand non-finite floats):canonical_bytes()and_commitment()initially traverseddictandlistbut nottuple, andtest_example_numeric_domain_refuses_floats_and_unsafe_integersomitted"NaN","Infinity", and"-Infinity". Extended both walkers to(list, tuple)and added parametrized tests for"NaN","Infinity","-Infinity", and tuple-nested floats/unsafe integers.test_script_reproduces_fixed_evidence_bytes_and_stdoutthat extracts thetextoutput block fromexamples/signature-execution-boundary/README.mdand compares it byte-for-byte against the script's stdout.Contributor: Raghuvar Durga (@drk-ram)
Type of change
Spec section
Informative example and test suite for §3.2.2 (signature and key binding) and §3.3 (verification vs. appraisal); no normative text modified.
Tests for a fix
Not a code or schema fix.
Checklist
git commit -s)CHANGELOG.mdupdated (for any normative change)<!-- CHANGED: #NNN: description -->in spec text