microsoft / microsoft/agent-governance-toolkit

[Feature]: enrich audit entries with reason, argument digest, and principal

Open
#3,668 2 comments 0 reactions 0 assignees View on GitHub
needs-review:MEDIUM
Dominant language
Python
Stars
6.3k
Forks
1.1k
Avg merge
5d 11h
Merged PRs (30d)
142

Description

## Package

Other — `agent-governance-opencode`

## Problem Statement

OpenCode audit entries provide a strong hash chain, but tool decisions do not consistently carry enough context to serve as standalone compliance evidence:

- decision reasons can be empty even when policy logic produced one;
- no canonical digest identifies the attempted arguments;
- `agentId: opencode:` attributes activity to a session, not an optional human/delegating principal.

## Impact

When an agent acts under delegated user identity, the target system may record the action as the human's. A joinable agent-side digest and principal are needed to distinguish human action from agent-mediated action later. We currently emit a parallel audit event, but it is not covered by AGT's hash chain and creates two logs to correlate.

## Proposed Solution

- Preserve the evaluator's decision reason in the chained audit entry.
- Add a canonical SHA-256 digest of relevant tool arguments, without storing raw sensitive arguments.
- Accept an optional caller-supplied principal/subject from the integrator's identity layer.
- Include the active policy version or hash.
- Specify canonicalization, privacy boundaries, and backward compatibility for existing audit consumers.

## Alternatives Considered

- Maintain a parallel integration-specific audit stream. This works operationally but weakens integrity and increases correlation burden.

## Priority

Important

## Contribution

- [x] I would be willing to submit a PR for this feature

## Coordination status

No implementation PR is currently linked (checked 2026-08-11). Related session-scoped evaluation work is tracked separately in #3669.

Contributors are welcome to propose an implementation. Please comment here before starting, search open PRs for overlapping audit work, and include `Closes #3668` in the PR description.

Contributor guide

Open the contributing guide

Research direction

Start by tracing the existing chained audit entry, evaluator decision path, and parallel audit event described in the issue. Define the canonical argument digest, optional principal, policy version or hash, privacy boundaries, and backward compatibility; done means these fields are integrated into one chained audit record without raw sensitive arguments.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.