Skip to content

Add the Python AGT bridge, and fix the trust scale our guide got wrong - #53

Merged
blocksifrdev merged 1 commit into
mainfrom
feat/agt-python-bridge
Sep 15, 2026
Merged

blocksifrdev merged 1 commit into
mainfrom
feat/agt-python-bridge

Conversation

@blocksifrdev

Copy link
Copy Markdown
Collaborator

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 and docs/ecosystem-integrations.md specified:

agt_trust_score = round(ttp_score * 1000)

That is wrong against upstream AGT. Its TrustScore.overall is [0.0, 1.0], banded into tiers by agent-governance-typescript/src/trust.ts:

Tier Threshold
Untrusted 0.0
Provisional 0.30
Trusted 0.60
Verified 0.85

Sending 918 where AGT expects 0.918 puts every agent off the top of the scale and reads as Verified. 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's ExecutionRing rather than duplicating it.

sdk/python/agt.py

Mirrors packages/pctr/src/agt.mjs: consequence classification, TrustScore and tiers, ExecutionRing mapping, SPIFFE ids, input.ttp claims 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.mjs runs 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 trusted threshold from 0.6 to 0.65 fails with exit 1 and names the failing check.

PCTR/AGT bridge parity OK — JavaScript and Python agree across 52 checks.

Verification

  • 138 JavaScript tests, 19 Python tests, all passing
  • CI now compiles agt.py, runs the Python tests, and enforces parity on every PR

🤖 Generated with Claude Code

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>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@blocksifrdev
blocksifrdev deployed to protected-execution September 15, 2026 13:39 — with GitHub Actions Active
@blocksifrdev
blocksifrdev merged commit 6e14cd5 into main Sep 15, 2026
4 checks passed
@blocksifrdev
blocksifrdev deleted the feat/agt-python-bridge branch September 15, 2026 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant