Compliance
Every governed result connects the decision to your rules and controls. Read the answer in your app, then build a point-in-time evidence packet from the same data.
Status: Beta Companion docs: Policies · Traces and graph · Receipts Source of truth: Attestation and compliance API · Governance controls API.
The crosswalk starts on the result
result = tr.result(response)
for row in result.compliance:
print(row["framework"])
print(row["version"])
print(row["controls"])
The app gets one clear verdict. The compliance block explains which declared rules and controls relate to it.
Read the current posture
view = tr.compliance
for framework in view.frameworks.body["frameworks"]:
print(
framework["framework"],
framework["version"],
framework["compliance_pct"],
)
A short selector such as soc2 resolves to a versioned control set for AI work. Pin the full selector when a report must repeat later:
tr.govern(frameworks=["soc2@2026.1.agent-default"])
Drill into one framework
controls = tr.compliance.controls("soc2")
for control in controls.body["controls"]:
print(control["control_id"])
print(control["coverage"])
print(control["data_source"])
Coverage can be full, partial, or manual. The data source tells the reviewer where the supporting evidence comes from.
Capture a point in time
snapshot = tr.compliance.evidence_snapshot(
framework="soc2",
period_start="2026-07-01T00:00:00Z",
period_end="2026-08-01T00:00:00Z",
)
snapshot_id = snapshot.body["snapshot_id"]
packet = tr.compliance.export(snapshot_id=snapshot_id)
A snapshot freezes the evidence window. Export the existing snapshot instead of rebuilding a new report for each reviewer.
Search violations across governed surfaces
critical = tr.compliance.violations(
framework="soc2",
severity="critical",
status="blocked",
date_from="2026-08-01T00:00:00Z",
date_to="2026-08-23T23:59:59Z",
)
for violation in critical.body["violations"]:
print(violation["subsystem"], violation["governance_reason"])
This search can span proxy, chat, MCP, and CLI records while keeping the control mapping attached.
Inspect the baseline bundle
preset = tr.compliance.preset.body
print(preset["guardian"]["name"])
print(preset["mcp"])
print(preset["cli"])
The preset view shows the live baseline state for the organization. Optional pieces are None when the organization has turned them off.
Where to go next
- Traces and graph follows a control back to its decisions and Guardians.
- Receipts verifies the signed proof for a governed event.
- SDK observability exports governed activity for other systems.