Overview
Checks are the core of integrations - they validate compliance against external services and report findings. A check:- Fetches data from the service API
- Analyzes it for compliance issues
- Reports findings (failures) or passing results (successes)
- Can map to compliance tasks for auto-completion
Check Structure
CheckContext API Reference
HTTP Methods
Pagination
Auto-pagination (for standardized APIs):GraphQL
Logging
- API console during development
- Trigger.dev dashboard for background jobs
- Check run logs in database
State Storage
For checks that need to remember data between runs:Available Data
Reporting Findings
ctx.fail() - Report an Issue
title- Short summaryresourceType- Category of resourceresourceId- Unique identifierseverity- How serious is this?description- What’s wrongremediation- How to fix
evidence- Any relevant data (stored as JSON)
ctx.pass() - Report Success
- Check completed successfully
- Informational results (not just absence of findings)
- Evidence for auditors
- Just because no issues found (that’s implied if no
fail()calls) - For intermediate steps (use
ctx.log()instead)
Severity Levels
| Level | When to Use | Example |
|---|---|---|
critical | Immediate security risk, compliance violation | No encryption, public S3 buckets |
high | Serious issue, needs urgent fix | 2FA disabled, admin without MFA |
medium | Important but not urgent | Outdated dependencies, missing alerts |
low | Minor issue, best practice | Naming conventions, documentation |
info | Informational, no action needed | Configuration review, statistics |
Task Mapping
Auto-complete compliance tasks when checks pass:packages/integration-platform/src/task-mappings.ts for the full list.
Benefits:
- Automatic task completion
- Reduces manual work
- Keeps tasks in sync with real state
Error Handling
User-Friendly Errors
Bad:Common Error Patterns
Permission denied:Performance Tips
Batch API Calls
Bad:Cache Results
Testing Checks
Manual Testing
- Connect the integration with real credentials
- Run the check from Cloud Tests or a task
- Verify:
- No errors in API logs
- Findings appear correctly
- Remediation steps are clear
- Evidence contains useful data
Error Case Testing
Test that your check handles:- Missing permissions (403 errors)
- Invalid credentials (401 errors)
- Resource not found (404 errors)
- Rate limiting (429 errors)
- Empty datasets (no resources to check)
- Malformed responses
Edge Cases
- User has no resources (empty org)
- All resources are compliant (no findings)
- Variables not configured (required variables missing)
- Dynamic options return empty list
Examples
Simple Check (No External Data)
Data Fetching Check
Iterating Over Resources
Best Practices
Findings vs Passing Results
Only create findings for actual issues:ctx.pass():
- Summary results (e.g., “100 users checked, all have 2FA”)
- Evidence for auditors (e.g., “Access review completed on 2024-12-08”)
- Don’t use for absence of findings
fail() results are shown. Passing results are filtered out.
Resource Types
Use consistent resource types:| Type | Examples |
|---|---|
repository | GitHub/GitLab repos |
user | Users, accounts, members |
team | Teams, groups, org units |
project | Projects, workspaces |
deployment | Deployments, releases |
security-setting | Security configs |
iam-policy | Access policies |
alert | Monitoring alerts |
configuration | Integration settings |
Evidence
Include useful data for auditors:Remediation Steps
Be specific and actionable:Performance Considerations
Don’t Over-Fetch
Rate Limits
The platform handles retries automatically, but you can help:Timeouts
Checks have a 15-minute timeout (Trigger.dev default). For long-running checks:Examples from Built-in Integrations
GitHub: Secret Scanning
AWS: Security Hub Findings
Checklist for a Good Check
- Clear, descriptive ID (kebab-case)
- User-friendly name
- Helpful description
- Proper error handling for common cases
- Meaningful resource types and IDs
- Specific remediation steps
- Useful evidence (not too much, not too little)
- Appropriate severity levels
- Task mapping (if applicable)
- Variables for user configuration (if needed)
- Tested with real API credentials
- Handles edge cases (empty data, missing resources)
Summary
Checks are the heart of integrations. Write them to be:- Focused: One check = one compliance validation
- 🧑💻 User-friendly: Clear errors, actionable remediation
- 🔒 Secure: Handle credentials properly, never log secrets
- ⚡ Efficient: Batch requests, handle pagination
- 🧪 Tested: Verify with real credentials and edge cases

