API Architecture
Control Plane
Configuration, reporting, and management operations
Data Plane
Package insights, scanning data, and tool integrations
All APIs for security tools integration are part of the Data Plane. These APIs require an API key for authentication and may enforce rate limits under a fair usage policy.
API Endpoints and Authentication
Each plane has its own endpoint and authentication method:- Data plane (
api.safedep.io): package insights, scanning, and malware analysis. Authenticated with an API key. - Control plane (
cloud.safedep.io): tenant, policy, and management operations. Authenticated with a JWT.
Data Plane Authentication
API Key Authentication
The standard method for tool integrations and automated access:Control Plane Authentication
OAuth2/OIDC Integration
The SafeDep Cloud Identity Service athttps://auth.safedep.io provides OAuth2/OIDC authentication.
OpenID Configuration Endpoint:
Device Code Flow
For command-line tools, use the OAuth2 Device Code flow:Programmatic Integration
For custom applications, implement the OAuth2 Device Code flow. A reference implementation is available in the Vet OAuth2 client.Authentication Examples
Basic API Key Usage
JWT-Based Access
GitHub Actions Integration
Authentication Headers
The SafeDep API is a gRPC API with a ConnectRPC facade, not a REST API. Regardless of transport (gRPC over HTTP/2 or JSON over HTTP/1.1), requests carry the same two headers:| Header | Value |
|---|---|
Authorization | Your API key or JWT, sent as-is (no Bearer prefix) |
X-Tenant-ID | Your tenant domain (e.g. your-company.safedep.io) |
- Data plane (
api.safedep.io) accepts an API key or a JWT. - Control plane (
cloud.safedep.io) accepts a JWT.
Rate Limiting
SafeDep Cloud enforces rate limits at the API gateway, measured per second, with no hourly quota:- Data plane (
api.safedep.io): up to 500 requests/second per API key - Management API: up to 20 requests/second
Security Best Practices
API Key Management
API Key Management
- Store API keys securely using environment variables or secret management systems
- Rotate API keys regularly (recommended: every 90 days)
- Use different API keys for different environments (dev, staging, prod)
- Never commit API keys to version control
JWT Token Handling
JWT Token Handling
- JWT tokens have limited lifetime (typically 24 hours)
- Implement automatic token refresh in long-running applications
- Store tokens securely in the OS keychain when possible
- Clear tokens on logout or application termination
Network Security
Network Security
- Always use HTTPS for API communications
- Implement proper certificate validation
- Consider IP allowlisting for production environments
- Monitor authentication logs for suspicious activity
Troubleshooting Authentication Issues
Common Error Messages
”User Not Found”
”Tenant Not Found”
Authentication Debugging
API Reference
API Specification
Canonical gRPC/ConnectRPC schemas, docs, and generated SDKs
OAuth2 Implementation
Reference implementation for OAuth2 Device Code flow
Quick Start Guide
Get started with SafeDep Cloud authentication

