Skip to content

examples: add TEE signature audit trail#211

Open
ygd58 wants to merge 1 commit intoOpenGradient:mainfrom
ygd58:examples/tee-audit-trail
Open

examples: add TEE signature audit trail#211
ygd58 wants to merge 1 commit intoOpenGradient:mainfrom
ygd58:examples/tee-audit-trail

Conversation

@ygd58
Copy link
Copy Markdown

@ygd58 ygd58 commented Mar 27, 2026

Summary

Adds examples/llm_audit_trail.py — demonstrates how to build a
tamper-proof audit log from TEE-verified inferences.

What it demonstrates

  • Capturing TEE signature, TEE ID, and timestamp from every inference
  • Computing a SHA-256 content hash of prompt+response for tamper detection
  • Persisting a structured audit log to JSON
  • Verifying the audit log locally to detect any post-write tampering
  • Using INDIVIDUAL_FULL settlement for maximum on-chain transparency

Why it's useful

OpenGradient's core value proposition is verifiable AI. This example
shows users exactly how to operationalize that — capturing and verifying
cryptographic proof of every inference. Useful for compliance workflows,
DeFi protocols, and any application requiring an audit trail.

Testing

export OG_PRIVATE_KEY="your_private_key"
python examples/llm_audit_trail.py

Shows how to build a tamper-proof audit log from TEE-verified
inferences. Each entry captures the transaction hash, TEE signature,
TEE ID and a SHA-256 content hash for local tamper detection.
Uses INDIVIDUAL_FULL settlement for maximum on-chain transparency.
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