Add the Python AGT bridge, and fix the trust scale our guide got wrong - #53
Merged
Merged
Conversation
AGT is Python-first (microsoft/agent-governance-toolkit ships Python, TypeScript, Go, Rust and .NET), so a JavaScript-only bridge would miss where most integrations actually live. sdk/python/agt.py mirrors packages/pctr/src/agt.mjs: consequence classification, AGT TrustScore and tiers, ExecutionRing mapping, SPIFFE ids, input.ttp claims for Rego, behavioural evidence, AgentMesh attestations, and event normalization over AGT's real shapes. Two implementations agree only as long as something checks, so scripts/check-agt-parity.mjs runs both over one corpus — 52 checks across classification, tiers, scores, rings, domains and event normalization — and fails the build on any divergence. Verified it catches drift: moving the Python "trusted" threshold from 0.6 to 0.65 fails with exit 1 and names the check. Also corrects docs/integration-guide.md 6.4 and docs/ecosystem-integrations.md, which specified agt_trust_score = round(ttp_score * 1000). Upstream AGT scores 0-1, banded untrusted 0.0 / provisional 0.30 / trusted 0.60 / verified 0.85 (agent-governance-typescript/src/trust.ts), so sending 918 where AGT expects 0.918 would read as Verified for every agent. The guide now states the real mapping, keeps the 0-1000 scale only for downstream consumers that ask for it, and adds 6.4.1 on mapping consequence severity onto ExecutionRing rather than duplicating it. CI now compiles agt.py, runs the 19 Python tests, and enforces parity. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.
AGT is Python-first — microsoft/agent-governance-toolkit ships Python, TypeScript, Go, Rust and .NET SDKs — so a JavaScript-only bridge misses where most integrations actually live.
The correction
docs/integration-guide.md§6.4 anddocs/ecosystem-integrations.mdspecified:That is wrong against upstream AGT. Its
TrustScore.overallis[0.0, 1.0], banded into tiers byagent-governance-typescript/src/trust.ts:Sending
918where AGT expects0.918puts every agent off the top of the scale and reads asVerified. A TTP score is already 0-1, so it maps across unscaled. The guide now states that, keeps the 0-1000 integer scale only for downstream consumers that explicitly ask for it, and gains a §6.4.1 on mapping consequence severity onto AGT'sExecutionRingrather than duplicating it.sdk/python/agt.pyMirrors
packages/pctr/src/agt.mjs: consequence classification,TrustScoreand tiers,ExecutionRingmapping, SPIFFE ids,input.ttpclaims for Rego, behavioural evidence, AgentMesh attestations, and event normalization over AGT's real shapes (PolicyDecisionResult,AuditEntry,CascadeEvent,RingViolation,TrustVerificationResult).Keeping the two in step
Two implementations agree only as long as something checks.
scripts/check-agt-parity.mjsruns both over one shared corpus — 52 checks across classification, tiers, scores, rings, domains and event normalization — and fails the build on divergence.I verified the gate actually bites: moving the Python
trustedthreshold from 0.6 to 0.65 fails with exit 1 and names the failing check.Verification
agt.py, runs the Python tests, and enforces parity on every PR🤖 Generated with Claude Code