Bearer Token Authentication
Rampart uses bearer token authentication for API access. The token is automatically generated when you install the service.Token Location
The token is stored in:Using the Token
Include the token in theAuthorization header:
Header Format
Token Management
View Current Token
Display the current bearer token:Rotate Token
Generate and persist a new bearer token:Rotating the token invalidates all existing API clients. You’ll need to restart
rampart serve and update any scripts or integrations that use the old token.Authentication Methods by Endpoint
Different endpoints support different authentication methods:Bearer Token Only
Most endpoints require theAuthorization: Bearer <token> header:
POST /v1/tool/{toolName}POST /v1/preflight/{toolName}GET /v1/approvalsPOST /v1/approvalsGET /v1/statusGET /v1/policy- All audit endpoints
No Authentication Required
Health check endpoint is public:Multiple Authentication Methods
Event Stream
GET /v1/events/stream accepts either:
Header-based:
Query parameter authentication is provided for clients that cannot set custom headers (e.g., EventSource in browsers).
Approval Resolution
POST /v1/approvals/{id}/resolve accepts:
- Bearer token (standard)
- Signed URL with
sigandexpquery parameters (when signing is enabled)
Signed URLs are generated by the server when webhook notifications are configured. They include an HMAC signature and expiration timestamp.
Security Recommendations
File Permissions
Keep token file permissions restrictive:Token Rotation
Rotate tokens periodically or after suspected exposure:Environment Variables
When usingRAMPART_TOKEN in scripts, ensure the environment is secure:
Signed URLs
Signed approval URLs are time-limited and single-use:- They expire at the
exptimestamp - They cannot be replayed after the approval is resolved
- HMAC signature ensures authenticity
Error Responses
Missing Token
401 Unauthorized
Invalid Token
401 Unauthorized
Expired Signature (Signed URLs)
401 Unauthorized
Next Steps
Tool Evaluation
Evaluate tool calls with the API
Status
Check server status and health