Overview
The authorization flow follows a multi-stage lifecycle:Claim Lifecycle States
1. Pending
Initial state when a service submits an authorization request. Characteristics:- Awaiting namespace owner decision
- Not yet enforceable
- Notifications sent to owner
- Can be approved or rejected
2. Approved
Owner has granted authorization. Characteristics:- Enforceable by gateway
- Included in approved claims feed
- Can be revoked at any time
- Optionally written to blockchain
3. Rejected
Owner has denied authorization (terminal state). Characteristics:- Not enforceable
- Cannot be approved without resubmission
- Service receives rejection notification
4. Revoked
Previously approved authorization has been revoked (terminal state). Characteristics:- No longer enforceable
- Removed from approved claims feed
- Service receives revocation notification
- Gateway immediately blocks requests
Complete Authorization Flow
End-to-End Sequence
Detailed Steps
Step 1: Claim Submission
Services submit authorization requests on behalf of agents. API Call:The service API key is obtained when registering a service via
POST /v1/services. The request must also include valid Sigilum signed headers.- API validates service API key and signed headers
- Checks for duplicate claims (same namespace + public_key + service)
- Creates claim record in
pendingstate - Sends notification to namespace owner
- Optionally writes to blockchain queue
- Returns claim ID to service
connection_id + namespace:
- Default: 30 requests per minute
- Configurable:
GATEWAY_CLAIM_REGISTRATION_RATE_LIMIT_PER_MINUTE - Rejection:
AUTH_CLAIM_SUBMIT_RATE_LIMITED
Step 2: Owner Notification
The namespace owner receives notification through:- Dashboard - Real-time notification in UI
- Email - Email alert with approval link
- Webhook - Service webhook (if configured)
Step 3: Owner Decision
The namespace owner makes a decision via dashboard or API. Approval:- API updates claim status to
approved - Webhook sent to service:
request.approved - Claim added to approved claims feed
- Blockchain event recorded (if enabled)
- Gateway begins enforcing authorization on next cache refresh
Approval is idempotent - approving an already approved claim is a no-op.
Step 4: Gateway Enforcement
The gateway enforces approved authorizations on every request. Approved Claims Feed Query:- Queries approved claims feed periodically (default: every 30 seconds)
- Caches claims in memory for fast lookup
- Validates claim exists for
(namespace, public_key, service)triple - Fails closed if cache is unavailable:
AUTH_CLAIMS_UNAVAILABLE
- Extract Identity - Parse
sigilum-namespace,sigilum-agent-keyfrom headers - Verify Signature - Validate RFC 9421 signature
- Check Nonce - Ensure nonce hasn’t been seen (replay protection)
- Lookup Claim - Query local cache for approved claim
- Resolve Connector - Load connection config and secrets
- Forward Request - Inject auth and proxy to upstream
| Code | Meaning |
|---|---|
AUTH_HEADERS_INVALID | Duplicate or malformed signed headers |
AUTH_SIGNATURE_INVALID | RFC 9421 signature verification failed |
AUTH_SIGNED_COMPONENTS_INVALID | Missing required signed components |
AUTH_IDENTITY_INVALID | Invalid Sigilum identity headers |
AUTH_NONCE_INVALID | Nonce missing or malformed |
AUTH_REPLAY_DETECTED | Nonce already seen (replay attack) |
AUTH_CLAIMS_UNAVAILABLE | Claims cache unavailable |
AUTH_CLAIMS_LOOKUP_FAILED | Claim cache lookup failed |
AUTH_CLAIM_REQUIRED | No approved claim found |
AUTH_CLAIM_SUBMIT_RATE_LIMITED | Claim submission rate limit hit |
AUTH_FORBIDDEN | Generic authorization denial |
Step 5: Revocation
Owners can revoke authorization at any time. API Call:- API updates claim status to
revoked - Webhook sent to service:
request.revoked - Claim removed from approved claims feed
- Blockchain event recorded (if enabled)
- Gateway stops enforcing on next cache refresh (typically within 30 seconds)
Verification Endpoint
Services can verify individual authorizations via the verification endpoint. API Call:- Point verification for specific requests
- Pre-flight authorization checks
- Service-side validation before expensive operations
The approved claims feed (
GET /v1/namespaces/claims) is more efficient for gateways that handle many requests, as it provides batch claim data for caching.Webhook Delivery
Services can register webhooks to receive authorization lifecycle events.Webhook Configuration
Webhook Events
request.submitted - New claim submitted:
request.approved - Claim approved:
request.rejected - Claim rejected:
request.revoked - Claim revoked:
Webhook Reliability
Webhook delivery is durable with:- Exponential backoff - Retry with increasing delays
- Retry window - Configurable via
WEBHOOK_RETRY_WINDOW_HOURS - Signature verification - HMAC signature with webhook secret
- Terminal failure alerts - Email notification on permanent failure
Blockchain Integration
Sigilum optionally writes authorization events to the blockchain for immutable audit logs.Blockchain Modes
Configured viaBLOCKCHAIN_MODE:
| Mode | Behavior | Use Case |
|---|---|---|
disabled | Skip blockchain writes | Testing, cost optimization |
sync | Execute inline (synchronous) | Immediate consistency required |
memory | In-memory async queue | Local testing |
queue | Durable queue-backed writes | Production (recommended) |
Smart Contract Events
TheSigilumRegistry contract emits events:
Blockchain writes provide an immutable audit log but add latency and cost. Use
queue mode in production to decouple blockchain writes from API response time.Auto-Registration (Gateway)
The gateway can automatically submit claims when an unauthorized request is received. Trigger:- Agent makes signed request to gateway
- Gateway verifies signature (valid)
- Gateway checks approved claims (not found)
- Gateway submits claim to API automatically
- Gateway returns
AUTH_CLAIM_REQUIREDto agent - Owner receives notification to approve
- Per
connection_id + namespacepair - Default: 30 requests per minute
- Configurable:
GATEWAY_CLAIM_REGISTRATION_RATE_LIMIT_PER_MINUTE
Security Considerations
Nonce Replay Protection
Requirements:- Nonce must be unique per request
- Nonce must be fresh (within replay window)
- Nonce checked against in-memory cache
- Process-local only (not distributed)
Signature Verification
All requests must have valid Ed25519 signatures covering:- HTTP method
- Request path
- Identity headers
- Content digest (if body present)
Certificate Validation
Thesigilum-agent-cert header must:
- Be properly formatted and parseable
- Match the namespace in
sigilum-namespace - Match the public key in
sigilum-agent-key - Have valid signature
- Not be expired (if expiry set)
Best Practices
Webhook Signature Verification
Always verify webhook signatures using the webhook secret to prevent spoofing
Cache Approved Claims
Use the claims feed endpoint to cache approved claims locally for performance
Handle Revocation Delay
Account for gateway cache refresh interval (30s default) when revoking
Monitor Rate Limits
Monitor claim submission rate limits to avoid auto-registration failures
Next Steps
Deployment Modes
Learn about managed, enterprise, and local deployment options
Gateway Configuration
Configure gateway settings and rate limits
API Reference
Explore all API endpoints in detail
Gateway API
Learn about gateway error codes and handling