Attestation API Reference
The Attestation API provides the tools to verify that your code is running in a genuine Trusted Execution Environment with the expected security properties. Attestation is a critical security feature that provides cryptographic guarantees about the integrity and authenticity of the execution environment.
Getting Started
Prerequisites
To use the Attestation API, you need:
- The TERE SDK installed (
npm install @praecise/tere
) - A deployed TERE application (see the Runtime API)
Attestation Workflow
- When you execute a function in a TEE, an attestation report is automatically generated
- The attestation report is included in the execution response
- You verify the attestation using the client's
verifyAttestation
method - Based on the verification result, you can trust or reject the execution result
Core API Methods
Verifies an attestation report to ensure it came from a genuine TEE with the expected security properties.
Parameters
options
: VerifyAttestationOptionsRequiredOptions for attestation verification
Returns
Result of the attestation verification, including validity and security details
Examples
Basic verification
With nonce for freshness
Retrieves a fresh attestation report from a deployed TEE instance without executing a function.
Parameters
scriptId
: stringRequiredID of the script to get an attestation report for
options
: GetAttestationOptionsOptional settings for attestation generation
Returns
Response containing the attestation report and related metadata
Examples
Get an attestation report
With custom data
Verification Options
When verifying an attestation, you can specify various requirements that the attestation must meet:
Attestation Details
When an attestation is verified, the verification result includes detailed information about the TEE:
Advanced Usage
Custom Verification Logic
You can implement custom verification logic using the customVerifier
option:
Verification with Full Requirements
For highly secure applications, you may want to enforce strict requirements:
Best Practices
- Always Verify Attestations
Always verify attestations for any sensitive operations to ensure the code is running in a genuine TEE.
- Use Nonces for Freshness
Include a unique nonce in every execution to prevent replay attacks. A nonce ensures that the attestation was generated for this specific request and not reused from a previous one.
- Specify Required Security Features
For sensitive workloads, explicitly specify the required TEE type, whether secure boot must be enabled, and other security requirements.
- Implement Error Handling
Properly handle and log attestation verification failures. Treat unverified results as potentially compromised.