Skip to main content
POST
Evaluate Policy

Overview

Evaluate trust policies to determine if a subject meets specific trust requirements. This endpoint allows you to check compliance with trust-based access control, verify credentials, and assess eligibility for services based on trust scores and attestations.
Use this endpoint to implement trust-based access control, verify user credentials, and assess eligibility for services based on trust requirements.

Parameters

object
required
Trust policy to evaluate
string
required
Subject identity to evaluate (ZKS ID or wallet address)
object
Additional context for evaluation
object
Evaluation options

Response

boolean
Indicates if the evaluation was successful
boolean
Whether the subject passed the policy evaluation
number
Overall evaluation score (0-100)
number
Policy threshold score
string
Evaluated subject identity
object
Policy details
array
Requirement evaluation results
array
Relevant attestations used in evaluation
object
Score breakdown by category
array
Recommendations for improvement
string
ISO 8601 timestamp of the evaluation

Examples

Response Example

Use Cases

1. Access Control

Implement trust-based access control:

2. Credential Verification

Verify user credentials:

3. Service Eligibility

Check eligibility for services:

4. Policy Testing

Test policies before deployment:

5. Policy Optimization

Optimize policies based on results:

Best Practices

1. Policy Design

Design effective policies:

2. Caching

Cache policy evaluations:

3. Error Handling

Handle evaluation errors:

4. Monitoring

Monitor policy performance:

Troubleshooting

”Policy not found”

Cause: Invalid policy ID or policy doesn’t exist. Solution:
  • Verify the policy ID is correct
  • Check if the policy exists
  • Ensure you have access to the policy

”Subject not found”

Cause: Invalid subject identity or subject doesn’t exist. Solution:
  • Verify the subject identity is correct
  • Check if the subject exists
  • Ensure the subject has some activity

”Invalid policy format”

Cause: Policy structure is invalid. Solution:
  • Check the policy structure
  • Ensure all required fields are present
  • Validate the policy format

”Evaluation failed”

Cause: Internal error during evaluation. Solution:
  • Check the policy requirements
  • Verify the subject data
  • Contact support if the issue persists

Rate Limits

Policy evaluation requests are subject to rate limits:
  • Free tier: 60 requests per minute
  • Starter tier: 300 requests per minute
  • Professional tier: 1,000 requests per minute
  • Enterprise tier: Custom limits
Implement caching to reduce API calls.