feat(audit): add arguments_hash, approver_did, policy_version to AuditEntry (#2449)#2473
Merged
imran-siddique merged 2 commits intoMay 22, 2026
Conversation
…tEntry Add three optional verifiability fields to the Agent Mesh AuditEntry schema (spec §4.3) and surface them via AuditLog.log() and CloudEvents serialization: - arguments_hash — hex SHA-256 of action arguments (mutation defense) - approver_did — DID of the approving principal (approval-chain identity) - policy_version — version id of the policy bundle (downgrade defense) Scope is intentionally additive. The §4.4 canonical hash field set is NOT changed in this PR, so previously-persisted entries continue to verify unchanged. A new spec section §4.3.1 documents that v1.0 does not include these fields in the integrity hash; spec v1.1 will extend MerkleAuditChain coverage under an explicit schema-version selector. Driven by external conformance review against the AgentBoundary v0.1 receipt spec (microsoft#2449) where these three fields were acknowledged as legitimate gaps. Five of nine TestAuditEntryExtensions tests cover the API surface, one asserts compute_hash() is unchanged for v1.0 backward compat, two cover CloudEvents serialization, one verifies chain integrity with the new fields populated. Prior art / related projects: - AgentBoundary v0.1 receipt spec (jamjet-labs/agentboundary). Field naming aligned with AGT's existing did: / agent_did conventions. Refs: microsoft#2449 Signed-off-by: sdev <sunil@sunilprakash.com>
The new fields added in the previous commit used `Optional[str]` to match the surrounding pre-existing style. agent-mesh/pyproject.toml configures ruff with `select = [..., "UP"]`, so UP045 fires on the new annotations. Convert only the three new field annotations and the AuditLog.log() kwargs to `str | None`; existing `Optional[str]` usages in this file are left as-is to keep the PR surface minimal. Signed-off-by: sdev <sunil@sunilprakash.com>
🤖 AI Agent: breaking-change-detector — API CompatibilityAPI CompatibilityNo breaking changes detected. |
🤖 AI Agent: security-scanner — View detailsNo security issues found. |
🤖 AI Agent: docs-sync-checker — Docs SyncDocs Sync
|
🤖 AI Agent: test-generator — `agentmesh/governance/audit.py`
|
|
🔴 Contributor Check: HIGH
Automated check by AGT Contributor Check. |
🤖 AI Agent: contributor-guide — View detailsHi @first-time-contributor, welcome to the project and thank you for your detailed and thoughtful contribution! 🎉 Your PR does a great job of maintaining backward compatibility while introducing new schema fields. Before merging:
Let us know if you need any help! 🚀 |
🤖 AI Agent: code-reviewer — Action Items:TL;DR: 0 blockers, 1 warning. The PR is well-implemented and adheres to the project's standards, but one issue could be addressed in a follow-up PR.
Action Items:
Warnings:
|
Contributor
Author
|
@microsoft-github-policy-service agree |
PR Review Summary
Verdict: |
imran-siddique
approved these changes
May 22, 2026
Contributor
imran-siddique
left a comment
There was a problem hiding this comment.
LGTM. Backward-compatible audit fields with chain integrity preserved.
This was referenced May 23, 2026
MohammadHaroonAbuomar
pushed a commit
to MohammadHaroonAbuomar/agt-acs
that referenced
this pull request
Jun 1, 2026
…tEntry (microsoft#2449) (microsoft#2473) * feat(audit): add arguments_hash, approver_did, policy_version to AuditEntry Add three optional verifiability fields to the Agent Mesh AuditEntry schema (spec §4.3) and surface them via AuditLog.log() and CloudEvents serialization: - arguments_hash — hex SHA-256 of action arguments (mutation defense) - approver_did — DID of the approving principal (approval-chain identity) - policy_version — version id of the policy bundle (downgrade defense) Scope is intentionally additive. The §4.4 canonical hash field set is NOT changed in this PR, so previously-persisted entries continue to verify unchanged. A new spec section §4.3.1 documents that v1.0 does not include these fields in the integrity hash; spec v1.1 will extend MerkleAuditChain coverage under an explicit schema-version selector. Driven by external conformance review against the AgentBoundary v0.1 receipt spec (microsoft#2449) where these three fields were acknowledged as legitimate gaps. Five of nine TestAuditEntryExtensions tests cover the API surface, one asserts compute_hash() is unchanged for v1.0 backward compat, two cover CloudEvents serialization, one verifies chain integrity with the new fields populated. Prior art / related projects: - AgentBoundary v0.1 receipt spec (jamjet-labs/agentboundary). Field naming aligned with AGT's existing did: / agent_did conventions. Refs: microsoft#2449 Signed-off-by: sdev <sunil@sunilprakash.com> * style(audit): use str | None for new fields per agent-mesh ruff (UP045) The new fields added in the previous commit used `Optional[str]` to match the surrounding pre-existing style. agent-mesh/pyproject.toml configures ruff with `select = [..., "UP"]`, so UP045 fires on the new annotations. Convert only the three new field annotations and the AuditLog.log() kwargs to `str | None`; existing `Optional[str]` usages in this file are left as-is to keep the PR surface minimal. Signed-off-by: sdev <sunil@sunilprakash.com> --------- Signed-off-by: sdev <sunil@sunilprakash.com>
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.
Description
Adds three optional verifiability fields to the Agent Mesh
AuditEntryschema (spec §4.3), surfaces them through
AuditLog.log()and theCloudEvents serializer:
arguments_hash— hex SHA-256 of action arguments (mutation defense)approver_did— DID of the approving principal (approval-chain identity)policy_version— version id of the policy bundle (downgrade defense)Driven by the conformance review in #2449 where these three fields were
acknowledged as legitimate gaps. This PR is intentionally additive — the
§4.4 canonical hash field set is not changed, so previously-persisted
audit entries continue to verify unchanged. A new spec subsection §4.3.1
documents the v1.0 caveat (fields recorded but not yet hash-covered) and
flags a planned v1.1 extension to
MerkleAuditChainunder an explicitschema-version selector.
This is the first of two PRs from the #2449 conformance review:
issued_at/completed_atdual timestamps andenvironmentparity into the Agent OS schemaA separate tracking issue will cover the v1.1 hash-coverage extension.
Type of Change
Package(s) Affected
Checklist
Attribution & Prior Art
Prior art / related projects:
the field set added here was derived from AgentBoundary's tamper-evidence
taxonomy applied against AGT's conformance evaluation in
adapters/microsoft-agt/.Field naming was deliberately aligned with AGT's existing
did:/agent_didconventions rather than copying AgentBoundary'ssubject/actornaming.AI Assistance
AI tools materially shaped this change: a Claude (Anthropic) coding assistant
drafted the schema additions, spec edits, and test cases. Every change was
reviewed, edited, and signed off by me; the design tradeoffs (additive-only
vs. schema-version + hash extension) were decided by me before drafting. The
v1.1 hash-coverage path was explicitly chosen as a follow-up PR per the
"smallest correct surface" guidance in CONTRIBUTING.md.
IP, Patents, and Licensing
Related Issues
Refs #2449