Compliance API¶
CRP exposes compliance and audit capabilities through two high-level proxies on the SDKClient instance: client.compliance.* and client.audit.*. These proxies wrap the underlying security and provenance subsystems into a concise, auditable surface.
Compliance Proxy¶
classify()¶
Classify content against configured compliance frameworks.
result = client.compliance.classify(
text="We use this system to screen resumes.",
frameworks=["eu_ai_act", "gdpr"],
)
report()¶
Generate a multi-framework compliance report for the current session or task.
report = client.compliance.report()
print(report.summary.compliance_score)
print(report.summary.implemented_controls)
print(report.summary.total_controls)
controls()¶
List the active compliance controls and their status.
Audit Proxy¶
client.audit.* provides a tamper-evident view of the session's audit trail.
events()¶
Return the audit events.
export()¶
Export the audit trail to a portable format.
verify()¶
Verify the HMAC chain integrity.
summary()¶
Return a concise summary of the audit trail.
Response metadata¶
Every complete() and ask() response also carries compliance signals in response.crp:
| Attribute | Meaning |
|---|---|
compliant | Compliance classification result |
risk | LOW, MEDIUM, HIGH, CRITICAL |
fabrications | Detected fabrications |
injection_detected | Prompt-injection flag |
pii_detected | PII detection flag |
chain_valid | Audit-chain integrity status |